1

In addition to what Malo said. Cross validation actually solves another problem. We used to split the data into 3 sets. A training set to fit the model, a test set to fine tune the parameters and a validation set for the final test. If you do this split only once then the model learns only with the training set provided. So the learning depends on how you ...


1

This can be solved by simply changing the method that is called within transform to the transform method of the vectorizer. In addition you would also have to add a call to fit within the fit method to make sure that the vectorizer is actually fitted before being used to transform any data: class Vectorizer(BaseEstimator, TransformerMixin): def __init__(...


1

I expected scikit to allocate completely new memory space for corresponding model during fit() call, which does not happen to be the case. So in the first case by calling models[component].append(model) I tend to save the address of model rather than the deep copy of the model itself. Later on, this model gets overwritten by the next one and so on. ...


Only top voted, non community-wiki answers of a minimum length are eligible