Code Monkey home page Code Monkey logo

firets's People

Contributors

danielkentwood avatar jxx123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

firets's Issues

Explanation of training model

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?

Combine fireTS library with neupy library for NARX network based on Levenberg Marquardt

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
26

ZeroDivisionError: division by zero

Any solution?

Online training narx

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.

Paper link is broken

Hi,
I want to access the paper mentioned on this repository, but it seems the link is broken.

Regards

correction to model.NARX.forecast method

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.

problem when fitting with LSTM

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

target variable is in design matrix?

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).

ModuleNotFoundError: No module named 'sklearn.metrics.regression'

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

Plotting predict results

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.