Tools for benchmarking, metrics, and models.
Project description
randomstatsmodels
Lightweight utilities for benchmarking, forecasting, and statistical modeling — with simple Auto* model wrappers that tune hyperparameters for you.
Installation
pip install randomstatsmodels
Requires: Python 3.9+ and NumPy.
Quick Start
from randomstatsmodels import AutoNEO, AutoFourier, AutoKNN, AutoPolymath, AutoThetaAR
import numpy as np
# Toy data: sine wave + noise
rng = np.random.default_rng(42)
t = np.arange(200)
y = np.sin(2*np.pi*t/24) + 0.1*rng.normal(size=t.size)
h = 12 # forecast horizon
model = AutoNEO().fit(y)
yhat = model.predict(h)
print("Forecast:", yhat[:5])
Models
Each Auto* class:
- accepts a parameter grid (or uses sensible defaults),
- fits/evaluates candidates using a chosen metric,
- exposes a unified API:
.fit(y[, X])and.predict(h).
AutoNEO
from randomstatsmodels import AutoNEO
neo = AutoNEO(
param_grid={"n_components": [8, 16, 32]},
metric="mae",
)
neo.fit(y)
print("Best params:", neo.best_params_)
print("Prediction:", neo.predict(h))
AutoFourier
from randomstatsmodels import AutoFourier
fourier = AutoFourier(
param_grid={"season_length": [12, 24], "n_terms": [3, 5]},
metric="smape",
)
fourier.fit(y)
print("Prediction:", fourier.predict(h))
AutoKNN
from randomstatsmodels import AutoKNN
knn = AutoKNN(
param_grid={"k": [3, 5, 7], "window": [12, 24]},
metric="rmse",
)
knn.fit(y)
print("Prediction:", knn.predict(h))
AutoPolymath
from randomstatsmodels import AutoPolymath
poly = AutoPolymath(
param_grid={"degree": [2, 3], "ridge": [0.0, 0.1]},
metric="mae",
)
poly.fit(y)
print("Prediction:", poly.predict(h))
AutoThetaAR
from randomstatsmodels import AutoThetaAR
theta = AutoThetaAR(
param_grid={"theta": [0.5, 1.0, 2.0]},
metric="mape",
)
theta.fit(y)
print("Prediction:", theta.predict(h))
Metrics
Available out of the box:
from randomstatsmodels.metrics import mae, rmse, mape, smape
License
MIT © 2025 Jacob Wright
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
randomstatsmodels-1.0.0.tar.gz
(37.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file randomstatsmodels-1.0.0.tar.gz.
File metadata
- Download URL: randomstatsmodels-1.0.0.tar.gz
- Upload date:
- Size: 37.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b053952dad1279661d99550e7a9f0a6586d17ab60105fb9ca419f103a5e2ad0
|
|
| MD5 |
d50391df31d0ddd13e5b0efe16f805c1
|
|
| BLAKE2b-256 |
688dffdb53722ca34347f69e4d86b568827255eb10504e1bfd1ac5c2f088913a
|
File details
Details for the file randomstatsmodels-1.0.0-py3-none-any.whl.
File metadata
- Download URL: randomstatsmodels-1.0.0-py3-none-any.whl
- Upload date:
- Size: 44.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da57cfe7fca290817dbb585994b04c7c2c17fcdc4c55affbf6e69ce720ab439f
|
|
| MD5 |
a5e5030261ff9e9372d63e36d3729cb9
|
|
| BLAKE2b-256 |
8a39bd12ee583d5986503432a4e85f09d0c23daa34256dfccc8e92881e97cbe9
|