Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions MLpython
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression

# Load dataset
data = pd.read_csv("dataset.csv")

X = data[['hours_study','sleep_hours','attendance']]
y = data['marks']

# Train model
model = LinearRegression()
model.fit(X, y)

print("=== AI Study Companion ===")
hours = float(input("Enter study hours: "))
sleep = float(input("Enter sleep hours: "))
attendance = float(input("Enter attendance %: "))

# Prediction
prediction = model.predict([[hours, sleep, attendance]])[0]

print(f"\n Predicted Marks: {prediction:.2f}")

# Smart Suggestions
if prediction < 50:
print("You need serious improvement. Increase study hours!")
elif prediction < 75:
print("You're doing okay. Stay consistent!")
else:
print("Excellent! Keep it up!")

# Graph
plt.scatter(data['hours_study'], data['marks'])
plt.xlabel("Study Hours")
plt.ylabel("Marks")
plt.title("Study Hours vs Marks")
plt.show()
38 changes: 38 additions & 0 deletions MLpython.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression

# Load dataset
data = pd.read_csv("dataset.csv")

X = data[['hours_study','sleep_hours','attendance']]
y = data['marks']

# Train model
model = LinearRegression()
model.fit(X, y)

print("=== AI Study Companion ===")
hours = float(input("Enter study hours: "))
sleep = float(input("Enter sleep hours: "))
attendance = float(input("Enter attendance %: "))

# Prediction
prediction = model.predict([[hours, sleep, attendance]])[0]

print(f"\n Predicted Marks: {prediction:.2f}")

# Smart Suggestions
if prediction < 50:
print("You need serious improvement. Increase study hours!")
elif prediction < 75:
print("You're doing okay. Stay consistent!")
else:
print("Excellent! Keep it up!")

# Graph
plt.scatter(data['hours_study'], data['marks'])
plt.xlabel("Study Hours")
plt.ylabel("Marks")
plt.title("Study Hours vs Marks")
plt.show()
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# My Project: Student Performance Predictor

This project predicts student marks using Machine Learning.

## Features
- Predict marks using:
- Study hours
- Sleep hours
- Attendance
- Smart suggestions
- Graph visualization

## Tech Stack
- Python
- Pandas
- Scikit-learn
- Matplotlib

## Files
- MLpython.py
- dataset.csv


## 500 + 𝗔𝗿𝘁𝗶𝗳𝗶𝗰𝗶𝗮𝗹 𝗜𝗻𝘁𝗲𝗹𝗹𝗶𝗴𝗲𝗻𝗰𝗲 𝗣𝗿𝗼𝗷𝗲𝗰𝘁 𝗟𝗶𝘀𝘁 𝘄𝗶𝘁𝗵 𝗰𝗼𝗱𝗲

***500 AI Machine learning Deep learning Computer vision NLP Projects with code* !!!**
Expand Down
8 changes: 8 additions & 0 deletions dataset.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
hours_study,sleep_hours,attendance,marks
2,6,60,50
3,7,65,55
4,6,70,60
5,7,75,65
6,8,80,70
7,7,85,75
8,8,90,85