Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ML notebook: Add preprocessing and a sklearn pipeline #7

Open
rhiever opened this issue Aug 21, 2015 · 3 comments
Open

ML notebook: Add preprocessing and a sklearn pipeline #7

rhiever opened this issue Aug 21, 2015 · 3 comments

Comments

@rhiever
Copy link
Owner

rhiever commented Aug 21, 2015

From a Reddit comment:

Advice: I think you are missing a few big things like preprocessing/scaling and pipelines.

Before using the learners, inputs should be scaled so that each feature has equal weight. Something like StandardScaler or MinMaxScaler are both appropriate (from sklearn.preprocessing). If you think some features are more important, you can scale them later to increase their relative importance in prediction. These are more parameters you would tune using CV, but these can be really numerous, so GridSearch is out the window and you would have to consider some alternatives like Nelder Mead search, genetic search, or multivariate gradient descent if you suspect convexity.

You have to fit these scalers on the training data and then use the trained fit to transform the testing data. Using Pipelines simplifies this whole process (fits the scaler and learner at once, transforms and predicts at once).

@Ritish-Madan
Copy link

From a Reddit comment:

Advice: I think you are missing a few big things like preprocessing/scaling and pipelines.
Before using the learners, inputs should be scaled so that each feature has equal weight. Something like StandardScaler or MinMaxScaler are both appropriate (from sklearn.preprocessing). If you think some features are more important, you can scale them later to increase their relative importance in prediction. These are more parameters you would tune using CV, but these can be really numerous, so GridSearch is out the window and you would have to consider some alternatives like Nelder Mead search, genetic search, or multivariate gradient descent if you suspect convexity.
You have to fit these scalers on the training data and then use the trained fit to transform the testing data. Using Pipelines simplifies this whole process (fits the scaler and learner at once, transforms and predicts at once).

Can you please tell which file you are referring to? To add the scaling.

@Ritish-Madan
Copy link

Hi!I believe that Scaling the features won't really be beneficial in our features. The classification is based on the size of petals and various other continuous data features are available. Scaling them might ruin their actual existence and might ruin the classification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants