Update README.md
Browse files123456789101112131415161718192021222324252627281302332456789103637383940414243444546474811125013141516171819532021225556575859232425262728293031326333346535363738396740416942437144454647484973505152535455567557585960776162796364656667686970717273747576777879---# For reference on model card metadata, see the spec: https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1# Doc / guide: https://huggingface.co/docs/hub/model-cards{}---
# Model Card for Model ID
The Hybrid Image-Numerical Stock Prediction Model is a multi-input neural network designed to predict binary stock price movements (up/down) based on historical chart images and technical indicators. It processes both image data (stock charts) and numerical data (technical indicators like RSI, MACD, Bollinger Bands, ATR, and OBV) to make predictions.
This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).
## Uses
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
### Direct Use
The model can be used for predicting short-term stock price movements based on historical data. It is intended for use in financial analysis when combined with other tools and strategies.
## Bias, Risks, and Limitations
The model may exhibit biases based on the training dataset's characteristics. It may not perform well during sudden market shifts caused by external factors. Users should be cautious about over-reliance on the model's predictions without additional analysis.
### Recommendations
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.# Stock Classification Model
## How to Get Started with the ModelThis repository contains The Hybrid Image-Numerical Stock Prediction Model is a multi-input neural network designed to predict binary stock price movements (up/down) based on historical chart images and technical indicators. It processes both image data (stock charts) and numerical data (technical indicators like RSI, MACD, Bollinger Bands, ATR, and OBV) to make predictions.
---
## Features 🐾- **High Accuracy**: Achieves a **test accuracy of 83.43%**!
## Training Details
### Training Data
The model was trained on the Kaylah072001/Stock_Graphs_Dataset, which includes stock chart images and corresponding price data. Technical indicators were extracted using the ta library.
### Training Procedure
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
#### Preprocessing [optional]---
Image data was rescaled to a range of 0–1 and augmented using rotation, shift, zoom, and flip techniques. Numerical features were extracted dynamically during training using technical indicator calculations.## Performance Metrics 📊
### Final Results:- **Test Accuracy**: `91.35%`- **Validation Accuracy**: `86.89%`- **Training Accuracy**: `99.89%`
#### Training Hyperparameters### Confusion Matrix Visualization 🎯
- **Training regime:** Training regime: Mixed precision (fp32)Optimizer: AdamLoss function: Binary crossentropyMetrics: Accuracy, AUC-ROCCross-validation: 5-fold stratified k-foldThis confusion matrix gives a detailed view of the classification performance for each Pokémon class. Misclassifications are represented along the off-diagonal cells.
---
## Dataset 📂- **Source**: Stock graph images from opensource API yfinance.- **Structure**: - `images/`: Contains all Pokémon images. - `pokemon.csv`: Metadata linking each image to its respective Pokémon and class labels.
### Testing Data, Factors & Metrics---
#### Testing Data## Model Details 🧠- **Architecture**: Fine-tuned **ResNet101**.- **Optimizer**: Adam with learning rate scheduling.- **Loss Function**: Cross-Entropy Loss.
<!-- This should link to a Dataset Card if possible. -->---
[More Information Needed]## Usage 🚀
#### Factors### Loading the Model```pythonimport torchfrom tensorflow.keras.models import Modelimport pickle
Performance was evaluated across different market conditions and stock types.# Load the modelmodel = Model(inputs=[img_input, num_input], outputs=output)num_features = model.fc.in_featuresmodel.fc = torch.nn.Linear(num_features, 2)model.load_state_dict(torch.load('stock_prediction_model.h5'))model.eval()
[More Information Needed]# Load label mappingwith open('label_mapping.pkl', 'rb') as f: label_mapping = pickle.load(f)
#### Metrics```
Accuracy### Making Predictions```pythonfrom PIL import Imagefrom tensorflow.keras.preprocessing import transforms
# Define transformsval_transform = transforms.Compose([ transforms.Resize((224, 224)), transforms.ToTensor(), transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])])
```
---
Feel free to explore and use the model. Contributions are welcome! 🙌README.md+55-59