24.07.2016 Views

www.allitebooks.com

Learning%20Data%20Mining%20with%20Python

Learning%20Data%20Mining%20with%20Python

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Classifying with scikit-learn Estimators<br />

Summary<br />

In this chapter, we used several of scikit-learn's methods for building a<br />

standard workflow to run and evaluate data mining models. We introduced the<br />

Nearest Neighbors algorithm, which is already implemented in scikit-learn as an<br />

estimator. Using this class is quite easy; first, we call the fit function on our training<br />

data, and second, we use the predict function to predict the class of testing samples.<br />

We then looked at preprocessing by fixing poor feature scaling. This was done using<br />

a Transformer object and the MinMaxScaler class. These functions also have a<br />

fit method and then a transform, which takes a dataset as an input and returns a<br />

transformed dataset as an output.<br />

In the next chapter, we will use these concepts in a larger example, predicting the<br />

out<strong>com</strong>e of sports matches using real-world data.<br />

[ 40 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!