jxx123 / firets Goto Github PK
View Code? Open in Web Editor NEWA python multi-variate time series prediction library working with sklearn
License: MIT License
A python multi-variate time series prediction library working with sklearn
License: MIT License
HI developer,
Thanks for developing this package.
May I ask how to read the training model details? For example, I use XGboost model as the estimator and put into the NARX model. After that I would like to use SHAP get the related explanations. Can I do like this?
BTW, I would like to confirm the meaning of exog_order, for example, exog_order = np.tile(10,6)). Does the 10 represent the the lag order of the exogenous variable and the 6 represent that "there are 6 exogenous variables", although there are 6 exogenous variables in the X_train?
getting following error
ValueError: The number of columns of X must be the same as the length of exog_order.
my X has 7 column and Y has one column. how I run this.
Hi.
I want to create a NARX (Nonlinear Autoregressive with exogenous variables) model based on LM (Levenberg Marquardt) method.
Since this two method are not implemented in keras, I search for the library fireTs (for NARX) and neupy (for LM).
I'm using the sample code for both libraries:
fireTS (NARX): fireTS
neupy (LM): Neupy
and I combine them:
from fireTS.models import NARX
from sklearn.ensemble import RandomForestRegressor
import numpy as np
from neupy import algorithms
from neupy.layers import *
x = np.array([[1, 2], [3, 4]])
y = np.array([[1], [0]])
#y = np.ravel(y) <-just to avoid a warning (the error is the same without comment)
network = Input(2) >> Sigmoid(3) >> Sigmoid(1)
optimizer = algorithms.LevenbergMarquardt(network)
mdl1 = NARX(
optimizer, #I change random forest for LevenbergMarquardt
auto_order=2,
exog_order=[2, 2],
exog_delay=[1, 1])
mdl1.fit(x, y)
ypred1 = mdl1.predict(x, y)
ypred1
But I'm having this error in .fit method:
ZeroDivisionError Traceback (most recent call last)
in ()
18 exog_delay=[1, 1])
19
---> 20 mdl1.fit(x, y)
21
22 ypred1 = mdl1.predict(x, y)/usr/local/lib/python3.7/dist-packages/neupy/utils/iters.py in
count_minibatches(inputs, batch_size)
22
23 def count_minibatches(inputs, batch_size):
---> 24 return int(math.ceil(count_samples(inputs) / batch_size))
25
26ZeroDivisionError: division by zero
Any solution?
Hi,
I am just wondering after playing around with the package using my own dataset. I split the data into training and the last 180 data as testing dataset. The fitted model gives good result compared to testing data but when applying predict procedure back to the training data the result is terrible. Is it normal? or am I doing a mistake?
Please advice,
Thank you
Hi, the package looks very fantastic to predict time series data. I was wondering if it is possible to implement it in an online training.
Hi Jinyu,
Regarding the update in OutputLagFeatureProcessor
, perhaps a little off-topic, but I wonder what would be more memory efficient other than deque
here?
Thanks!
Hi,
I want to access the paper mentioned on this repository, but it seems the link is broken.
Regards
Line 135 in the forecast method of models.py has this: deque(X[(-1 - d):(-1 - q):-1, i])
I believe the middle slice is missing a term; it should be deque(X[(-1 - d):(-1 - d - q):-1, i])
, otherwise if the exogenous regressor(s) are given a delay that is >= the exog_order, this will return an empty deque and the forecast method will fail.
when iam trying to fit LSTM in NARX architecture it showing error like 'lstm does not have set_parameters'
brother could you please add some example code to fit LSTM in your model
Thank you for sharing this code!
Apologies if I'm misunderstanding something, but in the "Basic usage" and "Grid Search" example notebooks, it appears that the CGM column has been defined as the target variable as well as one of the two features in the design matrix. This is true for both the training and test sets. Having CGM as a predictor for CGM will lead to very low error. :)
I would have fixed this myself, but in the "Basic Usage" notebook, the markdown says that the design matrix is supposed to be insulin and meal data as the exogenous inputs. It wasn't obvious which of the columns was supposed to be the meal data, and I couldn't get any clarity by looking at the code for simglucose (which looks awesome, btw).
In File "/root/miniconda3/envs/myconda/lib/python3.8/site-packages/fireTS/models.py", line 3.
from sklearn.metrics.regression import r2_score, mean_squared_error
It raised a moduleNotFoundError: No module named 'sklearn.metrics.regression'.
The enviroment is: Ubuntu18.04, python3.8.12, scikit-learn 1.0.2; numpy 1.19.5; scipy 1.8.0
Implement a forecast method that is doing the following:
Given X(0), ... , X(t) and Y(0), ..., Y(t), output the forecast values of Y as a vector Y_hat(t+1), Y_hat(t+2), ... ,Y_hat(t+k).
Hi Jinyu,
When we are plotting the prediction results when using DirectAutoRegressor, should we be only setting the first pred_step
elements to be np.nan?
EDIT: I meant to say should we be plotting the results starting from index pred_step
.
I was also wondering why you set the first pred_step + max(auto_order-1, max(exog_order+exog_delay)-1)
elements to be np.nan.
Thanks!
Daniel
Why the forecast method need the target value?
mdl1.predict(x, y, step=3)
I know that there is a way for training a MIMO system by training multiple MISO systems and get multiple models. But is there any way to get only a single model?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.