cal_user_coef: A big wrapper of get user insurance discount coef.

Description Usage Arguments Value Author(s) Examples

Description

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.

Usage

1
cal_user_coef(df, risk_names, score_config_list, rf_weight, discount_index)

Arguments

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.

Value

a tibble / data.frame

Author(s)

Wei Zhao

Examples

1
2
3
4
5
6
7
8
9
## 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)

## End(Not run)

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