Closed binomaiheu closed 3 months ago
Een probleempje voor imputer_scaler: het idee was om de knn imputer te gebruiken voor de score (en dus de scaling die je hebt toegevoegd voor score toe te passen). Maar in deze wordt volledig Train_V2 (ook output) gebruikt en die hebben we niet in score. Dit heeft fouten, hier moeten we nog iets op verzinnen.
We kunnen scaler en imputer ook enkel voor input data gebruiken, X_train_V2 = train_V2.drop(columns=['outcome_profit','outcome_damage_inc','outcome_damage_amount'], inplace=False), maar om dat dan terug in train_V2 te krijgen, daar ga ik toch nog even moeten op zoeken. staat voorlopig in comment
Samen bekeken en gewerkt met input data voor scaler en voor imputer
So i changed the KNNImputer in the following way :
with some additional explanation :
Instead of separating between numerical and categorical values, we will use a KNNImputer to make optimal use of possible correlations between the features. However, as the KNN technique is sensitive to the scale of the features (it uses a distance based metric), we first have to rescale the features before being able to use a KNNImputer. Most of our features are categorical between 0 and 1, so we'll just use a MinMaxScaler between 0 and 1 to rescale to that fixed range...