ML Exp.2 by Prashant
ML Exp.2 by Prashant
Task to be done:
Code:
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
# Sample data
X = np.array([1, 2, 3, 4, 5]).reshape(-1, 1) # Input features (reshaped to a 2D array)
y = np.array([2, 4, 5, 4, 5]) # Target values
Learning Outcomes:-