Update README.md
Browse files# Qwen Market Prediction Model
This model is fine-tuned from Qwen3-4B-Thinking for NIFTY 50 market prediction, utilizing technical indicators and market data to provide short-term price movement forecasts.
## Model Description
- **Model Type:** Causal Language Model (fine-tuned from Qwen3-4B-Thinking)
- **Language:** English
- **License:** [Your chosen license]
- **Developed by:** [Your name/organization]
- **Finetuning Approach:** LoRA (Low-Rank Adaptation)
### Training Data
This model was trained on historical NIFTY 50 data including:
- Daily price movements
- Technical indicators (RSI, MACD, Bollinger Bands)
- Options data (if applicable)
- Market sentiment metrics (if applicable)
The training set consists of sequences with lookback periods of [X] days to predict next-day market movements.
### Intended Use
This model is designed for:
- Analyzing NIFTY 50 market technical indicators
- Predicting short-term price movements
- Providing reasoning for market predictions
- Generating confidence levels for forecasts
### Limitations
- Predictions are probabilistic and should not be the sole basis for investment decisions
- The model is trained on historical data and may not account for unexpected market events
- Performance may vary during extreme market conditions
- This is an experimental model and should be used with appropriate risk management
## Usage
Here's how to use the model:
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model and tokenizer
model = AutoModelForCausalLM.from_pretrained("your-username/qwen-market-model", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("your-username/qwen-market-model")
# Format prompt
system_message = "You are an expert financial analyst specializing in NIFTY 50 market prediction."
user_message = """
Current NIFTY: 24500.0
Recent 5-day closes: [24400, 24450, 24480, 24500, 24500]
Recent 3-day returns (%): [0.2, 0.12, 0.08]
Technical Indicators:
- RSI(14): 65.2
- MACD: 45.2, Signal: 42.1
- Bollinger Band Width: 1.8%
Task: Analyze the data and predict next trading day movement.
Provide: 1) Technical analysis, 2) Direction (Up/Down/Flat), 3) Expected % change, 4) Confidence level
"""
messages = [
{"role": "system", "content": system_message},
{"role": "user", "content": user_message}
]
# Format using chat template
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
# Generate prediction
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=300, temperature=0.7)
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)
Training Details
# Base Model: Qwen3-4B-Thinking
Training Method: LoRA fine-tuning
Hyperparameters:
Learning rate: 2e-4
Epochs: 2.08
LoRA rank: 16
LoRA alpha: 32
Target modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
Optimizer: AdamW with cosine learning rate schedule
Precision: BF16/FP16 mixed precision
## Citation
If you use this model in your research or applications, please cite:
@misc
{qwen-market-model,
author = {Afzalur Rahman},
title = {Qwen Market Prediction Model},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/afzalur/qwen-market-model}}
}
## Contact
email: [email protected]; [email protected]
@@ -1,3 +1,20 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
metrics:
|
6 |
+
- accuracy
|
7 |
+
- mae
|
8 |
+
- mse
|
9 |
+
base_model:
|
10 |
+
- Qwen/Qwen3-4B-Thinking-2507
|
11 |
+
library_name: transformers
|
12 |
+
tags:
|
13 |
+
- finan
|
14 |
+
- market-prediction
|
15 |
+
- stock-market
|
16 |
+
- nifty50
|
17 |
+
- technical-analysis
|
18 |
+
- qwen
|
19 |
+
- fine-tuned
|
20 |
+
---
|