6

I want to use default hyperparams in randomized search, how can I do it? (per_float_feature_quantization param here)

grid = {'learning_rate': [0.1, 0.16, 0.2],
        'depth': [4, 6, 10],
        'l2_leaf_reg': [1, 3, 5, 7, 9],
        'iterations': [800, 1000, 1500, 2000],
        'bagging_temperature': [1, 2, 3, 4, 5],
        'border_count': [128, 256, 512],
        'grow_policy': ['SymmetricTree', 'Depthwise'],
        'per_float_feature_quantization':[None, '3:border_count=1024']}

model = CatBoostClassifier(loss_function='MultiClass',
                          custom_metric='Accuracy',
                          eval_metric='TotalF1',
                          od_type='Iter',
                          od_wait=40,
                          task_type="GPU", 
                          devices='0:1',
                          random_seed=42,
                          cat_features=cat_features)

randomized_search_result = model.randomized_search(grid,
                                                   X=X,
                                                   y=y
                                                   )

And I've got

CatBoostError: library/cpp/json/writer/json_value.cpp:499: Not a map
gushart
  • 163
  • 10
  • 1
    Not fully answering your question, but: The error message indicates that you have an invalid parameter in your grid that catboost in unable to map. If you e.g. comment out the line with "per_float_feature_quantization", the code should run. – ViggoTW Nov 02 '20 at 12:29

1 Answers1

0

There is an error in one or more of the parameters of your grid. Commenting them out one-by-one should help you identify it.

As a side note, Optuna recently released support for CatBoost, in case you want to try that instead of a grid search. Optuna’s documentation of a CatBoost example.

K. Thorspear
  • 473
  • 3
  • 12