2
$\begingroup$

In machine learning, when we train a model, such as

vect = CountVectorizer(min_df=5, ngram_range=(1,2)).fit(X_train)

X_train_vectorized = vect.transform(X_train)
model = LogisticRegression()
model.fit(X_train_vectorized, y_train)

predictions = model.predict(vect.transform(X_test))

and make predictions with a test set, does our model learn the test set after multiple predictions are made?

$\endgroup$
2
$\begingroup$

TL/DR: No.


The concept of prediction, here applied by your predict method, is to just try out the model on the test set. It does not imply any kind of adaptation to such set, thus your model doesn't directly learn anything from it.

You can generalize that to any other framework or discussion in data science as a whole - training and fitting are tasks performed on the train set, and they imply adapting to it, and actually learning its patterns. Predicting does not.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.