Loading…
Glossary term
A branch of AI in which systems learn patterns from data instead of following only hand-written rules.
In machine learning you do not write the rules for a task. Instead you give a learning algorithm many examples and it finds the patterns itself, producing a model that can handle new cases.
The three classic settings are supervised learning (examples with answers), unsupervised learning (no answers) and reinforcement learning (learning from rewards).
Learn a rule from examples instead of writing it
from sklearn.linear_model import LogisticRegression
X = [[1], [2], [3], [10], [11], [12]] # hours of use
y = [0, 0, 0, 1, 1, 1] # 0 = casual, 1 = power user
model = LogisticRegression().fit(X, y) # learn from the examples
print(model.predict([[2], [11]])) # -> [0 1]Almost every modern AI product, from spam filters to chatbots, rests on machine learning, so it is the core idea to understand first.