1
$\begingroup$

Say we have a model trained on dataset A, which has a number of features, as usual. We then persist that model to disk and use it when we need to run inference (make predictions). Usually we run inference against unseen data with the same features. Is it possible to run inference against unseen data with different features. Note that these new features are very similar to the ones used in training. So in a sense it would be a type of transfer learning (actually more like “transfer inference”). Can this be done in scikit learn, given that loaded models (from say Pickle) expect the column names to be the same?

$\endgroup$
2
  • $\begingroup$ did you try doing that with a simple mock model? $\endgroup$ Nov 22, 2020 at 16:28
  • $\begingroup$ It is not advisable to do so as this suppose old and new features have same exactly same effect and relation to the model result. This is highly improbable/impossible. But maybee you could giv edetail about the features your are talking about ? $\endgroup$
    – Malo
    Sep 28, 2021 at 6:56

1 Answer 1

1
$\begingroup$

Technically, the only constraint would be the number of features that has to be the same than during the training phase (in most scikit learn models).

Will it perform well ?

I would say it really depends on the type of model/approach you are using and what is behind:

Note that these new features are very similar to the ones used in training

Generally speaking it will probably not perform well unless the training features and the new features are related in a way that is acceptable by your model.

$\endgroup$

Your Answer

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

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