https://github.com/centralfloridaattorney/yahoostocks
YahooStock is a simple tool to make training and testing splits of stock market data from Yahoo using a ticker symbol.
https://github.com/centralfloridaattorney/yahoostocks
data-science machine-learning stock-market training-data
Last synced: 11 days ago
JSON representation
YahooStock is a simple tool to make training and testing splits of stock market data from Yahoo using a ticker symbol.
- Host: GitHub
- URL: https://github.com/centralfloridaattorney/yahoostocks
- Owner: CentralFloridaAttorney
- Created: 2023-01-01T16:25:37.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-23T18:28:29.000Z (about 2 years ago)
- Last Synced: 2025-04-09T11:50:24.285Z (2 months ago)
- Topics: data-science, machine-learning, stock-market, training-data
- Language: Python
- Homepage:
- Size: 137 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Explanation of what the code does
This module uses publicly available data from the yahoo finance api and creates training sets to be used by the neural network# Why use yahoostocks?
Get a stock's historical market data:
tsla_stock = YahooStock('TSLA')
Create testing and training sets for machine learning:
x_training, y_training, x_target, y_target = stock_object.get_test_train_split(
_data=stock_object.price_frame,
_train_end_col=3,
_batch_size=6,
_train_ratio=.87,
_target_column_start=5
)_yahoostock is not affiliated with the company Yahoo(exclamation) or Tesla_
# tsla_stock.price_frame:
date|high|low|open|close|volume|adjclose|formatted_date
---|---|---|---|---|---|---|---1277818200|1.6666669845581055|1.1693329811096191|1.2666670083999634|1.5926669836044312|281494500|1.5926669836044312|2010-06-29
1277904600|2.0280001163482666|1.553333044052124|1.7193330526351929|1.5886670351028442|257806500|1.5886670351028442|2010-06-30
1277991000|1.7280000448226929|1.3513330221176147|1.6666669845581055|1.4639999866485596|123282000|1.4639999866485596|2010-07-01
1278077400|1.5399999618530273|1.24733304977417|1.5333329439163208|1.2799999713897705|77097000|1.2799999713897705|2010-07-02_Tesla's stock market data is never guaranteed to be accurate_
### x_train:
date|high|low
---|---|---
1277818200|1.6666669845581055|1.1693329811096191
1277904600|2.0280001163482666|1.553333044052124
1277991000|1.7280000448226929|1.3513330221176147
1278077400|1.5399999618530273|1.24733304977417### x_target:
volume
---
281494500
257806500
123282000
77097000### y_train:
date|high|low
---|---|---1604932200|150.8333282470703|140.3333282470703
1605018600|140.02999877929688|132.00999450683594
1605105000|139.56666564941406|136.86000061035156
1605191400|141.0|136.5066680908203### y_target:
volume
---
104499000
90852600
52073100
59565300