Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assign missing class to a bin & BinningProcess with user splits #53

Closed
billy-odera opened this issue Aug 5, 2020 · 2 comments
Closed
Labels
question Further information is requested

Comments

@billy-odera
Copy link

I am running the below

user_splits =  [2,6,14,24,34]
optb = OptimalBinning(name=variable, dtype="numerical", solver="mip",user_splits=user_splits)
optb.fit(x, y)
binning_table = optb.binning_table
binning_table.build()

that gives the below sample output
image
How do I force the missing bin to be in bin 0?

After running the user splits for the specific variables, how do I then use those splits when running the
binning_process = BinningProcess(variable_names, categorical_variables=categorical_variables, selection_criteria=selection_criteria) fro the scorecard

@guillermo-navas-palencia guillermo-navas-palencia added the question Further information is requested label Aug 5, 2020
@guillermo-navas-palencia
Copy link
Owner

Hi @billy-odera,

  1. It is not possible to combine the missing bin with other bins. A missing bin is automatically generated if the dataset includes missing data. However, you can change the WoE value from -0.418329 to -0.0854013 when transforming using transform function in OptimalGrouping: http://gnpalencia.org/optbinning/binning_binary.html#optbinning.OptimalBinning.transform; use metric_missing= -0.0854013.

  2. You need to pass a dictionary with particular options via parameter binning_fit_params. Example:

binning_fit_params = {
    "variable": {"dtype": "numerical", "solver": "mip", "user_splits": [2,6,14,24,34]}
}

binning_process = BinningProcess(variable_names, categorical_variables=categorical_variables, 
                                 selection_criteria=selection_criteria, binning_fit_params=binning_fit_params)

@billy-odera
Copy link
Author

Thanks for the feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants