Skip to content

dtypes for the scoring function #174

Open
@ryanma9629

Description

@ryanma9629

When generating the Python scoring function in MM, the default dtypes are set to 'object', as below:
input_array = pd.DataFrame([[LOAN, MORTDUE, VALUE, REASON, JOB, YOJ, DEROG, DELINQ, CLAGE, NINQ, CLNO, DEBTINC]], columns=["LOAN", "MORTDUE", "VALUE", "REASON", "JOB", "YOJ", "DEROG", "DELINQ", "CLAGE", "NINQ", "CLNO", "DEBTINC"], dtype=object)
However, classifiers such as lightgbm don't accept object dtypes. So we may get an error when scoring with lightgbm models in MM:
ValueError: DataFrame.dtypes for data must be int, float or bool. Did not expect the data types in the following fields: LOAN, MORTDUE, VALUE, REASON, JOB, YOJ, DEROG, DELINQ, CLAGE, NINQ, CLNO, DEBTINC
I don't know whether it is safe to set all dtypes to float or None when generating the scoring func.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions