sum_rf_score: Sum every risk factor score

Description Usage Arguments Value Author(s) Examples

Description

You should carefull about the risk facotrs rf_score names and the rf_weight names,they should be the same.

Usage

1
sum_rf_score(rf_score, rf_weight)

Arguments

rf_score

The result of rf2score

rf_weight

Risk factors weight, sum to 1.

Value

A n*1 tibble/data.frame, the name is score.

Author(s)

Wei Zhao

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
pj_rf <- readr::read_csv("data/pingjia/pingjia_result.csv",col_names = FALSE)
nameTmp <- c("acc_count_phk","act_radius","dec_count_phk","high_curv_tr",
"holiday_tr", "interstate_r","lane_change_phk","late_night_tr","long_tr",
"main_act_prov" , "mileage","speeding_lvl", "speeding_phk", "trip_dis_e",
"turn_count_phk", "user_id")
names(pj_rf) <- nameTmp

user_id <- pj_rf[["user_id"]]
pj_rf <- select(pj_rf, -user_id)

score_config_list <- readRDS("result/score_config_list.RDS")
rf_score <- rf2score(pj_rf, score_config_list)

rf_weight <- readRDS("result/rf_weight.RDS")
sum_rf_score(rf_score, rf_weight)


## End(Not run)

BruceZhaoR/pjutils documentation built on May 20, 2019, 11:38 a.m.