Giter VIP home page Giter VIP logo

Comments (2)

nTrouvain avatar nTrouvain commented on May 24, 2024

Hello Peter !

For now, memmap are required to use the Ridge node, as it was designed to allow parallel computation of linear regression. This parallel computation relies on shared arrays between processes, and the only safe and easy way to do this is to use memory mapped objects. This behavior will probably change in the future, as memory mapped arrays are not well supported on all platforms.

Could you provide a more explicit example of what you are trying to do?

Also, thank you very much for your interest in ReservoirPy. As adding a scikit-learn adapter is part of the library future features plan, do not hesitate to ask for help, submit your code through a pull request and suggest any change in the current code. We would be really happy to count you among the contributors!

from reservoirpy.

renierts avatar renierts commented on May 24, 2024

Hi Nathan!

Thanks for your explanation. I already thought that this was the reason for using memory mapping.

In PyRCN, we use base objects (scikit-learn BaseEstimator etc.) to define our building blocks. The advantage is now that we can use e.g. RandomizedSearchCV for hyperparameter tuning.

A very simple example of what I want to do is the following code snippet (from RandomizedSearchCV):

from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import RandomizedSearchCV
from scipy.stats import uniform


iris = load_iris()
logistic = LogisticRegression(solver='saga', tol=1e-2, max_iter=200,
                              random_state=0)
distributions = dict(C=uniform(loc=0, scale=4),
                     penalty=['l2', 'l1'])
clf = RandomizedSearchCV(logistic, distributions, random_state=0)  # TODO: replace logistic by an ESN
search = clf.fit(iris.data, iris.target)
search.best_params_

Now, I need an adapter so that I can replace logistic by an ESN from reservoirpy. And this seems to work fine for everything but the memory mapping. The problem, is that RandomizedSearchCV copies the object to get optimized. I assume that now multiple instances are trying to access the memmapped files in the same time.

Do you have an offline regression node that allows to sequentially fit the linear regression? This would already solve my problem.

Regarding your future plan to add an adapter between reservoirpy and scikit-learn - I will definitely provide you the adapter as soon as it works.

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.