Skip to content

Hi - question I can't seem to establish #2

@ouverz

Description

@ouverz

Hi, I really liked your tutorial!
I can't quite get my head around the way in which the pipeline works. Say I run

pipeline = Pipeline([ ('tfidf', vectoriser), ('classifier', MultinomialNB() )])

Does the pipeline function essentially tokenise the corpus, create a tf-idf matrix, develop an NB model and fit the data?

Then when I run:

scores = cross_val_score(pipeline, train_data, train_label, cv=5, scoring='accuracy, n_jobs=-1,)

Then I print scores, this is the accuracy of what then? I don't see where the prediction on the test data takes place?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions