Skip to content

Machine Learning mini projects created from scratch

Notifications You must be signed in to change notification settings

aps19/ITIT-4103-2021

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

ITIT-4103-2021

Machine Learning

Assignment 1

Generate 50 data points (one-dimensional problem) with x uniform distance from (0,1) and generate y from the formula y=sin(1+x^2)+noise Where noise has (0,0.032)distribution. Divide the data into training and test (8:2). Scatter plot the y values as well as plot the noise-free true function for train and test separately. Implement the linear and polynomial regression models using the closed form solution as taught in the class on training data and explore their effectiveness in creating a predictor that best approximates the data using test data. Calculate the RMSE error and show the test and train results with varying degrees of a polynomial regression model to fit the data.

Assignment 4

Suppose you are the CEO of a restaurant franchise and are considering different cities for opening a new outlet. The chain already has trucks in various cities and you have data for profits and populations from the cities. You would like to use this data to help you select which city to expand to next. The file ex1data1.txt contains the dataset for our linear regression problem. The first column is the population of a city and the second column is the profit of a food truck in that city. A negative value for profit indicates a loss.

  1. Use a scatter plot to visualize the data, since it has only two properties to plot (profit and population).
  2. Consider a simple linear model with two parameters and one input variable and mean square error cost function to implement the gradient descent algorithm to find the intercepts. Assume a suitable terminating condition.
  3. Plot the model alongside the scatterplot to show the fit model.
  4. Perform steps 1,2,3 in batch mode for varying values of alpha, learning rate and plot the results.
  5. For each of the experiments performed above in steps 1,2,3,4 with varying learning rates visualize the cost function as a contour plot as well as plot the values of parameters to visualize the stepwise traversion of the parameters on this contour plot.
  6. This Assignment is based on https://github.com/AlfTang/Linear-Regression/blob/master/ex1.pdf

Releases

No releases published

Packages

No packages published