Here’s a comprehensive description of the project:
train_v2.csv.zip — indexed by id, contains loan features and a loss target column.test_v2.csv.zip — same features, no target; used for final predictions.The data is high-dimensional with many columns, and both train and test sets contain missing values across multiple features.
1. Data Loading & Exploration
df_nulls() function that reports both the count and percentage of nulls per column.2. Feature Selection — Numeric Only
loss target is null from the training set.3. Train/Validation Split
train_test_split (with random_state=42 for reproducibility).4. Preprocessing Pipeline
Pipeline with two steps:
SimpleImputer (mean strategy) — fills missing values.StandardScaler — normalizes numeric features.ColumnTransformer for clean, leak-free application.5. Feature Importance via Permutation Importance
eli5’s PermutationImportance on a 1,000-sample validation subset to rank features by their actual impact on predictions.SelectFromModel with a threshold of 0.001 to filter down to only the most predictive features.6. Model Training — Random Forest Classifier
RandomForestClassifier with:
n_estimators=10 (10 trees — relatively small)criterion='entropy'7. Submission
submission.csv file in the format required by the Kaggle competition.| Aspect | Detail |
|---|---|
| Target variable | loss — a binary/multiclass classification target |
| Feature engineering | None; raw numeric features only |
| Imputation | Mean imputation (could miss non-MAR patterns) |
| Feature selection | Permutation importance via a proxy Logistic Regression |
| Final model | Random Forest (small forest with 10 estimators) |
| Evaluation metric | Cross-validation accuracy |
| Categorical features | Dropped entirely |