supervised learning using python - chapter1
supervised learning using python - chapter1
with scikit-learn
S U P E R V I S E D L E A R N I N G W I T H S C I K I T- L E A R N
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
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
2. Model learns from the labeled data we pass to it
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 classification, accuracy is a commonly used metric
Accuracy:
0.8800599700149925