I am trying to do the following:

 vc = VotingClassifier(estimators=[('gbc', GradientBoostingClassifier()),
                                   ('rf', RandomForestClassifier()), 
                                   ('svc', SVC(probability=True))],
                       weights=[2, 3, 1])
cross_val_score(vc, X_new, y, n_jobs=-1)

In this, I want to tune the parameter weights. If I use GridSearchCV, it is taking a lot of time. Since it needs to fit the model for each iteration. Which is not required, I guess. Better would be use something like prefit used in SelectModelFrom function from sklearn.model_selection.

Is there any other option or I am misinterpreting something?

  • $\begingroup$ Did you solve this? $\endgroup$
    – Isbister
    Commented Dec 13, 2018 at 8:22
  • $\begingroup$ Have a look on this link. It describes very well how to tune weights in voting classifier with classic for loops. Hope it helps :) $\endgroup$
    – Petros
    Commented Dec 13, 2018 at 19:31


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.