This function wrap all the functions to get the raw risk factors speicified score, daymileage, discount coef. Before use this function, pleage make sure that your data and cofiguration are correct.
cal_user_coef(df, risk_names, score_config_list, rf_weight, discount_index)
df | Raw risk factors data.frame/tibble with the correct col names. |
---|---|
risk_names | Correct col names to calculate. |
score_config_list | A List contains all riskFactors value and score index, read from .RDS file. |
rf_weight | Correct col names of risk factors weight, sum to 1. |
discount_index | Specified score and coef. |
a tibble
/ data.frame
# NOT RUN { cal_user_coef(pj_rf, "mielage", score_config_list, rf_weight, discount_index) risk_names <- 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") cal_user_coef(pj_rf, risk_names, score_config_list, rf_weight, discount_index) # }