GridSearch on Model and Classifiers

后端 未结 1 1880
予麋鹿
予麋鹿 2021-01-25 03:26

I just came across this example on Model Grid Selection here:

https://chrisalbon.com/machine_learning/model_selection/model_selection_using_grid_search/

Question

相关标签:
1条回答
  • 2021-01-25 04:08

    Pipeline is used to chain sequential data transformation models followed last by the classifier / regressor. Something like first converting the text to numbers using TfidfVectorizer and then training the classifier.

    pipe = Pipeline([('vectorizer',TfidfVectorizer()), 
                     ('classifier', RandomForestClassifier())])
    

    For only a single class, no need of Pipeline.

    Here in your code, its used as a placeholder, so that the parameters can be used by using the 'classifier' prefix. And the classifier itself can be substituted from the params.

    0 讨论(0)
提交回复
热议问题