File size: 1,434 Bytes
664dcc9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

Usage
1. Clone the Repository
Start by cloning the repository to your local machine:

bash
Copy
Edit
git clone https://github.com/your-username/your-repository-name.git
2. Install Dependencies
Navigate to the project folder and install the necessary dependencies using the requirements.txt:

bash
Copy
Edit
cd your-repository-name
pip install -r requirements.txt
3. Setup API Key
You will need an Alpha Vantage API key to fetch stock data. Sign up for a free API key here.

Once you have the key, replace the placeholder in the TESTING.py script:

python
Copy
Edit
ALPHA_VANTAGE_API_KEY = 'YOUR_API_KEY'
4. Run the Stock Prediction
Run the script with your desired stock ticker symbol. The stock ticker should be in the format of TICKER.SYMBOL (e.g., AAPL for Apple, MSFT for Microsoft):

bash
Copy
Edit
python TESTING.py
You will be prompted to enter the stock ticker symbol in the terminal:

java
Copy
Edit
Enter the stock ticker symbol (e.g., TATAMOTORS.NS or TSLA): MSFT
5. View Results
The model will:

Output performance evaluation metrics (MAE, MSE, RMSE, R² Score).

Display a plot comparing actual vs predicted stock prices.

Predict the next hour’s stock price based on the last available data.

Example Output:
yaml
Copy
Edit
📏 MAE: 3.5777, MSE: 18.7211, RMSE: 4.3268, R² Score: 0.9984
📈 Predicted next hour price: ₹425.67
The prediction results will be displayed graphically and saved as prediction_plot.pdf.