-
Notifications
You must be signed in to change notification settings - Fork 313
Share market prediction #18
Description
Main.py
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
data = {
“Day”: [1, 2, 3, 4, 5, 6, 7],
“Price”: [100, 102, 101, 105, 107, 110, 115]
}
df = pd.DataFrame(data)
X = df[[“Day”]]
y = df[“Price”]
model = LinearRegression()
model.fit(X, y)
future_days = np.array([[8], [9], [10]])
predictions = model.predict(future_days)
print(“Predicted Prices:”, predictions)
plt.scatter(X, y, color=“blue”)
plt.plot(X, model.predict(X), color=“red”)
plt.scatter(future_days, predictions, color=“green”)
plt.xlabel(“Day”)
plt.ylabel(“Price”)
plt.title(“Stock Price Prediction”)
Plt.show()
requirements.txt
pandas
numpy
matplotlib
scikit-learn
README.md
📈 Share Market Prediction (Python)
🔹 Project Overview
This project predicts stock prices using Machine Learning (Linear Regression).
🔹 Features
• Predict future stock prices
• Simple and beginner-friendly model
• Graph visualization using matplotlib
🔹 Technologies Used
• Python
• pandas
• numpy
• matplotlib
• scikit-learn
🔹 How to Run
1. Install libraries:
pip install -r requirements.txt
2. Run the code:
python main.py
🔹 Output
• Predicted stock prices
• Graph showing past + future trend
🔹 Future Improvements
• Use real stock data (API)
• Use advanced ML models
• Add accuracy metrics
🔹 Author
Sakshi Jain