Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a Bin for NaN values

I am trying to do some data analysis and the idea is to use the autobinning command to create optimal bins, calculate the WOE (Weight of evidence) value for each bin and then replace the original values that belong to each bin with the respective WOE value. So below is what I do:

CreSC = creditscorecard(Data_Table ,'IDVar','CustID','GoodLabel',0);
scAB = autobinning(CreSC,'Algorithm','Monotone');
DataTransformed = bindata(scAB,t_Data,'OutputType','WOE');

The problem is that the above procedure does not consider the NaN values that are in the DATA and automatically excludes them.

My aim is to create a separate bin only for the NaN values and force the autobinning command to consider the NaN values.

Does anyone have a reasonable solution ?

like image 769
Man Gou Avatar asked Nov 08 '22 22:11

Man Gou


1 Answers

Find all NaN values.

Pick a value that is not present inside your data.

Replace all NaN values by this value.

Run your binning, and map this value yourself to NaN in the end.

like image 55
Stack Player Avatar answered Nov 15 '22 08:11

Stack Player