Today, give a try to Techtonique web app, a tool designed to help you make informed, data-driven decisions using Mathematics, Statistics, Machine Learning, and Data Visualization. Here is a tutorial with audio, video, code, and slides: https://moudiki2.gumroad.com/l/nrhgb. 100 API requests are now (and forever) offered to every user every month, no matter the pricing tier.
In this post:
- I show how to use python package
nnetsauce
alongsidesktime
for univariate and multivariate time series (probabilistic) forecasting.sktime
useful for benchmarking a plethora of (probabilistic) forecasts with a unified interface - I benchmark
nnetsauce.MTS
’s armada (not withsktime
) against foundation models (“LLMs”, Amazon’s Chronos, IBM’s TinyTimeMixer) and statistical models (ARIMA, ETS, Theta, VAR, VECM). Regarding the LLMs: If I’m not doing it well (I just plugged and played), do not hesitate to reach out.
A link to the notebook is availble at the end of this post.
Contents
0 - Install nnetsauce
and mlsauce
!pip install git+https://github.com/Techtonique/mlsauce.git --verbose
!pip install nnetsauce
1 - Example 1: using nnetsauce
with sktime
!pip install git+https://github.com/thierrymoudiki/sktime.git --upgrade --no-cache-dir
import numpy as np
import pandas as pd
import statsmodels.api as sm
from sklearn import linear_model
from statsmodels.tsa.base.datetools import dates_from_str
from sktime.forecasting.nnetsaucemts import NnetsauceMTS
Macroeconomic data
# some example data
mdata = sm.datasets.macrodata.load_pandas().data
# prepare the dates index
dates = mdata[["year", "quarter"]].astype(int).astype(str)
quarterly = dates["year"] + "Q" + dates["quarter"]
quarterly = dates_from_str(quarterly)
mdata = mdata[["realgovt", "tbilrate", "cpi"]]
mdata.index = pd.DatetimeIndex(quarterly)
data = np.log(mdata).diff().dropna()
data2 = mdata
n = data.shape[0]
max_idx_train = np.floor(n * 0.9)
training_index = np.arange(0, max_idx_train)
testing_index = np.arange(max_idx_train, n)
df_train = data.iloc[training_index, :]
print(df_train.tail())
df_test = data.iloc[testing_index, :]
print(df_test.head())
realgovt tbilrate cpi
2003-06-30 0.047086 -0.171850 0.002726
2003-09-30 0.000981 -0.021053 0.006511
2003-12-31 0.007267 -0.043485 0.007543
2004-03-31 0.012745 0.043485 0.005887
2004-06-30 0.005669 0.252496 0.009031
realgovt tbilrate cpi
2004-09-30 0.017200 0.297960 0.008950
2004-12-31 -0.012387 0.299877 0.005227
2005-03-31 0.004160 0.201084 0.010374
2005-06-30 0.000966 0.112399 0.004633
2005-09-30 0.023120 0.156521 0.022849
n2 = data.shape[0]
max_idx_train2 = np.floor(n2 * 0.9)
training_index2 = np.arange(0, max_idx_train2)
testing_index2 = np.arange(max_idx_train2, n2)
df_train2 = data2.iloc[training_index2, :]
print(df_train2.tail())
df_test2 = data2.iloc[testing_index, :]
print(df_test.head())
realgovt tbilrate cpi
2003-03-31 800.196 1.14 183.2
2003-06-30 838.775 0.96 183.7
2003-09-30 839.598 0.94 184.9
2003-12-31 845.722 0.90 186.3
2004-03-31 856.570 0.94 187.4
realgovt tbilrate cpi
2004-09-30 0.017200 0.297960 0.008950
2004-12-31 -0.012387 0.299877 0.005227
2005-03-31 0.004160 0.201084 0.010374
2005-06-30 0.000966 0.112399 0.004633
2005-09-30 0.023120 0.156521 0.022849
1 - 1 Point forecast with nnetsauce
’s sktime
interface
regr = linear_model.RidgeCV()
obj_MTS = NnetsauceMTS(regr, lags = 20, n_hidden_features=7, n_clusters=2,
type_pi="scp2-block-bootstrap",
kernel="gaussian",
replications=250)
obj_MTS.fit(df_train)
res = obj_MTS.predict(fh=[i for i in range(1, 20)])
print(res)
100%|██████████| 3/3 [00:00<00:00, 121.23it/s]
realgovt tbilrate cpi
date
2004-09-30 0.01 0.02 0.02
2004-12-31 0.01 0.04 0.02
2005-03-31 0.00 0.03 0.02
2005-06-30 0.01 0.02 0.02
2005-09-30 0.01 0.01 0.02
2005-12-31 0.01 0.04 0.03
2006-03-31 0.01 0.03 0.02
2006-06-30 0.01 0.03 0.03
2006-09-30 0.01 0.02 0.02
2006-12-31 0.01 0.00 0.02
2007-03-31 0.01 -0.00 0.02
2007-06-30 0.01 0.02 0.02
2007-09-30 0.01 -0.01 0.02
2007-12-31 0.00 -0.01 0.02
2008-03-31 0.01 0.02 0.02
2008-06-30 0.00 0.03 0.02
2008-09-30 0.00 0.03 0.02
2008-12-31 0.00 0.01 0.02
2009-03-31 0.00 -0.00 0.02
1 - 2 Probabilistic forecasting with nnetsauce
’s sktime
interface
res = obj_MTS.predict_quantiles(fh=[i for i in range(1, 20)],
alpha=0.05)
print(res)
realgovt tbilrate cpi realgovt tbilrate cpi
0.05 0.05 0.05 0.95 0.95 0.95
date
2004-09-30 -0.03 -0.47 0.01 0.07 0.44 0.04
2004-12-31 -0.03 -0.31 0.01 0.06 0.66 0.04
2005-03-31 -0.04 -0.41 0.00 0.06 0.65 0.04
2005-06-30 -0.03 -0.43 0.01 0.06 0.46 0.04
2005-09-30 -0.03 -0.44 0.01 0.06 0.37 0.04
2005-12-31 -0.03 -0.30 0.01 0.06 0.46 0.04
2006-03-31 -0.03 -0.40 0.01 0.06 0.46 0.04
2006-06-30 -0.03 -0.40 0.01 0.06 0.46 0.04
2006-09-30 -0.03 -0.31 0.01 0.06 0.66 0.04
2006-12-31 -0.03 -0.44 0.00 0.05 0.61 0.04
2007-03-31 -0.03 -0.44 0.01 0.05 0.37 0.04
2007-06-30 -0.04 -0.31 0.01 0.05 0.37 0.04
2007-09-30 -0.03 -0.31 0.01 0.06 0.36 0.04
2007-12-31 -0.04 -0.44 0.01 0.05 0.59 0.04
2008-03-31 -0.04 -0.47 0.00 0.07 0.43 0.04
2008-06-30 -0.03 -0.31 0.01 0.06 0.66 0.04
2008-09-30 -0.04 -0.41 0.00 0.06 0.65 0.04
2008-12-31 -0.04 -0.44 -0.00 0.05 0.45 0.03
2009-03-31 -0.04 -0.44 -0.00 0.05 0.36 0.03
obj_MTS.fitter.plot(series="realgovt")
obj_MTS.fitter.plot(series="cpi")
2 - sktime foundation models and nnetsauce
2 - 1 - Example1 on macroeconomic data
# Do imports
import nnetsauce as ns
import mlsauce as ms
from sktime.forecasting.ttm import TinyTimeMixerForecaster
from sktime.forecasting.chronos import ChronosForecaster
# Initialise models
chronos = ChronosForecaster("amazon/chronos-t5-tiny")
ttm = TinyTimeMixerForecaster()
regr = linear_model.RidgeCV()
obj_MTS = NnetsauceMTS(regr, lags = 20, n_hidden_features=7, n_clusters=2,
type_pi="scp2-block-bootstrap",
kernel="gaussian",
replications=250)
regr2 = ms.GenericBoostingRegressor(regr)
obj_MTS2 = ns.MTS(obj=regr2)
# Fit
h = df_test.shape[0] + 1
chronos.fit(y=df_train, fh=range(1, h))
ttm.fit(y=df_train, fh=range(1, h))
obj_MTS.fit(y=df_train, fh=range(1, h))
obj_MTS2.fit(df_train)
# Predict
pred_chronos = chronos.predict(fh=[i for i in range(1, h)])
pred_ttm = ttm.predict(fh=[i for i in range(1, h)])
pred_MTS = obj_MTS.predict(fh=[i for i in range(1, h)])
pred_MTS2 = obj_MTS2.predict(h=h-1)
config.json: 0%| | 0.00/1.14k [00:00<?, ?B/s]
model.safetensors: 0%| | 0.00/33.6M [00:00<?, ?B/s]
generation_config.json: 0%| | 0.00/142 [00:00<?, ?B/s]
config.json: 0%| | 0.00/1.19k [00:00<?, ?B/s]
model.safetensors: 0%| | 0.00/3.24M [00:00<?, ?B/s]
100%|██████████| 3/3 [00:00<00:00, 17.87it/s]
0%| | 0/3 [00:00<?, ?it/s]
0%| | 0/100 [00:00<?, ?it/s][A
22%|██▏ | 22/100 [00:00<00:00, 124.79it/s]
33%|███▎ | 1/3 [00:00<00:00, 4.78it/s]
0%| | 0/22 [00:00<?, ?it/s][A
100%|██████████| 22/22 [00:00<00:00, 120.57it/s]
67%|██████▋ | 2/3 [00:00<00:00, 4.57it/s]
0%| | 0/22 [00:00<?, ?it/s][A
100%|██████████| 22/22 [00:00<00:00, 121.13it/s]
100%|██████████| 3/3 [00:00<00:00, 4.51it/s]
pred_MTS2 = obj_MTS2.predict(h=h-1)
import numpy as np
def rmse(predictions, targets):
return np.sqrt(((predictions.values - targets.values) ** 2).mean())
def mae(predictions, targets):
return np.mean(np.abs(predictions - targets))
def me(predictions, targets):
return np.mean(predictions - targets)
print("Chronos RMSE:", rmse(df_test, pred_chronos))
print("Chronos MAE:", mae(df_test, pred_chronos))
print("Chronos ME:", me(df_test, pred_chronos))
print("TinyTimeMixer RMSE:", rmse(df_test, pred_ttm))
print("TinyTimeMixer MAE:", mae(df_test, pred_ttm))
print("TinyTimeMixer ME:", me(df_test, pred_ttm))
print("NnetsauceMTS RMSE:", rmse(df_test, pred_MTS))
print("NnetsauceMTS MAE:", mae(df_test, pred_MTS))
print("NnetsauceMTS ME:", me(df_test, pred_MTS))
Chronos RMSE: 0.3270528840422444
Chronos MAE: 0.10750380038506846
Chronos ME: -0.04182334654432299
TinyTimeMixer RMSE: 0.3248244141056522
TinyTimeMixer MAE: 0.11031492439459516
TinyTimeMixer ME: -0.03476608913007449
NnetsauceMTS RMSE: 0.320951903060047
NnetsauceMTS MAE: 0.10903099364744497
NnetsauceMTS ME: -0.0298461588803314
Loop and leaderboard
from sklearn.utils import all_estimators
from sklearn.base import RegressorMixin
from tqdm import tqdm
results = []
results.append(["Chronos", rmse(df_test, pred_chronos), mae(df_test, pred_chronos), me(df_test, pred_chronos)])
results.append(["TinyTimeMixer", rmse(df_test, pred_ttm), mae(df_test, pred_ttm), me(df_test, pred_ttm)])
results.append(["NnetsauceMTS", rmse(df_test, pred_MTS), mae(df_test, pred_MTS), me(df_test, pred_MTS)])
# statistical models
for i, name in enumerate(["ARIMA", "ETS", "Theta", "VAR", "VECM"]):
try:
regr = ns.ClassicalMTS(model=name)
regr.fit(df_train)
X_pred = regr.predict(h=df_test.shape[0])
results.append([name, rmse(df_test, X_pred.mean), mae(df_test, X_pred.mean), me(df_test, X_pred.mean)])
except Exception:
pass
for est in tqdm(all_estimators()):
if (issubclass(est[1], RegressorMixin)):
try:
preds = ns.MTS(est[1](), verbose=0, show_progress=False).\
fit(df_train).\
predict(h=df_test.shape[0])
results.append([est[0], rmse(df_test, preds), mae(df_test, preds), me(df_test, preds)])
except Exception:
pass
100%|██████████| 206/206 [00:06<00:00, 29.81it/s]
results_df = pd.DataFrame(results, columns=["model", "rmse", "mae", "me"])
import pandas as pd
# Assuming 'results_df' is the DataFrame from the provided code
pd.options.display.float_format = '{:.5f}'.format
display(results_df.sort_values(by="rmse"))
model | rmse | mae | me | |
---|---|---|---|---|
7 | BaggingRegressor | 0.30560 | 0.10120 | -0.03167 |
14 | ExtraTreeRegressor | 0.31035 | 0.11071 | -0.03677 |
15 | ExtraTreesRegressor | 0.32077 | 0.11472 | -0.02632 |
2 | NnetsauceMTS | 0.32095 | 0.10903 | -0.02985 |
29 | LinearRegression | 0.32154 | 0.10754 | -0.03336 |
50 | TransformedTargetRegressor | 0.32154 | 0.10754 | -0.03336 |
45 | Ridge | 0.32168 | 0.10821 | -0.03250 |
21 | KernelRidge | 0.32168 | 0.10821 | -0.03250 |
46 | RidgeCV | 0.32262 | 0.10881 | -0.03281 |
20 | KNeighborsRegressor | 0.32315 | 0.10933 | -0.03600 |
35 | MultiTaskLassoCV | 0.32324 | 0.10931 | -0.03319 |
33 | MultiTaskElasticNetCV | 0.32325 | 0.10932 | -0.03322 |
40 | PLSRegression | 0.32429 | 0.11177 | -0.03433 |
1 | TinyTimeMixer | 0.32482 | 0.11031 | -0.03477 |
44 | RandomForestRegressor | 0.32501 | 0.10802 | -0.03557 |
9 | CCA | 0.32521 | 0.11041 | -0.03330 |
3 | VAR | 0.32597 | 0.10998 | -0.03593 |
37 | OrthogonalMatchingPursuit | 0.32607 | 0.10997 | -0.03581 |
18 | HistGradientBoostingRegressor | 0.32629 | 0.11244 | -0.02872 |
19 | HuberRegressor | 0.32643 | 0.11203 | -0.03014 |
17 | GradientBoostingRegressor | 0.32657 | 0.11299 | -0.02783 |
51 | TweedieRegressor | 0.32662 | 0.11159 | -0.03250 |
47 | SGDRegressor | 0.32665 | 0.11173 | -0.03125 |
8 | BayesianRidge | 0.32666 | 0.11163 | -0.03166 |
36 | NuSVR | 0.32666 | 0.11333 | -0.02833 |
6 | AdaBoostRegressor | 0.32669 | 0.11199 | -0.03032 |
38 | OrthogonalMatchingPursuitCV | 0.32672 | 0.11153 | -0.03218 |
13 | ElasticNetCV | 0.32676 | 0.11152 | -0.03225 |
25 | LassoCV | 0.32676 | 0.11152 | -0.03225 |
28 | LassoLarsIC | 0.32688 | 0.11144 | -0.03286 |
23 | LarsCV | 0.32690 | 0.11143 | -0.03293 |
27 | LassoLarsCV | 0.32696 | 0.11143 | -0.03317 |
42 | QuantileRegressor | 0.32700 | 0.11163 | -0.03203 |
0 | Chronos | 0.32705 | 0.10750 | -0.04182 |
34 | MultiTaskLasso | 0.32723 | 0.11147 | -0.03430 |
5 | ARDRegression | 0.32723 | 0.11147 | -0.03430 |
11 | DummyRegressor | 0.32723 | 0.11147 | -0.03430 |
26 | LassoLars | 0.32723 | 0.11147 | -0.03430 |
41 | PassiveAggressiveRegressor | 0.32723 | 0.11147 | -0.03430 |
12 | ElasticNet | 0.32723 | 0.11147 | -0.03430 |
32 | MultiTaskElasticNet | 0.32723 | 0.11147 | -0.03430 |
24 | Lasso | 0.32723 | 0.11147 | -0.03430 |
30 | LinearSVR | 0.32748 | 0.11165 | -0.03496 |
48 | SVR | 0.32749 | 0.11168 | -0.03670 |
49 | TheilSenRegressor | 0.32770 | 0.11191 | -0.03850 |
4 | VECM | 0.33830 | 0.11309 | -0.05521 |
10 | DecisionTreeRegressor | 0.34038 | 0.12121 | -0.03416 |
16 | GaussianProcessRegressor | 0.34571 | 0.15000 | 0.01448 |
22 | Lars | 0.37064 | 0.13648 | -0.09831 |
39 | PLSCanonical | 831.49831 | 269.94059 | -269.93944 |
43 | RANSACRegressor | 27213.86285 | 6727.75305 | -6727.75305 |
31 | MLPRegressor | 2640594432241.43555 | 711026457838.45886 | 540623410390.19354 |
display(results_df.sort_values(by="mae"))
model | rmse | mae | me | |
---|---|---|---|---|
7 | BaggingRegressor | 0.30560 | 0.10120 | -0.03167 |
0 | Chronos | 0.32705 | 0.10750 | -0.04182 |
50 | TransformedTargetRegressor | 0.32154 | 0.10754 | -0.03336 |
29 | LinearRegression | 0.32154 | 0.10754 | -0.03336 |
44 | RandomForestRegressor | 0.32501 | 0.10802 | -0.03557 |
45 | Ridge | 0.32168 | 0.10821 | -0.03250 |
21 | KernelRidge | 0.32168 | 0.10821 | -0.03250 |
46 | RidgeCV | 0.32262 | 0.10881 | -0.03281 |
2 | NnetsauceMTS | 0.32095 | 0.10903 | -0.02985 |
35 | MultiTaskLassoCV | 0.32324 | 0.10931 | -0.03319 |
33 | MultiTaskElasticNetCV | 0.32325 | 0.10932 | -0.03322 |
20 | KNeighborsRegressor | 0.32315 | 0.10933 | -0.03600 |
37 | OrthogonalMatchingPursuit | 0.32607 | 0.10997 | -0.03581 |
3 | VAR | 0.32597 | 0.10998 | -0.03593 |
1 | TinyTimeMixer | 0.32482 | 0.11031 | -0.03477 |
9 | CCA | 0.32521 | 0.11041 | -0.03330 |
14 | ExtraTreeRegressor | 0.31035 | 0.11071 | -0.03677 |
27 | LassoLarsCV | 0.32696 | 0.11143 | -0.03317 |
23 | LarsCV | 0.32690 | 0.11143 | -0.03293 |
28 | LassoLarsIC | 0.32688 | 0.11144 | -0.03286 |
26 | LassoLars | 0.32723 | 0.11147 | -0.03430 |
11 | DummyRegressor | 0.32723 | 0.11147 | -0.03430 |
34 | MultiTaskLasso | 0.32723 | 0.11147 | -0.03430 |
41 | PassiveAggressiveRegressor | 0.32723 | 0.11147 | -0.03430 |
32 | MultiTaskElasticNet | 0.32723 | 0.11147 | -0.03430 |
5 | ARDRegression | 0.32723 | 0.11147 | -0.03430 |
24 | Lasso | 0.32723 | 0.11147 | -0.03430 |
12 | ElasticNet | 0.32723 | 0.11147 | -0.03430 |
25 | LassoCV | 0.32676 | 0.11152 | -0.03225 |
13 | ElasticNetCV | 0.32676 | 0.11152 | -0.03225 |
38 | OrthogonalMatchingPursuitCV | 0.32672 | 0.11153 | -0.03218 |
51 | TweedieRegressor | 0.32662 | 0.11159 | -0.03250 |
8 | BayesianRidge | 0.32666 | 0.11163 | -0.03166 |
42 | QuantileRegressor | 0.32700 | 0.11163 | -0.03203 |
30 | LinearSVR | 0.32748 | 0.11165 | -0.03496 |
48 | SVR | 0.32749 | 0.11168 | -0.03670 |
47 | SGDRegressor | 0.32665 | 0.11173 | -0.03125 |
40 | PLSRegression | 0.32429 | 0.11177 | -0.03433 |
49 | TheilSenRegressor | 0.32770 | 0.11191 | -0.03850 |
6 | AdaBoostRegressor | 0.32669 | 0.11199 | -0.03032 |
19 | HuberRegressor | 0.32643 | 0.11203 | -0.03014 |
18 | HistGradientBoostingRegressor | 0.32629 | 0.11244 | -0.02872 |
17 | GradientBoostingRegressor | 0.32657 | 0.11299 | -0.02783 |
4 | VECM | 0.33830 | 0.11309 | -0.05521 |
36 | NuSVR | 0.32666 | 0.11333 | -0.02833 |
15 | ExtraTreesRegressor | 0.32077 | 0.11472 | -0.02632 |
10 | DecisionTreeRegressor | 0.34038 | 0.12121 | -0.03416 |
22 | Lars | 0.37064 | 0.13648 | -0.09831 |
16 | GaussianProcessRegressor | 0.34571 | 0.15000 | 0.01448 |
39 | PLSCanonical | 831.49831 | 269.94059 | -269.93944 |
43 | RANSACRegressor | 27213.86285 | 6727.75305 | -6727.75305 |
31 | MLPRegressor | 2640594432241.43555 | 711026457838.45886 | 540623410390.19354 |
display(results_df.sort_values(by="me", ascending=False))
model | rmse | mae | me | |
---|---|---|---|---|
31 | MLPRegressor | 2640594432241.43555 | 711026457838.45886 | 540623410390.19354 |
16 | GaussianProcessRegressor | 0.34571 | 0.15000 | 0.01448 |
15 | ExtraTreesRegressor | 0.32077 | 0.11472 | -0.02632 |
17 | GradientBoostingRegressor | 0.32657 | 0.11299 | -0.02783 |
36 | NuSVR | 0.32666 | 0.11333 | -0.02833 |
18 | HistGradientBoostingRegressor | 0.32629 | 0.11244 | -0.02872 |
2 | NnetsauceMTS | 0.32095 | 0.10903 | -0.02985 |
19 | HuberRegressor | 0.32643 | 0.11203 | -0.03014 |
6 | AdaBoostRegressor | 0.32669 | 0.11199 | -0.03032 |
47 | SGDRegressor | 0.32665 | 0.11173 | -0.03125 |
8 | BayesianRidge | 0.32666 | 0.11163 | -0.03166 |
7 | BaggingRegressor | 0.30560 | 0.10120 | -0.03167 |
42 | QuantileRegressor | 0.32700 | 0.11163 | -0.03203 |
38 | OrthogonalMatchingPursuitCV | 0.32672 | 0.11153 | -0.03218 |
13 | ElasticNetCV | 0.32676 | 0.11152 | -0.03225 |
25 | LassoCV | 0.32676 | 0.11152 | -0.03225 |
51 | TweedieRegressor | 0.32662 | 0.11159 | -0.03250 |
45 | Ridge | 0.32168 | 0.10821 | -0.03250 |
21 | KernelRidge | 0.32168 | 0.10821 | -0.03250 |
46 | RidgeCV | 0.32262 | 0.10881 | -0.03281 |
28 | LassoLarsIC | 0.32688 | 0.11144 | -0.03286 |
23 | LarsCV | 0.32690 | 0.11143 | -0.03293 |
27 | LassoLarsCV | 0.32696 | 0.11143 | -0.03317 |
35 | MultiTaskLassoCV | 0.32324 | 0.10931 | -0.03319 |
33 | MultiTaskElasticNetCV | 0.32325 | 0.10932 | -0.03322 |
9 | CCA | 0.32521 | 0.11041 | -0.03330 |
50 | TransformedTargetRegressor | 0.32154 | 0.10754 | -0.03336 |
29 | LinearRegression | 0.32154 | 0.10754 | -0.03336 |
10 | DecisionTreeRegressor | 0.34038 | 0.12121 | -0.03416 |
34 | MultiTaskLasso | 0.32723 | 0.11147 | -0.03430 |
32 | MultiTaskElasticNet | 0.32723 | 0.11147 | -0.03430 |
26 | LassoLars | 0.32723 | 0.11147 | -0.03430 |
12 | ElasticNet | 0.32723 | 0.11147 | -0.03430 |
24 | Lasso | 0.32723 | 0.11147 | -0.03430 |
11 | DummyRegressor | 0.32723 | 0.11147 | -0.03430 |
5 | ARDRegression | 0.32723 | 0.11147 | -0.03430 |
41 | PassiveAggressiveRegressor | 0.32723 | 0.11147 | -0.03430 |
40 | PLSRegression | 0.32429 | 0.11177 | -0.03433 |
1 | TinyTimeMixer | 0.32482 | 0.11031 | -0.03477 |
30 | LinearSVR | 0.32748 | 0.11165 | -0.03496 |
44 | RandomForestRegressor | 0.32501 | 0.10802 | -0.03557 |
37 | OrthogonalMatchingPursuit | 0.32607 | 0.10997 | -0.03581 |
3 | VAR | 0.32597 | 0.10998 | -0.03593 |
20 | KNeighborsRegressor | 0.32315 | 0.10933 | -0.03600 |
48 | SVR | 0.32749 | 0.11168 | -0.03670 |
14 | ExtraTreeRegressor | 0.31035 | 0.11071 | -0.03677 |
49 | TheilSenRegressor | 0.32770 | 0.11191 | -0.03850 |
0 | Chronos | 0.32705 | 0.10750 | -0.04182 |
4 | VECM | 0.33830 | 0.11309 | -0.05521 |
22 | Lars | 0.37064 | 0.13648 | -0.09831 |
39 | PLSCanonical | 831.49831 | 269.94059 | -269.93944 |
43 | RANSACRegressor | 27213.86285 | 6727.75305 | -6727.75305 |
2 - 2 - Example2 on antidiabetic drug sales
url = "https://raw.githubusercontent.com/Techtonique/"
url += "datasets/main/time_series/univariate/"
url += "a10.csv"
data = pd.read_csv(url)
data.index = pd.DatetimeIndex(data.date) # must have
data.drop(columns=['date'], inplace=True)
n = data.shape[0]
max_idx_train = np.floor(n * 0.9)
training_index = np.arange(0, max_idx_train)
testing_index = np.arange(max_idx_train, n)
df_train = data.iloc[training_index, :]
print(df_train.tail())
df_test = data.iloc[testing_index, :]
print(df_test.head())
value
date
2006-05-01 17.78306
2006-06-01 16.29160
2006-07-01 16.98028
2006-08-01 18.61219
2006-09-01 16.62334
value
date
2006-10-01 21.43024
2006-11-01 23.57552
2006-12-01 23.33421
2007-01-01 28.03838
2007-02-01 16.76387
df_train.plot()
<Axes: xlabel='date'>
# Do imports
import nnetsauce as ns
import mlsauce as ms
from sktime.forecasting.ttm import TinyTimeMixerForecaster
from sktime.forecasting.chronos import ChronosForecaster
# Initialise models
chronos = ChronosForecaster("amazon/chronos-t5-tiny")
ttm = TinyTimeMixerForecaster()
regr = linear_model.RidgeCV()
regr2 = ms.GenericBoostingRegressor(regr)
obj_MTS2 = ns.MTS(obj=regr2)
# Fit
h = df_test.shape[0] + 1
chronos.fit(y=df_train, fh=range(1, h))
ttm.fit(y=df_train, fh=range(1, h))
obj_MTS.fit(y=df_train, fh=range(1, h))
obj_MTS2.fit(df_train)
# Predict
pred_chronos = chronos.predict(fh=[i for i in range(1, h)])
pred_ttm = ttm.predict(fh=[i for i in range(1, h)])
pred_MTS2 = obj_MTS2.predict(h=h-1)
100%|██████████| 100/100 [00:00<00:00, 327.48it/s]
print("Chronos RMSE:", rmse(df_test, pred_chronos))
print("Chronos MAE:", mae(df_test, pred_chronos))
print("Chronos ME:", me(df_test, pred_chronos))
print("TinyTimeMixer RMSE:", rmse(df_test, pred_ttm))
print("TinyTimeMixer MAE:", mae(df_test, pred_ttm))
print("TinyTimeMixer ME:", me(df_test, pred_ttm))
print("NnetsauceMTS RMSE:", rmse(df_test, pred_MTS2))
print("NnetsauceMTS MAE:", mae(df_test, pred_MTS2))
print("NnetsauceMTS ME:", me(df_test, pred_MTS2))
Chronos RMSE: 4.668968548036785
Chronos MAE: 4.351116104707961
Chronos ME: 3.249815388190104
TinyTimeMixer RMSE: 6.6643723494125355
TinyTimeMixer MAE: 5.881109575050688
TinyTimeMixer ME: 5.876180504854445
NnetsauceMTS RMSE: 7.449155397775451
NnetsauceMTS MAE: 6.717429133757641
NnetsauceMTS ME: 6.717429133757641
from sklearn.utils import all_estimators
from sklearn.base import RegressorMixin
from tqdm import tqdm
results = []
# LLMs and sktime
results.append(["Chronos", rmse(df_test, pred_chronos), mae(df_test, pred_chronos), me(df_test, pred_chronos)])
results.append(["TinyTimeMixer", rmse(df_test, pred_ttm), mae(df_test, pred_ttm), me(df_test, pred_ttm)])
results.append(["NnetsauceMTS", rmse(df_test, pred_MTS), mae(df_test, pred_MTS), me(df_test, pred_MTS)])
# statistical models
for i, name in enumerate(["ARIMA", "ETS", "Theta", "VAR", "VECM"]):
try:
regr = ns.ClassicalMTS(model=name)
regr.fit(df_train)
X_pred = regr.predict(h=df_test.shape[0])
results.append([name, rmse(df_test, X_pred.mean), mae(df_test, X_pred.mean), me(df_test, X_pred.mean)])
except Exception:
pass
for est in tqdm(all_estimators()):
if (issubclass(est[1], RegressorMixin)):
try:
preds = ns.MTS(est[1](), lags=20, verbose=0, show_progress=False).\
fit(df_train).\
predict(h=df_test.shape[0])
results.append([est[0], rmse(df_test, preds), mae(df_test, preds), me(df_test, preds)])
except Exception:
pass
100%|██████████| 206/206 [00:05<00:00, 35.10it/s]
results_df = pd.DataFrame(results, columns=["model", "rmse", "mae", "me"])
import pandas as pd
# Assuming 'results_df' is the DataFrame from the provided code
pd.options.display.float_format = '{:.5f}'.format
display(results_df.sort_values(by="rmse"))
model | rmse | mae | me | |
---|---|---|---|---|
37 | OrthogonalMatchingPursuit | 3.04709 | 2.69552 | 2.59578 |
43 | RandomForestRegressor | 3.10382 | 2.55888 | 2.05839 |
38 | OrthogonalMatchingPursuitCV | 3.12691 | 2.68994 | 2.67753 |
25 | LassoCV | 3.14258 | 2.78649 | 2.71682 |
35 | MultiTaskLassoCV | 3.14258 | 2.78649 | 2.71682 |
27 | LassoLarsCV | 3.14308 | 2.78698 | 2.71755 |
23 | LarsCV | 3.14308 | 2.78698 | 2.71755 |
33 | MultiTaskElasticNetCV | 3.17701 | 2.84284 | 2.77308 |
13 | ElasticNetCV | 3.17701 | 2.84284 | 2.77308 |
46 | SGDRegressor | 3.22877 | 2.83957 | 2.83957 |
10 | DecisionTreeRegressor | 3.26890 | 2.73450 | 2.15218 |
8 | BaggingRegressor | 3.27914 | 2.83882 | 2.50350 |
15 | ExtraTreesRegressor | 3.30520 | 2.89079 | 2.71086 |
6 | ARDRegression | 3.45668 | 3.02580 | 3.02408 |
14 | ExtraTreeRegressor | 3.49769 | 2.77511 | 2.41475 |
48 | TheilSenRegressor | 3.62027 | 3.25754 | 3.25754 |
31 | MLPRegressor | 3.65081 | 2.91033 | 1.08975 |
7 | AdaBoostRegressor | 3.69998 | 3.40106 | 2.85192 |
28 | LassoLarsIC | 3.71916 | 3.29246 | 3.29246 |
45 | RidgeCV | 3.77950 | 3.40210 | 3.40210 |
21 | KernelRidge | 3.77950 | 3.40210 | 3.40210 |
44 | Ridge | 3.77950 | 3.40210 | 3.40210 |
42 | RANSACRegressor | 3.82726 | 3.45743 | 3.45743 |
9 | BayesianRidge | 3.92099 | 3.51565 | 3.51565 |
49 | TransformedTargetRegressor | 4.09708 | 3.65104 | 3.65104 |
29 | LinearRegression | 4.09708 | 3.65104 | 3.65104 |
22 | Lars | 4.15261 | 3.64182 | 3.64182 |
39 | PLSRegression | 4.53423 | 3.99218 | 3.95978 |
5 | Theta | 4.57439 | 4.24487 | 4.24487 |
17 | GradientBoostingRegressor | 4.58340 | 4.14143 | 4.14143 |
30 | LinearSVR | 4.61862 | 4.26089 | 4.26089 |
50 | TweedieRegressor | 4.65986 | 3.93009 | 3.53582 |
0 | Chronos | 4.66897 | 4.35112 | 3.24982 |
19 | HuberRegressor | 4.96950 | 4.55567 | 4.55567 |
18 | HistGradientBoostingRegressor | 5.41091 | 4.67558 | 4.60438 |
20 | KNeighborsRegressor | 5.82768 | 5.06658 | 5.02970 |
12 | ElasticNet | 5.85659 | 5.10931 | 5.10931 |
32 | MultiTaskElasticNet | 5.85659 | 5.10931 | 5.10931 |
40 | PassiveAggressiveRegressor | 5.89234 | 4.31086 | -4.31086 |
34 | MultiTaskLasso | 5.94227 | 5.63437 | 5.63437 |
24 | Lasso | 5.94227 | 5.63437 | 5.63437 |
26 | LassoLars | 5.94227 | 5.63437 | 5.63437 |
4 | ETS | 6.18780 | 5.37221 | 5.28513 |
1 | TinyTimeMixer | 6.66437 | 5.88111 | 5.87618 |
47 | SVR | 6.75271 | 6.06309 | 6.06309 |
36 | NuSVR | 6.76407 | 6.06742 | 6.06742 |
16 | GaussianProcessRegressor | 12.55786 | 12.11319 | 12.11319 |
11 | DummyRegressor | 12.71627 | 12.30232 | 12.30232 |
3 | ARIMA | 13.37258 | 12.97959 | 12.97959 |
41 | QuantileRegressor | 13.47588 | 13.08599 | 13.08599 |
2 | NnetsauceMTS | 22.57186 | NaN | NaN |
display(results_df.sort_values(by="mae"))
model | rmse | mae | me | |
---|---|---|---|---|
43 | RandomForestRegressor | 3.10382 | 2.55888 | 2.05839 |
38 | OrthogonalMatchingPursuitCV | 3.12691 | 2.68994 | 2.67753 |
37 | OrthogonalMatchingPursuit | 3.04709 | 2.69552 | 2.59578 |
10 | DecisionTreeRegressor | 3.26890 | 2.73450 | 2.15218 |
14 | ExtraTreeRegressor | 3.49769 | 2.77511 | 2.41475 |
25 | LassoCV | 3.14258 | 2.78649 | 2.71682 |
35 | MultiTaskLassoCV | 3.14258 | 2.78649 | 2.71682 |
27 | LassoLarsCV | 3.14308 | 2.78698 | 2.71755 |
23 | LarsCV | 3.14308 | 2.78698 | 2.71755 |
8 | BaggingRegressor | 3.27914 | 2.83882 | 2.50350 |
46 | SGDRegressor | 3.22877 | 2.83957 | 2.83957 |
33 | MultiTaskElasticNetCV | 3.17701 | 2.84284 | 2.77308 |
13 | ElasticNetCV | 3.17701 | 2.84284 | 2.77308 |
15 | ExtraTreesRegressor | 3.30520 | 2.89079 | 2.71086 |
31 | MLPRegressor | 3.65081 | 2.91033 | 1.08975 |
6 | ARDRegression | 3.45668 | 3.02580 | 3.02408 |
48 | TheilSenRegressor | 3.62027 | 3.25754 | 3.25754 |
28 | LassoLarsIC | 3.71916 | 3.29246 | 3.29246 |
7 | AdaBoostRegressor | 3.69998 | 3.40106 | 2.85192 |
45 | RidgeCV | 3.77950 | 3.40210 | 3.40210 |
21 | KernelRidge | 3.77950 | 3.40210 | 3.40210 |
44 | Ridge | 3.77950 | 3.40210 | 3.40210 |
42 | RANSACRegressor | 3.82726 | 3.45743 | 3.45743 |
9 | BayesianRidge | 3.92099 | 3.51565 | 3.51565 |
22 | Lars | 4.15261 | 3.64182 | 3.64182 |
29 | LinearRegression | 4.09708 | 3.65104 | 3.65104 |
49 | TransformedTargetRegressor | 4.09708 | 3.65104 | 3.65104 |
50 | TweedieRegressor | 4.65986 | 3.93009 | 3.53582 |
39 | PLSRegression | 4.53423 | 3.99218 | 3.95978 |
17 | GradientBoostingRegressor | 4.58340 | 4.14143 | 4.14143 |
5 | Theta | 4.57439 | 4.24487 | 4.24487 |
30 | LinearSVR | 4.61862 | 4.26089 | 4.26089 |
40 | PassiveAggressiveRegressor | 5.89234 | 4.31086 | -4.31086 |
0 | Chronos | 4.66897 | 4.35112 | 3.24982 |
19 | HuberRegressor | 4.96950 | 4.55567 | 4.55567 |
18 | HistGradientBoostingRegressor | 5.41091 | 4.67558 | 4.60438 |
20 | KNeighborsRegressor | 5.82768 | 5.06658 | 5.02970 |
12 | ElasticNet | 5.85659 | 5.10931 | 5.10931 |
32 | MultiTaskElasticNet | 5.85659 | 5.10931 | 5.10931 |
4 | ETS | 6.18780 | 5.37221 | 5.28513 |
24 | Lasso | 5.94227 | 5.63437 | 5.63437 |
34 | MultiTaskLasso | 5.94227 | 5.63437 | 5.63437 |
26 | LassoLars | 5.94227 | 5.63437 | 5.63437 |
1 | TinyTimeMixer | 6.66437 | 5.88111 | 5.87618 |
47 | SVR | 6.75271 | 6.06309 | 6.06309 |
36 | NuSVR | 6.76407 | 6.06742 | 6.06742 |
16 | GaussianProcessRegressor | 12.55786 | 12.11319 | 12.11319 |
11 | DummyRegressor | 12.71627 | 12.30232 | 12.30232 |
3 | ARIMA | 13.37258 | 12.97959 | 12.97959 |
41 | QuantileRegressor | 13.47588 | 13.08599 | 13.08599 |
2 | NnetsauceMTS | 22.57186 | NaN | NaN |
display(results_df.sort_values(by="me"))
model | rmse | mae | me | |
---|---|---|---|---|
40 | PassiveAggressiveRegressor | 5.89234 | 4.31086 | -4.31086 |
31 | MLPRegressor | 3.65081 | 2.91033 | 1.08975 |
43 | RandomForestRegressor | 3.10382 | 2.55888 | 2.05839 |
10 | DecisionTreeRegressor | 3.26890 | 2.73450 | 2.15218 |
14 | ExtraTreeRegressor | 3.49769 | 2.77511 | 2.41475 |
8 | BaggingRegressor | 3.27914 | 2.83882 | 2.50350 |
37 | OrthogonalMatchingPursuit | 3.04709 | 2.69552 | 2.59578 |
38 | OrthogonalMatchingPursuitCV | 3.12691 | 2.68994 | 2.67753 |
15 | ExtraTreesRegressor | 3.30520 | 2.89079 | 2.71086 |
25 | LassoCV | 3.14258 | 2.78649 | 2.71682 |
35 | MultiTaskLassoCV | 3.14258 | 2.78649 | 2.71682 |
27 | LassoLarsCV | 3.14308 | 2.78698 | 2.71755 |
23 | LarsCV | 3.14308 | 2.78698 | 2.71755 |
33 | MultiTaskElasticNetCV | 3.17701 | 2.84284 | 2.77308 |
13 | ElasticNetCV | 3.17701 | 2.84284 | 2.77308 |
46 | SGDRegressor | 3.22877 | 2.83957 | 2.83957 |
7 | AdaBoostRegressor | 3.69998 | 3.40106 | 2.85192 |
6 | ARDRegression | 3.45668 | 3.02580 | 3.02408 |
0 | Chronos | 4.66897 | 4.35112 | 3.24982 |
48 | TheilSenRegressor | 3.62027 | 3.25754 | 3.25754 |
28 | LassoLarsIC | 3.71916 | 3.29246 | 3.29246 |
45 | RidgeCV | 3.77950 | 3.40210 | 3.40210 |
21 | KernelRidge | 3.77950 | 3.40210 | 3.40210 |
44 | Ridge | 3.77950 | 3.40210 | 3.40210 |
42 | RANSACRegressor | 3.82726 | 3.45743 | 3.45743 |
9 | BayesianRidge | 3.92099 | 3.51565 | 3.51565 |
50 | TweedieRegressor | 4.65986 | 3.93009 | 3.53582 |
22 | Lars | 4.15261 | 3.64182 | 3.64182 |
29 | LinearRegression | 4.09708 | 3.65104 | 3.65104 |
49 | TransformedTargetRegressor | 4.09708 | 3.65104 | 3.65104 |
39 | PLSRegression | 4.53423 | 3.99218 | 3.95978 |
17 | GradientBoostingRegressor | 4.58340 | 4.14143 | 4.14143 |
5 | Theta | 4.57439 | 4.24487 | 4.24487 |
30 | LinearSVR | 4.61862 | 4.26089 | 4.26089 |
19 | HuberRegressor | 4.96950 | 4.55567 | 4.55567 |
18 | HistGradientBoostingRegressor | 5.41091 | 4.67558 | 4.60438 |
20 | KNeighborsRegressor | 5.82768 | 5.06658 | 5.02970 |
12 | ElasticNet | 5.85659 | 5.10931 | 5.10931 |
32 | MultiTaskElasticNet | 5.85659 | 5.10931 | 5.10931 |
4 | ETS | 6.18780 | 5.37221 | 5.28513 |
24 | Lasso | 5.94227 | 5.63437 | 5.63437 |
34 | MultiTaskLasso | 5.94227 | 5.63437 | 5.63437 |
26 | LassoLars | 5.94227 | 5.63437 | 5.63437 |
1 | TinyTimeMixer | 6.66437 | 5.88111 | 5.87618 |
47 | SVR | 6.75271 | 6.06309 | 6.06309 |
36 | NuSVR | 6.76407 | 6.06742 | 6.06742 |
16 | GaussianProcessRegressor | 12.55786 | 12.11319 | 12.11319 |
11 | DummyRegressor | 12.71627 | 12.30232 | 12.30232 |
3 | ARIMA | 13.37258 | 12.97959 | 12.97959 |
41 | QuantileRegressor | 13.47588 | 13.08599 | 13.08599 |
2 | NnetsauceMTS | 22.57186 | NaN | NaN |
PS: remember to give a try to Techtonique web app, a tool designed to help you make informed, data-driven decisions using Mathematics, Statistics, Machine Learning, and Data Visualization
For attribution, please cite this work as:
T. Moudiki (2024-11-24). You can beat Forecasting LLMs (Large Language Models a.k.a foundation models) with nnetsauce.MTS. Retrieved from https://thierrymoudiki.github.io/blog/2024/11/24/r/python/forecasting/nnetsauce/nnetsauce-sktime-LLM
BibTeX citation (remove empty spaces)@misc{ tmoudiki20241124, author = { T. Moudiki }, title = { You can beat Forecasting LLMs (Large Language Models a.k.a foundation models) with nnetsauce.MTS }, url = { https://thierrymoudiki.github.io/blog/2024/11/24/r/python/forecasting/nnetsauce/nnetsauce-sktime-LLM }, year = { 2024 } }
Previous publications
- Another interesting decision, now for 'Beyond Nelson-Siegel and splines: A model-agnostic Machine Learning framework for discount curve calibration, interpolation and extrapolation' Aug 20, 2025
- Boosting any randomized based learner for regression, classification and univariate/multivariate time series forcasting Jul 26, 2025
- New nnetsauce version with CustomBackPropRegressor (CustomRegressor with Backpropagation) and ElasticNet2Regressor (Ridge2 with ElasticNet regularization) Jul 15, 2025
- mlsauce (home to a model-agnostic gradient boosting algorithm) can now be installed from PyPI. Jul 10, 2025
- A user-friendly graphical interface to techtonique dot net's API (will eventually contain graphics). Jul 8, 2025
- Calling =TECHTO_MLCLASSIFICATION for Machine Learning supervised CLASSIFICATION in Excel is just a matter of copying and pasting Jul 7, 2025
- Calling =TECHTO_MLREGRESSION for Machine Learning supervised regression in Excel is just a matter of copying and pasting Jul 6, 2025
- Calling =TECHTO_RESERVING and =TECHTO_MLRESERVING for claims triangle reserving in Excel is just a matter of copying and pasting Jul 5, 2025
- Calling =TECHTO_SURVIVAL for Survival Analysis in Excel is just a matter of copying and pasting Jul 4, 2025
- Calling =TECHTO_SIMULATION for Stochastic Simulation in Excel is just a matter of copying and pasting Jul 3, 2025
- Calling =TECHTO_FORECAST for forecasting in Excel is just a matter of copying and pasting Jul 2, 2025
- Random Vector Functional Link (RVFL) artificial neural network with 2 regularization parameters successfully used for forecasting/synthetic simulation in professional settings: Extensions (including Bayesian) Jul 1, 2025
- R version of 'Backpropagating quasi-randomized neural networks' Jun 24, 2025
- Backpropagating quasi-randomized neural networks Jun 23, 2025
- Beyond ARMA-GARCH: leveraging any statistical model for volatility forecasting Jun 21, 2025
- Stacked generalization (Machine Learning model stacking) + conformal prediction for forecasting with ahead::mlf Jun 18, 2025
- An Overfitting dilemma: XGBoost Default Hyperparameters vs GenericBooster + LinearRegression Default Hyperparameters Jun 14, 2025
- Programming language-agnostic reserving using RidgeCV, LightGBM, XGBoost, and ExtraTrees Machine Learning models Jun 13, 2025
- Exceptionally, and on a more personal note (otherwise I may get buried alive)... Jun 10, 2025
- Free R, Python and SQL editors in techtonique dot net Jun 9, 2025
- Beyond Nelson-Siegel and splines: A model-agnostic Machine Learning framework for discount curve calibration, interpolation and extrapolation Jun 7, 2025
- scikit-learn, glmnet, xgboost, lightgbm, pytorch, keras, nnetsauce in probabilistic Machine Learning (for longitudinal data) Reserving (work in progress) Jun 6, 2025
- R version of Probabilistic Machine Learning (for longitudinal data) Reserving (work in progress) Jun 5, 2025
- Probabilistic Machine Learning (for longitudinal data) Reserving (work in progress) Jun 4, 2025
- Python version of Beyond ARMA-GARCH: leveraging model-agnostic Quasi-Randomized networks and conformal prediction for nonparametric probabilistic stock forecasting (ML-ARCH) Jun 3, 2025
- Beyond ARMA-GARCH: leveraging model-agnostic Machine Learning and conformal prediction for nonparametric probabilistic stock forecasting (ML-ARCH) Jun 2, 2025
- Permutations and SHAPley values for feature importance in techtonique dot net's API (with R + Python + the command line) Jun 1, 2025
- Which patient is going to survive longer? Another guide to using techtonique dot net's API (with R + Python + the command line) for survival analysis May 31, 2025
- A Guide to Using techtonique.net's API and rush for simulating and plotting Stochastic Scenarios May 30, 2025
- Simulating Stochastic Scenarios with Diffusion Models: A Guide to Using techtonique.net's API for the purpose May 29, 2025
- Will my apartment in 5th avenue be overpriced or not? Harnessing the power of www.techtonique.net (+ xgboost, lightgbm, catboost) to find out May 28, 2025
- How long must I wait until something happens: A Comprehensive Guide to Survival Analysis via an API May 27, 2025
- Harnessing the Power of techtonique.net: A Comprehensive Guide to Machine Learning Classification via an API May 26, 2025
- Quantile regression with any regressor -- Examples with RandomForestRegressor, RidgeCV, KNeighborsRegressor May 20, 2025
- Survival stacking: survival analysis translated as supervised classification in R and Python May 5, 2025
- 'Bayesian' optimization of hyperparameters in a R machine learning model using the bayesianrvfl package Apr 25, 2025
- A lightweight interface to scikit-learn in R: Bayesian and Conformal prediction Apr 21, 2025
- A lightweight interface to scikit-learn in R Pt.2: probabilistic time series forecasting in conjunction with ahead::dynrmf Apr 20, 2025
- Extending the Theta forecasting method to GLMs, GAMs, GLMBOOST and attention: benchmarking on Tourism, M1, M3 and M4 competition data sets (28000 series) Apr 14, 2025
- Extending the Theta forecasting method to GLMs and attention Apr 8, 2025
- Nonlinear conformalized Generalized Linear Models (GLMs) with R package 'rvfl' (and other models) Mar 31, 2025
- Probabilistic Time Series Forecasting (predictive simulations) in Microsoft Excel using Python, xlwings lite and www.techtonique.net Mar 28, 2025
- Conformalize (improved prediction intervals and simulations) any R Machine Learning model with misc::conformalize Mar 25, 2025
- My poster for the 18th FINANCIAL RISKS INTERNATIONAL FORUM by Institut Louis Bachelier/Fondation du Risque/Europlace Institute of Finance Mar 19, 2025
- Interpretable probabilistic kernel ridge regression using Matérn 3/2 kernels Mar 16, 2025
- (News from) Probabilistic Forecasting of univariate and multivariate Time Series using Quasi-Randomized Neural Networks (Ridge2) and Conformal Prediction Mar 9, 2025
- Word-Online: re-creating Karpathy's char-RNN (with supervised linear online learning of word embeddings) for text completion Mar 8, 2025
- CRAN-like repository for most recent releases of Techtonique's R packages Mar 2, 2025
- Presenting 'Online Probabilistic Estimation of Carbon Beta and Carbon Shapley Values for Financial and Climate Risk' at Institut Louis Bachelier Feb 27, 2025
- Web app with DeepSeek R1 and Hugging Face API for chatting Feb 23, 2025
- tisthemachinelearner: A Lightweight interface to scikit-learn with 2 classes, Classifier and Regressor (in Python and R) Feb 17, 2025
- R version of survivalist: Probabilistic model-agnostic survival analysis using scikit-learn, xgboost, lightgbm (and conformal prediction) Feb 12, 2025
- Model-agnostic global Survival Prediction of Patients with Myeloid Leukemia in QRT/Gustave Roussy Challenge (challengedata.ens.fr): Python's survivalist Quickstart Feb 10, 2025
- A simple test of the martingale hypothesis in esgtoolkit Feb 3, 2025
- Command Line Interface (CLI) for techtonique.net's API Jan 31, 2025
- Gradient-Boosting and Boostrap aggregating anything (alert: high performance): Part5, easier install and Rust backend Jan 27, 2025
- Just got a paper on conformal prediction REJECTED by International Journal of Forecasting despite evidence on 30,000 time series (and more). What's going on? Part2: 1311 time series from the Tourism competition Jan 20, 2025
- Techtonique is out! (with a tutorial in various programming languages and formats) Jan 14, 2025
- Univariate and Multivariate Probabilistic Forecasting with nnetsauce and TabPFN Jan 14, 2025
- Just got a paper on conformal prediction REJECTED by International Journal of Forecasting despite evidence on 30,000 time series (and more). What's going on? Jan 5, 2025
- Python and Interactive dashboard version of Stock price forecasting with Deep Learning: throwing power at the problem (and why it won't make you rich) Dec 31, 2024
- Stock price forecasting with Deep Learning: throwing power at the problem (and why it won't make you rich) Dec 29, 2024
- No-code Machine Learning Cross-validation and Interpretability in techtonique.net Dec 23, 2024
- survivalist: Probabilistic model-agnostic survival analysis using scikit-learn, glmnet, xgboost, lightgbm, pytorch, keras, nnetsauce and mlsauce Dec 15, 2024
- Model-agnostic 'Bayesian' optimization (for hyperparameter tuning) using conformalized surrogates in GPopt Dec 9, 2024
- You can beat Forecasting LLMs (Large Language Models a.k.a foundation models) with nnetsauce.MTS Pt.2: Generic Gradient Boosting Dec 1, 2024
- You can beat Forecasting LLMs (Large Language Models a.k.a foundation models) with nnetsauce.MTS Nov 24, 2024
- Unified interface and conformal prediction (calibrated prediction intervals) for R package forecast (and 'affiliates') Nov 23, 2024
- GLMNet in Python: Generalized Linear Models Nov 18, 2024
- Gradient-Boosting anything (alert: high performance): Part4, Time series forecasting Nov 10, 2024
- Predictive scenarios simulation in R, Python and Excel using Techtonique API Nov 3, 2024
- Chat with your tabular data in www.techtonique.net Oct 30, 2024
- Gradient-Boosting anything (alert: high performance): Part3, Histogram-based boosting Oct 28, 2024
- R editor and SQL console (in addition to Python editors) in www.techtonique.net Oct 21, 2024
- R and Python consoles + JupyterLite in www.techtonique.net Oct 15, 2024
- Gradient-Boosting anything (alert: high performance): Part2, R version Oct 14, 2024
- Gradient-Boosting anything (alert: high performance) Oct 6, 2024
- Benchmarking 30 statistical/Machine Learning models on the VN1 Forecasting -- Accuracy challenge Oct 4, 2024
- Automated random variable distribution inference using Kullback-Leibler divergence and simulating best-fitting distribution Oct 2, 2024
- Forecasting in Excel using Techtonique's Machine Learning APIs under the hood Sep 30, 2024
- Techtonique web app for data-driven decisions using Mathematics, Statistics, Machine Learning, and Data Visualization Sep 25, 2024
- Parallel for loops (Map or Reduce) + New versions of nnetsauce and ahead Sep 16, 2024
- Adaptive (online/streaming) learning with uncertainty quantification using Polyak averaging in learningmachine Sep 10, 2024
- New versions of nnetsauce and ahead Sep 9, 2024
- Prediction sets and prediction intervals for conformalized Auto XGBoost, Auto LightGBM, Auto CatBoost, Auto GradientBoosting Sep 2, 2024
- Quick/automated R package development workflow (assuming you're using macOS or Linux) Part2 Aug 30, 2024
- R package development workflow (assuming you're using macOS or Linux) Aug 27, 2024
- A new method for deriving a nonparametric confidence interval for the mean Aug 26, 2024
- Conformalized adaptive (online/streaming) learning using learningmachine in Python and R Aug 19, 2024
- Bayesian (nonlinear) adaptive learning Aug 12, 2024
- Auto XGBoost, Auto LightGBM, Auto CatBoost, Auto GradientBoosting Aug 5, 2024
- Copulas for uncertainty quantification in time series forecasting Jul 28, 2024
- Forecasting uncertainty: sequential split conformal prediction + Block bootstrap (web app) Jul 22, 2024
- learningmachine for Python (new version) Jul 15, 2024
- learningmachine v2.0.0: Machine Learning with explanations and uncertainty quantification Jul 8, 2024
- My presentation at ISF 2024 conference (slides with nnetsauce probabilistic forecasting news) Jul 3, 2024
- 10 uncertainty quantification methods in nnetsauce forecasting Jul 1, 2024
- Forecasting with XGBoost embedded in Quasi-Randomized Neural Networks Jun 24, 2024
- Forecasting Monthly Airline Passenger Numbers with Quasi-Randomized Neural Networks Jun 17, 2024
- Automated hyperparameter tuning using any conformalized surrogate Jun 9, 2024
- Recognizing handwritten digits with Ridge2Classifier Jun 3, 2024
- Forecasting the Economy May 27, 2024
- A detailed introduction to Deep Quasi-Randomized 'neural' networks May 19, 2024
- Probability of receiving a loan; using learningmachine May 12, 2024
- mlsauce's `v0.18.2`: various examples and benchmarks with dimension reduction May 6, 2024
- mlsauce's `v0.17.0`: boosting with Elastic Net, polynomials and heterogeneity in explanatory variables Apr 29, 2024
- mlsauce's `v0.13.0`: taking into account inputs heterogeneity through clustering Apr 21, 2024
- mlsauce's `v0.12.0`: prediction intervals for LSBoostRegressor Apr 15, 2024
- Conformalized predictive simulations for univariate time series on more than 250 data sets Apr 7, 2024
- learningmachine v1.1.2: for Python Apr 1, 2024
- learningmachine v1.0.0: prediction intervals around the probability of the event 'a tumor being malignant' Mar 25, 2024
- Bayesian inference and conformal prediction (prediction intervals) in nnetsauce v0.18.1 Mar 18, 2024
- Multiple examples of Machine Learning forecasting with ahead Mar 11, 2024
- rtopy (v0.1.1): calling R functions in Python Mar 4, 2024
- ahead forecasting (v0.10.0): fast time series model calibration and Python plots Feb 26, 2024
- A plethora of datasets at your fingertips Part3: how many times do couples cheat on each other? Feb 19, 2024
- nnetsauce's introduction as of 2024-02-11 (new version 0.17.0) Feb 11, 2024
- Tuning Machine Learning models with GPopt's new version Part 2 Feb 5, 2024
- Tuning Machine Learning models with GPopt's new version Jan 29, 2024
- Subsampling continuous and discrete response variables Jan 22, 2024
- DeepMTS, a Deep Learning Model for Multivariate Time Series Jan 15, 2024
- A classifier that's very accurate (and deep) Pt.2: there are > 90 classifiers in nnetsauce Jan 8, 2024
- learningmachine: prediction intervals for conformalized Kernel ridge regression and Random Forest Jan 1, 2024
- A plethora of datasets at your fingertips Part2: how many times do couples cheat on each other? Descriptive analytics, interpretability and prediction intervals using conformal prediction Dec 25, 2023
- Diffusion models in Python with esgtoolkit (Part2) Dec 18, 2023
- Diffusion models in Python with esgtoolkit Dec 11, 2023
- Julia packaging at the command line Dec 4, 2023
- Quasi-randomized nnetworks in Julia, Python and R Nov 27, 2023
- A plethora of datasets at your fingertips Nov 20, 2023
- A classifier that's very accurate (and deep) Nov 12, 2023
- mlsauce version 0.8.10: Statistical/Machine Learning with Python and R Nov 5, 2023
- AutoML in nnetsauce (randomized and quasi-randomized nnetworks) Pt.2: multivariate time series forecasting Oct 29, 2023
- AutoML in nnetsauce (randomized and quasi-randomized nnetworks) Oct 22, 2023
- Version v0.14.0 of nnetsauce for R and Python Oct 16, 2023
- A diffusion model: G2++ Oct 9, 2023
- Diffusion models in ESGtoolkit + announcements Oct 2, 2023
- An infinity of time series forecasting models in nnetsauce (Part 2 with uncertainty quantification) Sep 25, 2023
- (News from) forecasting in Python with ahead (progress bars and plots) Sep 18, 2023
- Forecasting in Python with ahead Sep 11, 2023
- Risk-neutralize simulations Sep 4, 2023
- Comparing cross-validation results using crossval_ml and boxplots Aug 27, 2023
- Reminder Apr 30, 2023
- Did you ask ChatGPT about who you are? Apr 16, 2023
- A new version of nnetsauce (randomized and quasi-randomized 'neural' networks) Apr 2, 2023
- Simple interfaces to the forecasting API Nov 23, 2022
- A web application for forecasting in Python, R, Ruby, C#, JavaScript, PHP, Go, Rust, Java, MATLAB, etc. Nov 2, 2022
- Prediction intervals (not only) for Boosted Configuration Networks in Python Oct 5, 2022
- Boosted Configuration (neural) Networks Pt. 2 Sep 3, 2022
- Boosted Configuration (_neural_) Networks for classification Jul 21, 2022
- A Machine Learning workflow using Techtonique Jun 6, 2022
- Super Mario Bros © in the browser using PyScript May 8, 2022
- News from ESGtoolkit, ycinterextra, and nnetsauce Apr 4, 2022
- Explaining a Keras _neural_ network predictions with the-teller Mar 11, 2022
- New version of nnetsauce -- various quasi-randomized networks Feb 12, 2022
- A dashboard illustrating bivariate time series forecasting with `ahead` Jan 14, 2022
- Hundreds of Statistical/Machine Learning models for univariate time series, using ahead, ranger, xgboost, and caret Dec 20, 2021
- Forecasting with `ahead` (Python version) Dec 13, 2021
- Tuning and interpreting LSBoost Nov 15, 2021
- Time series cross-validation using `crossvalidation` (Part 2) Nov 7, 2021
- Fast and scalable forecasting with ahead::ridge2f Oct 31, 2021
- Automatic Forecasting with `ahead::dynrmf` and Ridge regression Oct 22, 2021
- Forecasting with `ahead` Oct 15, 2021
- Classification using linear regression Sep 26, 2021
- `crossvalidation` and random search for calibrating support vector machines Aug 6, 2021
- parallel grid search cross-validation using `crossvalidation` Jul 31, 2021
- `crossvalidation` on R-universe, plus a classification example Jul 23, 2021
- Documentation and source code for GPopt, a package for Bayesian optimization Jul 2, 2021
- Hyperparameters tuning with GPopt Jun 11, 2021
- A forecasting tool (API) with examples in curl, R, Python May 28, 2021
- Bayesian Optimization with GPopt Part 2 (save and resume) Apr 30, 2021
- Bayesian Optimization with GPopt Apr 16, 2021
- Compatibility of nnetsauce and mlsauce with scikit-learn Mar 26, 2021
- Explaining xgboost predictions with the teller Mar 12, 2021
- An infinity of time series models in nnetsauce Mar 6, 2021
- New activation functions in mlsauce's LSBoost Feb 12, 2021
- 2020 recap, Gradient Boosting, Generalized Linear Models, AdaOpt with nnetsauce and mlsauce Dec 29, 2020
- A deeper learning architecture in nnetsauce Dec 18, 2020
- Classify penguins with nnetsauce's MultitaskClassifier Dec 11, 2020
- Bayesian forecasting for uni/multivariate time series Dec 4, 2020
- Generalized nonlinear models in nnetsauce Nov 28, 2020
- Boosting nonlinear penalized least squares Nov 21, 2020
- Statistical/Machine Learning explainability using Kernel Ridge Regression surrogates Nov 6, 2020
- NEWS Oct 30, 2020
- A glimpse into my PhD journey Oct 23, 2020
- Submitting R package to CRAN Oct 16, 2020
- Simulation of dependent variables in ESGtoolkit Oct 9, 2020
- Forecasting lung disease progression Oct 2, 2020
- New nnetsauce Sep 25, 2020
- Technical documentation Sep 18, 2020
- A new version of nnetsauce, and a new Techtonique website Sep 11, 2020
- Back next week, and a few announcements Sep 4, 2020
- Explainable 'AI' using Gradient Boosted randomized networks Pt2 (the Lasso) Jul 31, 2020
- LSBoost: Explainable 'AI' using Gradient Boosted randomized networks (with examples in R and Python) Jul 24, 2020
- nnetsauce version 0.5.0, randomized neural networks on GPU Jul 17, 2020
- Maximizing your tip as a waiter (Part 2) Jul 10, 2020
- New version of mlsauce, with Gradient Boosted randomized networks and stump decision trees Jul 3, 2020
- Announcements Jun 26, 2020
- Parallel AdaOpt classification Jun 19, 2020
- Comments section and other news Jun 12, 2020
- Maximizing your tip as a waiter Jun 5, 2020
- AdaOpt classification on MNIST handwritten digits (without preprocessing) May 29, 2020
- AdaOpt (a probabilistic classifier based on a mix of multivariable optimization and nearest neighbors) for R May 22, 2020
- AdaOpt May 15, 2020
- Custom errors for cross-validation using crossval::crossval_ml May 8, 2020
- Documentation+Pypi for the `teller`, a model-agnostic tool for Machine Learning explainability May 1, 2020
- Encoding your categorical variables based on the response variable and correlations Apr 24, 2020
- Linear model, xgboost and randomForest cross-validation using crossval::crossval_ml Apr 17, 2020
- Grid search cross-validation using crossval Apr 10, 2020
- Documentation for the querier, a query language for Data Frames Apr 3, 2020
- Time series cross-validation using crossval Mar 27, 2020
- On model specification, identification, degrees of freedom and regularization Mar 20, 2020
- Import data into the querier (now on Pypi), a query language for Data Frames Mar 13, 2020
- R notebooks for nnetsauce Mar 6, 2020
- Version 0.4.0 of nnetsauce, with fruits and breast cancer classification Feb 28, 2020
- Create a specific feed in your Jekyll blog Feb 21, 2020
- Git/Github for contributing to package development Feb 14, 2020
- Feedback forms for contributing Feb 7, 2020
- nnetsauce for R Jan 31, 2020
- A new version of nnetsauce (v0.3.1) Jan 24, 2020
- ESGtoolkit, a tool for Monte Carlo simulation (v0.2.0) Jan 17, 2020
- Search bar, new year 2020 Jan 10, 2020
- 2019 Recap, the nnetsauce, the teller and the querier Dec 20, 2019
- Understanding model interactions with the `teller` Dec 13, 2019
- Using the `teller` on a classifier Dec 6, 2019
- Benchmarking the querier's verbs Nov 29, 2019
- Composing the querier's verbs for data wrangling Nov 22, 2019
- Comparing and explaining model predictions with the teller Nov 15, 2019
- Tests for the significance of marginal effects in the teller Nov 8, 2019
- Introducing the teller Nov 1, 2019
- Introducing the querier Oct 25, 2019
- Prediction intervals for nnetsauce models Oct 18, 2019
- Using R in Python for statistical learning/data science Oct 11, 2019
- Model calibration with `crossval` Oct 4, 2019
- Bagging in the nnetsauce Sep 25, 2019
- Adaboost learning with nnetsauce Sep 18, 2019
- Change in blog's presentation Sep 4, 2019
- nnetsauce on Pypi Jun 5, 2019
- More nnetsauce (examples of use) May 9, 2019
- nnetsauce Mar 13, 2019
- crossval Mar 13, 2019
- test Mar 10, 2019
Comments powered by Talkyard.