Giter Site home page Giter Site logo

riscy / machine_learning_linear_models Goto Github PK

View Code? Open in Web Editor NEW
17.0 5.0 2.0 36 KB

A demo showcasing linear regression, reduced-rank regression and a linear system identification algorithm for modelling time series -- and when to apply them.

License: MIT License

Python 100.00%
machine-learning linear-model

machine_learning_linear_models's Introduction

Machine Learning with Linear Models - a demo

Python 2.7 and 3+ compatible.

img/example_results.png

Table of Contents

Description

This small demo showcases a few simple but different linear models for mapping vectors of observations X to vectors of outcomes Y. Different assumptions about the data can lead to different levels of performance due to bias error – sometimes drastically.

For instance, when the mapping from X to Y is low rank (i.e., an information ‘bottleneck’), a technique called reduced rank regression (reduced_rank_regressor.py) can outperform standard multivariate linear regression (multivariate_regressor.py). When the mapping from X to Y is time dependent and based on an underlying linear dynamical system, applying a system identification technique (system_identifier.py) can result in big gains over both.

My Ph.D. supervisor Dr. Michael Bowling introduced me to RRR; Dr. Tijl De Bie gave a great talk on subspace system identification in 2005 that I modeled my implementation on: http://videolectures.net/slsfs05_bie_slasi/

Usage

Run the demo with:

python demo.py

You should see some output resembling the following:

Full rank data
  Multivariate Linear Regression
    Training error: 15.04019
    Testing error: 15.2303               <- best!
  Reduced Rank Regressor (rank = 10)
    Training error: 26.93426
    Testing error: 27.08937
  Linear Dynamical System
    Training error: 15.1246
    Testing error: 15.42221
Low rank data
  Multivariate Linear Regression
    Training error: 14.92995
    Testing error: 14.98602
  Reduced Rank Regressor (rank = 10)
    Training error: 14.95641
    Testing error: 14.96577              <- best!
  Linear Dynamical System
    Training error: 15.13557
    Testing error: 15.27782
Linear system data
  Multivariate Linear Regression
    Training error: 109.64736
    Testing error: 114.02463
  Reduced Rank Regressor (rank = 10)
    Training error: 124.58642
    Testing error: 128.55485
  Linear Dynamical System
    Training error: 28.49161
    Testing error: 29.33846              <- best!

machine_learning_linear_models's People

Contributors

riscy avatar

Stargazers

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

Watchers

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