AxeldeRomblay / MLBox

MLBox is a powerful Automated Machine Learning python library.
https://mlbox.readthedocs.io/en/latest/
Other
1.49k stars 274 forks source link

All scores with Nan #23

Closed chMoussa closed 7 years ago

chMoussa commented 7 years ago

Hi,

When running with None in optimizer, it works and give scores for roc_auc. But when specifying a space of parameters, I get this:

NA ENCODER :{'numerical_strategy': {'search': 'choice', 'space': [0, 'mean']}, 'categorical_strategy': ''}

CA ENCODER :{'strategy': {'search': 'choice', 'space': ['label_encoding', 'random_projection']}}

ESTIMATOR :{'num_leaves': 31, 'reg_alpha': 0, 'subsample_for_bin': 50000, 'colsample_bytree': 0.8, 'silent': True, 'learning_rate': 0.05, 'nthread': -1, 'min_child_weight': 5, 'strategy': 'LightGBM', 'n_estimators': 500, 'subsample': 0.9, 'reg_lambda': 0, 'subsample_freq': 1, 'min_child_samples': 10, 'max_bin': 255, 'objective': 'binary', 'min_split_gain': 0, 'seed': 0, 'max_depth': {'search': 'choice', 'space': [5, 6]}, 'boosting_type': 'gbdt'}

MEAN SCORE : accuracy = -inf VARIANCE : nan (fold 1 = -inf, fold 2 = -inf, fold 3 = -inf, fold 4 = -inf, fold 5 = -inf) CPU time: 0.561537027359 seconds

The following code was used:

space = { 'ne__numerical_strategy' : {"search":"choice", "space":[0, 'mean']},

    'ce__strategy' : {"search":"choice", "space":["label_encoding", "random_projection"]},

    'est__max_depth' : {"search":"choice", "space":[5,6]}
    }

opt = Optimiser(scoring="accuracy",n_folds=5) best = opt.evaluate(space, data)

I do not understand why but may you help figure it out?

AxeldeRomblay commented 7 years ago

Be careful with the function "evaluate" : it is used only to evaluate a given dictionnary of parameters and not to optimise your Pipeline in a given space ! If you want to do so, please use the function "optimise"...