-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Issue Description
-
I have checked that this issue has not already been reported here.
-
I have confirmed this bug exists on the latest version of pycaret.
-
I have confirmed this bug exists on the latest version of pycaret (12 Nov 2024): pip install -U git+https://github.com/pycaret/pycaret.git@master
Installed Version:
import pycaret
pycaret.__version__
3.4.0
As already described here: [BUG]: compare_models with fit_kwargs bug] #2537 it is not possible to properly pass fit_kwards to compare_models. See more details in #2537
- Checked sklearn logistic regression
Reproducible Example
from pycaret.datasets import get_data
data = get_data('hepatitis')
from pycaret.classification import *
s = setup(data, target = 'Class', session_id = 123)
compare_models(fit_kwargs = {'sample_weight' : {0 : 1, 1 : 2}}, errors = 'raise')Expected Behavior
It should work seamlessly.
Actual Results
TypeError: _fit_one() got an unexpected keyword argument 'class_weight'
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/pycaret/internal/pycaret_experiment/supervised_experiment.py](https://localhost:8080/#) in compare_models(self, include, exclude, fold, round, cross_validation, sort, n_select, budget_time, turbo, errors, fit_kwargs, groups, experiment_custom_tags, probability_threshold, verbose, parallel, caller_params)
811 except Exception as ex:
812 if errors == "raise":
--> 813 raise RuntimeError(
814 f"create_model() failed for model {model}. {type(ex).__name__}: {ex}"
815 )
RuntimeError: create_model() failed for model lr. TypeError: _fit_one() got an unexpected keyword argument 'class_weight'Installed Versions
import pycaret
pycaret.__version__
3.4.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working