Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Task 1:-

Simple Linear Regression


Steps / Procedures
● Import libraries
● Read Data set with the help of pandas
● Identify dependent variables and independent variables in our case, crop yield is
dependent on rainfall.
● Normalizing the data such that gradient decent works faster
● Plotting Scatter Plot for data visualization

Fig:- Scatter Plot for the data set

● Makin theta arrays


● Reshaping x such that dot product can be done between feature matrix and theta
● Making cost function (note:- goal is to maximization of the cost function)
● Making Gradient Descent Function with the creation of gif
● Defining theta, iterations, and learning rate
● Fitting the linear line in the data
● Collab link:-
https://drive.google.com/file/d/1q1PwhFJR1coScAUmxRBbGeFaCsPo95wg/view?usp=s
haring
● Ref1:- https://www.youtube.com/watch?v=PaFPbb66DxQ
● Ref2:- https://satishgunjal.com/machine_learning/
Fig: Gif animation for linear regression
Task 2:-
Multi Variant Regression
Steps / Procedures
● Import libraries
● Read the Data set with the help of a panda object
● Identify dependent variables and independent variables (the price of the car)
● Data Cleaning includes replacing ‘?’ missing data and outliers

● Dividing the data into train and test data


● Making feature matrix and theta matrix
● Making cost function (note:- goal is to maximization of the cost function)
● Making Gradient Descent Function
● Maximizing the cost function

● Checking the working with sklearn


● Ref 1:- https://satishgunjal.com/machine_learning/
● Ref 2:- Andrew Ng Notes
● Collab Link:-
https://drive.google.com/file/d/1SWeWMWqZ--nE21jJd-tqGwSJQRZEezOk/view?usp=sh
aring
Task 3:-
Polynomial Regression
Steps / Procedures
● Import libraries
● Read the Data set with the help of a panda object
● Making Polynomial Regression Model with the help of sklearn
● Making function with variable degrees of freedom

Fig:- Polynomial Regression with degree 2

Fig:- Polynomial Regression with degree 3

● Making Linear regression Model


Fig:- Linear Regression

● Collab Link:-
https://drive.google.com/file/d/1SWeWMWqZ--nE21jJd-tqGwSJQRZEezOk/view?usp=sh
aring
● Ref 1:- https://www.javatpoint.com/machine-learning-polynomial-regression
● Ref 2:-
https://www.analyticsvidhya.com/blog/2021/07/all-you-need-to-know-about-polynomial-re
gression/#:~:text=Polynomial%20Regression%20is%20a%20form%20of%20Linear%20r
egression%20known%20as,also%20badly%20affect%20the%20performance.
Task 3:-
Polynomial Regression
Steps / Procedures
● Import libraries
● Plotting sigmoid function in range(-10,+10)

Fig:- Sigmoid Function


● Since my roll number is odd, working on Forest Fire Dataset
● Reading Dataset with pandas
● Cleaning data
● Mapping no fire to 0 and fire to 1

Fig:- Clean Data with Strings mapping to int or float

● Splitting Data into Test and Traning Sets


● Making Model with Logistic Regression of Binary Classification
● Prediction of test data

Fig:- Binary Classification of Model Prediction on test data


● Making CNF-Matrix
array([ [40, 3],
[ 4, 51]
])
● Drawing ROC-Curve

Fig:- ROC Curve with AUC


● Collab Link:-
https://drive.google.com/file/d/1Q2r8Vd8OBvFveQBBKjVBgNXxNKERMjnS/view?usp=s
haring
● Ref 1:-
https://towardsdatascience.com/logistic-regression-detailed-overview-46c4da4303bc
● Ref 2:- https://www.youtube.com/watch?v=OCwZyYH14uw

Complete Folder Link:-


https://drive.google.com/drive/folders/1b-3uty6XGGWp9qe1jaqj_wOrOVV_e_2L?usp=sharing

You might also like