forked from eyra/fertility-prediction-challenge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
1 addition
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,3 @@ | ||
# Description of submission | ||
|
||
This example demonstrates a problem that is likely to be quite common. There are many cases when some category of a categorical variable is present in the holdout data, but absent in the training data. If you are creating dummy variables at the preprocessing stage (or using one-hot encoding, etc.), applying the same clean_df function to the training and to the holdout data will lead to different results - to the datasets with different sets of variables. This will lead to the failed run on the fake data and on the holdout data. | ||
|
||
|
||
In this example we use LASSO regression. It requires all categorical variables to be turned into dummies. | ||
We include a variable cf20m180 (satisfaction with relationships with the current partner) in a model. | ||
If we select only cases in the training data for which the outcome is available, there are no people who answered 0 and 1 (very dissatisfied). This is why there will be two columns missing 2 (for cf20m180==0 and cf20m180==1) | ||
These categories however appear in the full train set - and are likely to appear in the holdout data, in which case it will introduce errors. | ||
|
||
In this example we create additional factor levels to deal with this problem. | ||
|
||
|
||
UPD: plus test adding external data using fake external data | ||
Example submission - with correct model.rds (in previous version one variable was missing, gender_bg) |