shankarpandala / lazypredict

Lazy Predict help build a lot of basic models without much code and helps understand which models works better without any parameter tuning
MIT License
2.86k stars 329 forks source link

custom_metric parameter returns error when set for LazyClassifier #324

Open praveenkumar-ravising opened 3 years ago

praveenkumar-ravising commented 3 years ago

Description: Setting custom_metric of LazyClassifier returns a ValueError: arrays must all be same length.

Steps to reproduce the behavior: Set the value of custom_metric in LazyClassifer to sklearn.metrics log_loss

Expected behavior: Log Loss metric column should be returned in the scores dataframe

Screenshot: image

Desktop:

Additional Content: -> Error points to TIME list when constructing the scores dataframe -> Also the issue happens irrespective of verbose value i.e. 0 or 1

KangboLu commented 3 years ago

@praveenkumar-ravising @brendalf @shankarpandala 😕 I faced the same issue with the same error message when I use make_scorer of sklearn to define an f1 macro scorer. There is no documentation of how to correctly make a custom metric scorer for lazypredict.