style-analyzer icon indicating copy to clipboard operation
style-analyzer copied to clipboard

Refactor FeatureExtractror to have fit() and transform() methods

Open zurk opened this issue 7 years ago • 2 comments

Ancestor issue: https://github.com/src-d/style-analyzer/issues/387

The problem is that feature extraction is different when you train the model and when you apply it. So it is clear that FeatureExtractor is a transformer and fit() and transform() methods should be implemented. It helps to reduce code complexity a lot. Now we have both methods implemented inside extract_features() and index_labels flag turns it to fit or transform method.

zurk avatar Dec 09 '18 13:12 zurk

Fit and transform is actually not the API we want. We want fit_transform & save for the training and load & transform for the testing.

m09 avatar Dec 09 '18 15:12 m09

yeah, you are right, I just decompose fit_transform to fit + transform :)

zurk avatar Dec 09 '18 15:12 zurk