diff --git a/MLpython b/MLpython new file mode 100644 index 0000000..c1bd9a1 --- /dev/null +++ b/MLpython @@ -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() \ No newline at end of file diff --git a/MLpython.py b/MLpython.py new file mode 100644 index 0000000..c1bd9a1 --- /dev/null +++ b/MLpython.py @@ -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() \ No newline at end of file diff --git a/README.md b/README.md index 9841612..3d5bc89 100644 --- a/README.md +++ b/README.md @@ -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* !!!** diff --git a/dataset.csv b/dataset.csv new file mode 100644 index 0000000..360bf07 --- /dev/null +++ b/dataset.csv @@ -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 \ No newline at end of file