[SOLVED] MACHINE LEARNING-Assignment1

30.99 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (1 vote)

Assignment 1 – Linear Regression & Logistic Regression

Part A: 

The attached dataset “house_data.csv” contains 21613 records of house sale prices. It includes homes sold between May 2014 and May 2015.

  • Apply Simple Linear regression with gradient descent to predict the price based on sqft_living (Square footage of the apartments interior living space).

Given the hypothesis function: Y = C1 + C2 X

  • (target variable) = Price, X (predictor) = sqft_living, C1 and C2 are the parameters of the function.

 

  • Apply Multiple Linear regression with gradient descent to predict price based on 5 predictors (grade, bathrooms, lat, sqft_living, view).

Given the hypothesis function: Y = C1 + C2 X2 + C3 X3 + C4 X4 + C5 X5 + C6 X6

  • (target variable) = Price, X (predictor) = (grade, bathrooms, lat, sqft_living, view), C1, C2, C3, C4, C5 and C6 are the parameters of the function.

 

  1. Implement the gradient descent function to optimize parameters of the function.
  2. Calculate error function to see how the error of the hypothesis function changes with every iteration of gradient descent (hint: you will need to calculate error in every iteration) .

 

 

  1. Use optimized hypothesis function to make predictions on new data.
  2. Try different values of learning rate and see how this changes the accuracy of the model.

 

Part B: 

The attached dataset “heart.csv” contain 303 records of patients have heart disease or not according to features in it. You are required to build Logistic Regression model using gradient descent to predict whether patient have heart disease or not (target) based on 4 predictors (trestbps, chol,  thalach, oldpeak).

 

  1. Implement the gradient descent function to optimize parameters of the function.
  2. Calculate error function to see how the error of the hypothesis function changes with every iteration of gradient descent(hint: you will need to calculate error in every iteration). c) Use optimized hypothesis function to make predictions on new data.
  3. d) Try different values of learning rate and see how this changes the accuracy of the model.

 

 

 

 

 

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.