Update README.md
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283---# 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 IDThe 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 UseThe 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 LimitationsThe 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.## How to Get Started with the Model## Training Details### Training DataThe 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.#### Training Hyperparameters- **Training regime:** Training regime: Mixed precision (fp32)Optimizer: AdamLoss function: Binary crossentropyMetrics: Accuracy, AUC-ROCCross-validation: 5-fold stratified k-fold### Testing Data, Factors & Metrics#### Testing Data<!-- This should link to a Dataset Card if possible. -->[More Information Needed]#### FactorsPerformance was evaluated across different market conditions and stock types.[More Information Needed]#### MetricsAccuracy12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879# Stock Classification 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%**!---## Performance Metrics 📊### Final Results:- **Test Accuracy**: `91.35%`- **Validation Accuracy**: `86.89%`- **Training Accuracy**: `99.89%`### Confusion Matrix Visualization 🎯This 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.---## Model Details 🧠- **Architecture**: Fine-tuned **ResNet101**.- **Optimizer**: Adam with learning rate scheduling.- **Loss Function**: Cross-Entropy Loss.---## Usage 🚀### Loading the Model```pythonimport torchfrom tensorflow.keras.models import Modelimport pickle# 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()# Load label mappingwith open('label_mapping.pkl', 'rb') as f:label_mapping = pickle.load(f)```### 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