Code Monkey home page Code Monkey logo

spykesml's Introduction

SpykesML

How to build encoding models with machine learning methods

This repository accompanies "Modern Machine Learning Far Outperforms GLMs at Predicting Spikes"[https://doi.org/10.1101/111450].

Here you can find a Python class MLencoding that you can use for quickly making encoding models. For a tutorial on how to use MLencoding, see the notebooks folder.

The notebooks folder also has a "standalone notebook" that demos how to use some ML methods without our fancy class.

Currently implemented methods:

  • GLM
  • 2-layer feedforward net
  • Random forest
  • xgboost
  • LSTM With
  • k-fold cross-validation
  • spike and covariate history options and more!

Installation

In a terminal:

git clone https://github.com/KordingLab/spykesML
cd spykesML
python setup.py install

Quick how-to:

Build the encoder:

model = MLencoding(tunemodel = 'xgboost')
print(model.params)

Fit and predict to some data:

model.fit(X_train, y_train)
Y_hat = model.predict(X_test)

Perform k-fold cross-validation:

model.fit_cv(X,y)

Use spike and covariate history as inputs:

xgb_history = MLencoding(tunemodel = 'xgboost',
                         cov_history = True, spike_history=True,
                         window = 50, #this dataset has 50ms time bins
                         n_filters = 4,
                         max_time = 250 ) #in ms
xgb_history.fit_cv(X,y, verbose = 2, continuous_folds = True)

See the tutorial for how to define parameters and build new encoding models.

Dependencies

Basics

  • numpy
  • pandas
  • scipy
  • matplotlib

Methods

  • sklearn
  • pyglmnet (glm)
  • xgboost
  • theano (NN)
  • keras (NN)

predictfirst

spykesml's People

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.