Skip to content

Arun998/MACHINE-LEARNING

Repository files navigation

MACHINE_LEARNING

Machine learning is a branch of artificial intelligence (AI) and computer science which focuses on the use of data and algorithms to imitate the way that humans learn, gradually improving its accuracy

SUPERVISED MACHINE_LEARNING

Supervised Learning is a type of machine learning used to train models from labeled training data. It allows you to predict output for future or unseen data

Types of supervised learning algorithms

  • REGRESSION
  • CLASSIFICATION

Regression types:

                1. LINEAR_REGRESSION
                2. MULTIPLE_LINEAR_REGRESSION
                3. POLYNOMIAL_REGRESSION

LINEAR_REGRESSION,

Linear Regression is a statistical model used to predict the relationship between independent and dependent variables denoted by x and y respectively

  • Examine 2 factors
  1. How closely are x and y related ? Linear regression gives a number between -1 and 1 indicating the strength of correlation between the two variables 0 : no correlation 1 : positively correlated -1 : negatively correlated

  2. Prediction When the relationship between x and y is known, use this to predict future values of y for a value of x This is done by fitting a regression line and represented by a linear equation:

y = a * x + b

simple linear regression example click here - linear_regression

MULTIPLE LINEAR REGRESSION

Multiple linear regression is a statistical technique used to predict the outcome of a response variable
through several explanatory variables and model the relationships between them.

Equation for MLR

Y = m1* x1 + m2* x2 + m3* x3 + ………+ mn* xn + c

BASTON HOUSEPRICE PREDICTION USING MLR -multiple linear regression

Accuracy Metrics

*R-square is the most common metric to judge the

performance of regression models
Error = Predicted Value-ActualValue
Example: Performing linear regression on sq. Area (x) and Price (y) returns R-square value as 16 This means you have 16% information to make an accurate prediction about the price.
lies between 0 -100 %

Adjusted R-Square

Adjusted R^2=1-(1-R^2)(N-1)/N-P-1

It penalizes the attribute that are not correlated
As we increase the no of independent N-P-1 becomes small number attribute increases adjust r^2 decreases when an attribute not correlated with target that time only adjusted R^2 decreases

CLASSIFICATION

If the target variable is categorical then we use classification

LogisticRegression

Logisticregression is widely used to predict the binary outcomes for given set of independent variables
The dependent variable can have only two values such as 0 or 1, win or loose, pass or fail
*** Use_cases ***
loan_sanction,spamfiltering exam_result i.e pass or fail
The probability of distribution of output is restricted to 1 or 0

Logisticregression equation is sigmoid function i.e s(t)=1/1+e^-t

t->represents data volume
s(t)->represent the probability
s-> shaped curve
Iris Flower data clsssification using Logistic regression -LogisticRegression