Giter Site home page Giter Site logo

marija-iloska / jpls_python Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 413 KB

Transdimensional Predictive Least Squares for Online Feature Selection

Python 13.84% Jupyter Notebook 86.16%
feature-selection least-square-regression online-learning predictive-modeling

jpls_python's Introduction

Transdimensional Predictive Least Squares (TPLS)

Note: MATLAB implementation (including reproducible figures) at tpls_matlab.

This code is a Python implementation of the algorithm TPLS proposed in our paper "Transdimensional Model Learning with Online Feature Selection based on Predictive Least Squares". We provide an example code on how a user can run TPLS, as well as pre-coded feature bar plots. The code to reproduce the experiments presented in our paper is only available in MATLAB.

Introduction

TPLS is a distribution-free online feature selection algorithm that is completely based on least squares (LS). With new data arrivals, TPLS recursively updates the parameter estimate not only in value, but in dimension as well. What makes TPLS unique is the ability to recursively move up and down model dimension, and the fact that it uses the predictive (instead of the fitting) error as its criterium whether to add or remove features. Specifically, the foundations of TPLS are recursive LS (RLS), order recursive LS (ORLS) and predictive LS (PLS).

How to Use Code

How to run TPLS

Jupyter Notebook to run:
example_code.ipynb - a script that demonstrates how to call and run TPLS. It includes feature bar plots and predictive error. For the interested user, we demo how to compute the MSE regret analysis calculations and plots.

About the Code

LS_updates.py

A module which contains all LS related updates, including MSE and predictive error calculations.

Class RLS - updates the model recursively with new data point.
Attributes: ascend()

Class ORLS - updates the model recursively in dimension (up/down --> add/remove feature) based on user's choice.
Attributes: ascend(), descend()

Class PredError - computes the predictive error for the present model.
Attributes: compute()

Class Expectations - computes the MSE differnce between true model and neighbor model (up/down) for all given features. It can compute single time instant MSE and batch.
Attributes: model_up(), model_down(), batch()

algorithms.py

A module of two algorithms:
Class ModelJump - From the present model, loops over all features (add or remove) and computes the predictive error for each proposed model.
Attributes: up(), down(), stay()

Class TPLS - Implements the final JPLS algorithm for one time step, using ModelJump and all in LS_updates.py. Attributes: model_update(), time_update()

util.py

Helper functions for generating synthetic data, initialization, bar plotting, extracting feature indices, and finding min index.
Attributes: generate_data(), initialize(), bar_plot(), get_features(), get_min().

jpls_python's People

Contributors

marija-iloska avatar

Stargazers

 avatar

Watchers

 avatar

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.