Skip to content Skip to sidebar Skip to footer

Ml Model Is Failing To Impute Values

I've tried creating an ML model to make some predictions, but I keep running into a stumbling block. Namely, the code seems to be ignoring the imputation instructions I give it, re

Solution 1:

If you examine your dataset, there are Nan values in some fields, such as the Rating field. This explains the Input error. Handling missing data is up to you, and there are many approaches to handling missing data. You can consult this pandas doc to help you handling such missing data.

Solution 2:

Your numeric scaling transformer is probably the one complaining: you haven't imputed before the StandardScaler is applied. Probably you wanted something like this:

imp_sc = make_pipeline((num_imp),(sc))

# Col Transformation
col = make_column_transformer((imp_sc,num),
                              (enc_oh,oh_col),
                              (enc_cb,cb_col))

Post a Comment for "Ml Model Is Failing To Impute Values"