File size: 2,485 Bytes
70ec17f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---

license: mit
tags:
- time-series-forecasting
- financial-data
- neural-networks
- lstm
- transformer
- tensorflow
library_name: tensorflow
---


# FinTech Neural Forecasters

This repository contains neural network models for financial time series forecasting, part of the FinTech DataGen project.

## Models Included

### LSTM Forecaster
- **Algorithm**: Long Short-Term Memory Neural Network
- **Architecture**: Single LSTM layer with Dense output
- **Lookback**: 10 time steps
- **Performance**: RMSE=1.89, MAE=1.45, MAPE=1.42%

### Transformer Forecaster
- **Algorithm**: Transformer with multi-head attention
- **Architecture**: d_model=32, num_heads=2, ff_dim=64

- **Lookback**: 10 time steps

- **Performance**: RMSE=1.76, MAE=1.38, MAPE=1.35%



## Usage



```python

import tensorflow as tf

from huggingface_hub import snapshot_download, hf_hub_download

import joblib



# Method 1: Download complete forecaster objects (Recommended)

lstm_forecaster_path = hf_hub_download(repo_id="abdullah-daoud/fintech-neural-forecasters", filename="lstm_forecaster.pkl")

transformer_forecaster_path = hf_hub_download(repo_id="abdullah-daoud/fintech-neural-forecasters", filename="transformer_forecaster.pkl")



# Load complete forecasters

lstm_forecaster = joblib.load(lstm_forecaster_path)
transformer_forecaster = joblib.load(transformer_forecaster_path)



# Make predictions

lstm_predictions = lstm_forecaster.predict(steps=5)

transformer_predictions = transformer_forecaster.predict(steps=5)



# Method 2: Download individual model files

repo_path = snapshot_download(repo_id="abdullah-daoud/fintech-neural-forecasters")

# Load individual TensorFlow models
lstm_model = tf.keras.models.load_model(f"{repo_path}/lstm_model")
transformer_model = tf.keras.models.load_model(f"{repo_path}/transformer_model")

# Load scalers if available
try:
    lstm_scaler = joblib.load(f"{repo_path}/lstm_model/scaler.pkl")

    transformer_scaler = joblib.load(f"{repo_path}/transformer_model/scaler.pkl")

except FileNotFoundError:

    print("Scalers not found - models may handle scaling internally")

```


## Requirements
- tensorflow>=2.13.0
- numpy>=1.24.3
- pandas>=2.0.3
- scikit-learn>=1.3.0

## Citation
```

@software{fintech_datagen_2025,

  title={FinTech DataGen: Complete Financial Forecasting Application},

  author={FinTech DataGen Team},

  year={2025},

  url={https://github.com/your_username/fintech-datagen}

}

```