In this post, we will learn how machine learning algorithm work, here we go through basic concepts of all the machine learning algorithms and how to fit and predict train and test data in machine learning.
Types of ML Algorithms:
ML Algorithms divided into three categories -
1. Supervised Learning
2. Unsupervised Learning
3. Reinforcement Learning
It consists of the target variable (or dependent variable) which is to be predicted from a given set of predictors (independent variables). The training process continues until the model achieves a desired level of accuracy on the training data.
Types of Supervised Learning
Logistic Regression, etc.
This algorithm work without having any target or outcome variable to predict. It is used for the clustering population in different groups, which is used for segmenting customers in different groups.
Types of Unsupervised Learning
This algorithm used from past experience and tries to capture the best possible knowledge to find accurate decisions.
Types of Reinforcement Learning
Markov Decision Process
# importing required libraries
import pandas as pd
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
SVM (Support Vector Machine)
KNN (k- Nearest Neighbors)
Metrics to Evaluate your Machine Learning Algorithm
There are different types of metrics used to evaluate ML Algorithms :
Area under Curve
Mean Absolute Error
Mean Squared Error
Here we will create basic train and test data and fit it into different models, you can also try it itself, here we some changes are made the first one is set appropriate libraries and fit data.
For more visit go to the Codersarts official website - click here