Creating a Bean for NaN Values

I am trying to do some data analysis, and the idea is to use the command autobinningto create optimal bins, calculate the WOE value (weight of evidence) for each bunker and then replace the original values ​​belonging to each bunker with the corresponding WOE value. So here 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 procedure described above does not take into account the values NaNthat are in DATA and automatically excludes them.

My goal is to create a separate bit for values ​​only NaNand make the command autobinningtake values ​​into account NaN.

Does anyone have a reasonable solution?

+6
source share
1 answer

Find all the NaN values.

Select a value that is not in your data.

Replace all NaN values ​​with this value.

Start your binning and first match this value with NaN.

+2
source

Source: https://habr.com/ru/post/1016992/


All Articles