Giter Club home page Giter Club logo

lsmrn's Introduction

Latent Space Model for Road Networks

Introduction

This is my implementation of the well known algorithm for traffic forecast; the Latent Space Model for Road Networks (LSMRN) using Matrix Profile algortihm in with stumpy in Python .

Some considerations

Here I try to adapt LSMRN to work with time series in general.

I assume the time series being a weighted (planar) path graph. Where the weights between two vertices is the time series value.

The idea is to use spatial information among the time series learned by another data-driven learning method as the Matrix Profile or other correlation methods to define some kind of distances between the nodes.

To achieve that I use first the original k-hop similarity matrix and the Matrix Profile algorithm.

Code structure

The code has five main parts structured as follow:

  1. Preprocess

    • load data
    • split in train and test
    • as negative values are not supported, we shift the train dataset.
    • split data in a list of snapshots, eg: [0:99], [100,199], ...
  2. Adjacency

    • generate adjacency matrices G_1, G_2, ... from the snapshots.
    • create corresponding Y_t indication matrices.
  3. Proximity matrix and some constants

    • compute matrix profile for each snapshot and combine them in one general proximity matrix.
    • normalize the proximity matrix.
  4. Global learning

    • U_t computation
    • B computation
    • A computation
  5. Forecasting

    • see output adjacency matrix as planar graph
    • some metrics
  6. plots

lsmrn's People

Contributors

molesox avatar

Watchers

James Cloos 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.