-
I want to construct a feature that should be rounded like below, but I "cannot convert float NaN to integer". but if I use "Preprocess", I cannot construct my feature Can I use "Test and Score" in this situation? Or what should I do to prevent testing set leaking to training set? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
The error message looks strange ... but can your MonthlyCharges equal 0? Does Note that you probably don't want to use |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Ah, of course, I see. Can you try using |
Beta Was this translation helpful? Give feedback.
Ah, of course, I see.
Can you try using
round(TotalCharges/MonthlyCharges) if MonthlyCharges == MonthlyCharges > 0 else 0
in Feature Constructor? This should handle missing values, I guess.