Giter VIP home page Giter VIP logo

Comments (10)

neuronalX avatar neuronalX commented on June 4, 2024

Hello @wilbertmatthew

Thank you for using reservoirpy.
Please make your question more explicit, you are asking several questions at the same time, and put link to the line code where you have an issue if you have one.
Thanks

from reservoirpy.

wilbertmatthew avatar wilbertmatthew commented on June 4, 2024

Thanks for your response.

Hope this clarifies my issue:

Issue 1: I train on 1-2000 values of the dataset and predict on 4000-4100 values of the dataset using code y_pred = model.fit(X, y).run(X_test). That works.

How would I run the app again, with same dataset or another dataset with a similar signal pattern, but only perform a prediction without training? That is can I save the model and prove that prediction is working on different datasets than the dataset used for training.

import matplotlib.pyplot as plt
import numpy as np
from reservoirpy.nodes import NVAR, Ridge
from reservoirpy.datasets import lorenz
from reservoirpy.datasets import mackey_glass
from reservoirpy.nodes import Input
import reservoirpy as rpy
rpy.verbosity(1)

nvar = NVAR(delay=2, order=2, strides=1)
readout = Ridge(1, ridge=2.5e-6)
model = nvar >> readout

tau = 17
data = mackey_glass(10000, tau=tau)
data = data.reshape(-1, 1)

VERBOSE = True

train_size = 2000
test_size = 2000
horizon = 1 # horizon p of the forecast (predict X[t+p] from X[t])

X = data[:train_size]
y = data[horizon : train_size + horizon]
X_test = data[train_size : train_size + test_size]
y_test = data[train_size + horizon : train_size + test_size + horizon]

normalize = True

if VERBOSE:
print("X, y dimensions", X.shape, y.shape)
print("X_test, y_test dimensions", X_test.shape, y_test.shape)

y_pred = model.fit(X, y).run(X_test)

plt.figure(figsize=(12, 4))
plt.plot(y_pred, color="red", lw=1.5, label="Predictions")
plt.plot(y_test, color="blue", lw=0.75, label="Ground truth")
plt.title("Output predictions against real timeseries")
plt.legend()
plt.show()

from reservoirpy.

neuronalX avatar neuronalX commented on June 4, 2024

How would I run the app again, with same dataset or another dataset with a similar signal pattern, but only perform a prediction without training?

since you already trained the model:

y_pred = model.fit(X, y).run(X_test)

you just need to do:
y_pred_newdata = model.run(X_test_newdata)

Does it answer your question?

from reservoirpy.

wilbertmatthew avatar wilbertmatthew commented on June 4, 2024

from reservoirpy.

wilbertmatthew avatar wilbertmatthew commented on June 4, 2024

from reservoirpy.

Mervira avatar Mervira commented on June 4, 2024

Bonjour,
Comment importer la série de Lorenz 3d pour faire une prédiction

from reservoirpy.

nTrouvain avatar nTrouvain commented on June 4, 2024

Hello @Mervira,

You can just import it from the datasets module, please refer to documentation for more information.

from reservoirpy.

Mervira avatar Mervira commented on June 4, 2024

from reservoirpy.

Mervira avatar Mervira commented on June 4, 2024

from reservoirpy.

nTrouvain avatar nTrouvain commented on June 4, 2024

Hello @Mervira,
Please open new issues when you have unrelated questions. I will try answer both here for now:

  1. Your first question is a matplotlib (or whatever plotting tool you use) problem. If you want 3 different plots, simply create 3 different figures, one with each variable of the dataset (x[:, 0], x[:, 1] and x[:, 2], x being your Lorenz series array)
  2. Your second question is raspberry problem. If your raspberry has an operating system with Python 3.8 or higher installed on it, then it should work. Raspberry are just tiny computers.

from reservoirpy.

Related Issues (20)

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.