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

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.

Examples

# 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)

# }