Professional Documents
Culture Documents
ML Week 6 6607
ML Week 6 6607
Machine Learning
WEEK-6
NAME : G. Sai hari shashank varma DATE : 20-3-2024
PROBLEM STATEMENT:
PYTHON PROGRAM:
import pandas as pd
import numpy as np
data = pd.read_csv("student_scores.csv")
#print(data)
#print(data.head())
#print(data.describe())
x = data.iloc[:, :-1].values
y = data.iloc[:, -1].values
#print(x)
#print(y)
#print(x_train)
#print(x_test)
#print(y_train)
regressor = LinearRegression()
regressor.fit(x_train, y_train)
#print(regressor.intercept_)
#print(regressor.coef_)
y_pred = regressor.predict(x_test)
#print(df)
plt.title("Hours vs Percentage")
plt.xlabel("Hours Studied")
plt.ylabel("Percentage Score")
plt.show()
plt.xlabel("Hours Studied")
plt.ylabel("Percentage Score")
plt.show()
OUTPUT: