Skip to main content

RedRVFL

RedRVFL is a lightweight Python package for financial time-series forecasting with Random Vector Functional Link models:

  • RVFLRegressor: single hidden-layer RVFL with ridge readout.
  • EDRVFLRegressor: ensemble deep RVFL with independent layer readouts.
  • REDRVFLRegressor: recurrent ensemble deep RVFL for ordered time-series frames.
  • Hyperopt/TPE tuning for RVFL.
  • Layerwise Hyperopt/TPE tuning for EDRVFL and REDRVFL.

Installation

Core install:

git clone https://github.com/statsdl/RedRVFL.git
cd RedRVFL
pip install .

Finance experiment dependencies:

pip install ".[finance]"

For development:

pip install -e ".[dev]"
pytest

Financial Time Series Forecasting Example

from redrvfl.finance import download_dji, run_dji_paper_experiment

download_dji("datasets/DJI.csv")
results = run_dji_paper_experiment(
    dataset_path="datasets/DJI.csv",
    seeds=(0,),
    horizon=20,
    look_ahead=1,
    n_layers=10,
    max_evals=100,
)

The split follows the paper: 70% training, 10% validation, and 20% test in chronological order. Hyperparameters are selected on validation data, then the model is fitted on train+validation and evaluated on the final test segment.

Command-line usage:

python examples/run_finance_forecasting.py --download --seeds 0 --horizon 20 --look-ahead 1
python examples/run_finance_forecasting.py --seeds 0,1,2

Hyperopt Tuning

from hyperopt import hp
from redrvfl.tuning import layerwise_tune_redrvfl

result = layerwise_tune_redrvfl(
    X,
    y,
    n_layers=10,
    layer_space={
        "n_hidden": hp.quniform("n_hidden", 20, 200, 1),
        "regularization": hp.uniform("regularization", 0, 1),
        "input_scale": hp.uniform("input_scale", 0, 1),
    },
    fixed_params={
        "recurrent_scale": 0.1,
        "random_state": 0,
    },
    validation_fraction=0.1 / 0.8,
    max_evals=100,
)

API

Supported package code lives in src/redrvfl.

All estimators expose:

  • fit(X, y): train readout weights.
  • predict(X): return predictions.
  • predict(X, return_layers=True): for EDRVFL/REDRVFL, return each layer's prediction.

make_forecasting_frame(series, order, horizon) converts a time series into supervised lagged samples.

Finance and tuning utilities are intentionally imported from submodules:

  • redrvfl.tuning
  • redrvfl.finance

This keeps import redrvfl lightweight and avoids importing optional Hyperopt and Yahoo Finance dependencies unless they are needed.

Repository Notes

The legacy/, utils/, RecRVFL_/, and ForecastLib.py files are retained for traceability to earlier research scripts. They are not included in the published wheel and are not the supported package API.

PyPI Release

The publish workflow uses PyPI Trusted Publishing. Configure the PyPI trusted publisher with:

  • owner: statsdl
  • repository: RedRVFL
  • workflow: publish.yml
  • environment: pypi

License

MIT

Reference

If you use RedRVFL in your work, please cite:

@article{bhambu2024recurrent,
  title={Recurrent ensemble random vector functional link neural network for financial time series forecasting},
  author={Bhambu, Aryan and Gao, Ruobin and Suganthan, Ponnuthurai Nagaratnam},
  journal={Applied Soft Computing},
  volume={161},
  pages={111759},
  year={2024},
  publisher={Elsevier}
}

Metadata

Release files for redrvfl 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for redrvfl 0.1.2
File Size Uploaded
redrvfl-0.1.2.tar.gz 14.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for redrvfl 0.1.2
File Interpreter ABI Platform
redrvfl-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 27.3 kB

Release files / redrvfl-0.1.2.tar.gz

Download URL redrvfl-0.1.2.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
dadfa4f12fc0eb0f0a58a6cd0473666879e6110b9a3f8c1ed9d93b4389cce028
BLAKE2b-256 checksum
How to use checksums
8b62acc88836628f0c7d435fee03cbf1b72a1a99cc74aef1f03f90cc4f2c1fdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Release files / redrvfl-0.1.2-py3-none-any.whl

Download URL redrvfl-0.1.2-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0878bef45eb5de36b6900f75711eec3f029770c80d6c13572ad1732c78d1fcb
BLAKE2b-256 checksum
How to use checksums
2caf0f6078b0c8b334ca07228f03fd61a5b545b43b6a15d2713ae9750c67fd75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page