Introduction
Machine Learning - is a subdomain of Computer Science that focuses on algorithms which help a computer learn from data without (a programmer being there telling what to do) also known as explicit programming. Most of machine learning deals with Arrays which is a collection of data as seen in the example below:
myArray = [99,86,87,88,111,86,103,87,94,78,77,85,86]
Differentiation
What's the difference between Artificial Intelligence, Machine Learning and Data Science?
- Artificial Intelligence - an area of computer science where the goal is to enable computers and machines to perform human-like tasks and simulate human behavior.
- Machine Learning - subset of AI that tries to solve specific problems and make predictions using data.
- Data Science - a field that attempts to find patterns and draw insights from data (might use Machine Learning)
Types
There are 3 types in Machine Learning: Supervised Learning, Unsupervised Learning and Reinforcement Learning.
Supervised Learning
Uses labeled inputs (meaning the input has a corresponding output label) to train models and learn outputs. To a computer, pictures are just pixels with colors, there is really no “learning” going on. When we attach “labels” to these pixels, the computer is learning based on images to depict what a picture signifies. Below is an example line of code using scikit-learn in Python
from sklearn.linear_model import LinearRegression
model = LinearRegression()
model.fit(X_train, y_train)
Unsupervised Learning
Uses unlabeled data to learn about patterns in data. again, to a computer, all images are just pixels with colors, there is really no “learning” going on. but when we feed all a lot of images to a computer, it will start clustering these images based on the pattern it sees such as what is in common with these various images. Below is an example of a simple unsupervised learning code using scikit-learn in Python, specifically for training a K-means clustering model:
model.fit(X)
Reinforcement Learning
Machine/agent learning in an interactive environment based on rewards and penalties.
- like training a dog, there isn't necessarily structure on what is “right” or “wrong”, just the things that we teach the dog what it is. If we believe what the dog is doing is right -> we reward the dog. If we think what the dog is doing is wrong -> we penalize the dog.
- similar to training a dog wherein there is not a inherent “good” or “bad” moral compass, we teach the computer to do something then reward it if it is right and penalize it if it is doing wrong.
observation, reward, done, info = env.step(action)