Skip to main content

Posts

Showing posts from November, 2022

Machine Learning - Linear Regression with Ridge, Lasso and Polynomial Features

  Machine Learning Foundation Section 2, Part d: Regularization and Gradient Descent Introduction We will begin with a short tutorial on regression, polynomial features, and regularization based on a very simple, sparse data set that contains a column of  x  data and associated  y  noisy data. The data file is called  X_Y_Sinusoid_Data.csv . In [ ]: import os data_path = [ r 'C:\Users\VISHAL\IBM ML\02d_regularized' ] Question 1 Import the data. Also generate approximately 100 equally spaced x data points over the range of 0 to 1. Using these points, calculate the y-data which represents the "ground truth" (the real function) from the equation: $y = sin(2\pi x)$ Plot the sparse data ( x  vs  y ) and the calculated ("real") data.              import pandas as pd import numpy as np filepath = os . sep . join ( data_path + [ 'X_Y_Sinusoid_Data.csv' ]) data = pd . read_csv ( filepat...