Machine Learning With Scikit-Learn: George Boorman
Machine Learning With Scikit-Learn: George Boorman
Machine Learning With Scikit-Learn: George Boorman
with scikit-learn
SUPERVISED LEARNING WITH SCIKIT-LEARN
George Boorman
Core Curriculum Manager, DataCamp
What is machine learning?
Machine learning is the process whereby:
Computers are given the ability to learn to make decisions from data
Example:
Grouping customers into distinct categories (Clustering)
Aim: Predict the target values of unseen data, given the features
array([0, 0, 0, 0, 1, 0])
George Boorman
Core Curriculum Manager, DataCamp
Classifying labels of unseen data
1. Build a model
knn = KNeighborsClassifier(n_neighbors=15)
knn.fit(X, y)
(3, 2)
predictions = knn.predict(X_new)
print('Predictions: {}'.format(predictions))
Predictions: [1 0 0]
George Boorman
Core Curriculum Manager, DataCamp
Measuring model performance
In classi cation, accuracy is a commonly used metric
Accuracy:
0.8800599700149925