Skip to content

Commit

Permalink
Completed Artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
jackturner83 committed Mar 21, 2024
1 parent 3464d54 commit a7e6d8c
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 10 deletions.
Binary file modified data/stock_news.db
Binary file not shown.
Binary file modified data/stock_prices.db
Binary file not shown.
14 changes: 9 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ This project aims to predict stock prices using sentiment analysis data combined
- yfinance
- textblob
- requests
- csv
- newsapi
- dotenv

## Usage
1. Clone the repository: `git clone https://github.com/your_username/stock-price-prediction.git`
1. Clone the repository: `git clone https://github.com/ReadyResearchers-2023-24/JackTurner-Artifact`
2. Install the required dependencies: `pip install -r requirements.txt`
3. Navigate to the `src` folder `cd src`
4. Execute the `run_all_scripts.py` file: `python3 run_all_scripts.py`
5. Results will be displayed in the command line and stored in the `data` folder under the name: `gpt_prediction.csv`

3. Run the provided Python script: `python3 run_all.py`
4. Results will be displayed in the command line and stored in the `data` folder under the name: `gpt_prediction.csv`

## Additional Notes
- Modify the prompt in `gpt.py` to determine the desired output format.
- Sometimes, the data size may exceed the capacity of the ChatGPT API. In such cases, consider removing one or two CSV files from the `data` folder to allow processing a smaller batch at a time, ensuring more consistent results.
13 changes: 8 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
pandas==1.3.3
scikit-learn==0.24.2
openai==0.10.5
yfinance==0.1.64
textblob==0.15.3
pandas==1.5.0
scikit-learn==1.4.0
openai==0.27.1
yfinance==0.1.91
textblob==0.17.3
requests==2.30.1
newsapi==1.0.0
python-dotenv==0.20.0
21 changes: 21 additions & 0 deletions src/run_all.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import subprocess

def run_script(script_path):
subprocess.run(["python", script_path])

if __name__ == "__main__":
# Run fetch_historical_data.py and multiple_ticker_sent.py
run_script("src/fetch_historical_data.py")
run_script("src/multiple_ticker_sent.py")

# Run avg.py located in the data folder
run_script("data/avg.py")

# Run combined_data.py
run_script("data/combined_data.py")

# Run seperate_tickers.py
run_script("data/seperate_tickers.py")

# Run gpt.py
run_script("src/gpt.py")

0 comments on commit a7e6d8c

Please sign in to comment.