#include <SDBVMat.h>
Inheritance diagram for PLearn::SDBVMFieldICBCTargets:
The output has at least 1 value and at most 8 values (number of outputs = targetname=="ALL"?5:1 + int(use_roadstar) + int(add_claims_sum_column) + int(rescale_by_interval)). targetname can be "ALL" or one of the 5 other targets (excluding "roadstar_incurred"), or sum_all_but_BI. There are targetname=="ALL"?5:1 + int(use_roadstar) "*_incurred" targets + possibly one target corresponding to the sum of all the "*_incurred" targets (if add_claims_sum_column==true) and possibly one "weight" if rescale_by_interval==true. If targetname=="sum_all_but_BI" then there is only one target, which is the sum of all 4 KOLs excluding Bodily Injury.
The weight is computed as follows: duration = Year(policy_end_date)-Year(policy_start_date) weight = duration^2
The 5 + int(use_roadstar) targets are computed as follows: _incurred_target = 0.001 * *_incurred; if (rescale_by_interval) _incurred_target /= duration if (rescale_by_start_date) _incurred_target /= smoothed *_incurred monthly mean for month m and year y where m and y are the month and year of the policy start date of the contract. (PS: for more information on the smoothed monthly means, read the comments in PLearn/Databases/ICBCdatabases.h) if is_missing(X_incurred_target) then X_incurred_target = 0
where Year is the date given in units of years (with fractional part), so that in the common case where the difference is one year, the weight is 1 and there is no normalization of the targets. Note that the target outputs are in UNITS OF 1000 DOLLARS PER YEAR.
This "weight" is the weight that should be given to the squared loss (f(x)-normalized_target)^2. This comes from the following reasoning:
We are to learn a function f(x) that predicts the incurred amounts for ONE YEAR, but the (x,target) pairs in the data may cover more or less than one year. So the loss should be (f(x)*duration - target)^2 where duration is in units of years. To make it more "standard" we instead consider the weighted squared loss, since (f(x)*duration - target)^2 = duration^2 * (f(x) - target/duration)^2 = w * (f(x) - normalized_target)^2
When add_claims_sum_column==true sum of targets = sum of all the *_incurred targets after they have been rescaled
PS: * Year is the date given in units of years (with fractional part), so that in the common case where the difference is one year, the weight is 1 and there is no normalization of the targets. Note that the target outputs are in UNITS OF 1000 DOLLARS PER YEAR. When rescale_by_interval==true, the "weight" is the weight that should be given to the squared loss (f(x)-normalized_target)^2. This comes from the following reasoning: We are to learn a function f(x) that predicts the incurred amounts for ONE YEAR, but the (x,target) pairs in the data may cover more or less than one year. So the loss should be (f(x)*duration - target)^2 where duration is in units of years. To make it more "standard" we instead consider the weighted squared loss, since (f(x)*duration - target)^2 = duration^2 * (f(x) - target/duration)^2 = w * (f(x) - normalized_target)^2
Definition at line 971 of file SDBVMat.h.
|
Definition at line 973 of file SDBVMat.h. Referenced by SDBVMFieldICBCTargets(). |
|
Definition at line 953 of file SDBVMat.cc. References inherited, PLearn::Mat, reference_start_date_month_, reference_start_date_year_, rescale_by_start_date_, and start_date_rescaling_values_. |
|
Given a database row, convert the appropriate parts to a (preallocated) output vector of the correct width (given by fieldWidth). Replace MISSING_VALUEs by missing_values_mapping. Implements PLearn::SDBVMField. Definition at line 1014 of file SDBVMat.cc. References accident_death_count_, accident_death_incurred_, add_claims_sum_column_, bodily_injury_count_, bodily_injury_incurred_, collision_lou_count_, collision_lou_incurred_, comprehensive_count_, comprehensive_incurred_, end_date_, PLearn::endl(), PLearn::SDBVMSource::getValue(), PLearn::is_missing(), PLearn::PDate::month, PLERROR, property_damage_count_, property_damage_incurred_, reference_start_date_month_, reference_start_date_year_, rescale_by_interval_, rescale_by_start_date_, start_date_, start_date_rescaling_values_, targetname_, PLearn::FieldValue::toDate(), PLearn::Vec, and PLearn::PDate::year. |
|
Width that the field occupies in the VMat.
Implements PLearn::SDBVMField. |
|
Definition at line 1018 of file SDBVMat.h. Referenced by convertField(). |
|
Definition at line 1012 of file SDBVMat.h. Referenced by convertField(). |
|
|
|
Definition at line 1001 of file SDBVMat.h. Referenced by convertField(). |
|
Definition at line 1016 of file SDBVMat.h. Referenced by convertField(). |
|
Definition at line 1010 of file SDBVMat.h. Referenced by convertField(). |
|
|
|
Definition at line 1019 of file SDBVMat.h. Referenced by convertField(). |
|
Definition at line 1013 of file SDBVMat.h. Referenced by convertField(). |
|
|
|
Definition at line 1020 of file SDBVMat.h. Referenced by convertField(). |
|
Definition at line 1014 of file SDBVMat.h. Referenced by convertField(). |
|
|
|
Definition at line 1009 of file SDBVMat.h. Referenced by convertField(). |
|
Definition at line 1017 of file SDBVMat.h. Referenced by convertField(). |
|
Definition at line 1011 of file SDBVMat.h. Referenced by convertField(). |
|
|
|
Definition at line 1007 of file SDBVMat.h. Referenced by convertField(), and SDBVMFieldICBCTargets(). |
|
Definition at line 1006 of file SDBVMat.h. Referenced by convertField(), and SDBVMFieldICBCTargets(). |
|
Definition at line 1002 of file SDBVMat.h. Referenced by convertField(). |
|
Definition at line 1003 of file SDBVMat.h. Referenced by convertField(), and SDBVMFieldICBCTargets(). |
|
Definition at line 1008 of file SDBVMat.h. Referenced by convertField(). |
|
Definition at line 1004 of file SDBVMat.h. Referenced by convertField(), and SDBVMFieldICBCTargets(). |
|
Definition at line 1005 of file SDBVMat.h. Referenced by convertField(). |
|
|