10000 Issue on running Bayesian Search on decision tree · Issue #978 · scikit-optimize/scikit-optimize · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.
This repository was archived by the owner on Feb 28, 2024. It is now read-only.
Issue on running Bayesian Search on decision tree #978
@ivanvaccarics

Description

@ivanvaccarics

I'm trying to run the BayesSearchCV on a decision tree but i found this error.
TypeError: __init__() got an unexpected keyword argument 'iid'

My code is:

from sklearn.tree import DecisionTreeClassifier 

clf = DecisionTreeClassifier()

#hypertuning paramenters
    parameter_grid = {
    'criterion':['gini','entropy'],
    'splitter':['best','random'],
    'max_depth': [5, 8,10, 15, 25],
    'min_samples_split' : [2, 5, 10, 15,20,25],
    'min_samples_leaf' : [1, 2, 5, 10,15,20],
    'random_state' : [seed],
                    }
    
    print("TUNING ############################")
    startgrid=time.time()
    cv = RepeatedStratifiedKFold(n_splits=10, n_repeats=3, random_state=1)
    grid_searchdt = FixedBayesSearchCV(estimator=clf, search_spaces=parameter_grid, n_jobs=-1, cv=cv,iid=False)
    bestDT = grid_searchdt.fit(x_train, y_train)
    print(bestDT.best_params_)
    best_grid_dt = bestDT.best_estimator_
    print(best_grid_dt)
    endgrid = time.time()
    print("Grid time: "+str(endgrid-startgrid))

with a simple dataset. Could you please help me? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0