Git Product home page Git Product logo

pytorch-timeseries's Introduction

pytorch-timeseries

Time-series forecasting and prediction on tabular data using PyTorch and NVIDIA Jetson.

Starting the Container

$ git clone https://github.com/dusty-nv/pytorch-timeseries
$ cd pytorch-timeseries
$ docker/run.sh -c nvcr.io/nvidia/l4t-ml:rXX.X-py3  # select l4t-ml based on your JetPack-L4T version
$ cd pytorch-timeseries

When you do the docker/run.sh command, pick one of the l4t-ml container tags for the version of JetPack-L4T that you are running. For example, if you're on JetPack 4.6 / L4T R32.7, use nvcr.io/nvidia/l4t-ml:r32.7.1-py3

Weather Forecasting

In this hourly weather dataset, we are forecasting the future weather of a city based on it's past weather. The following data is provided on 1-hour intervals (over a timespan of 40,000 hours):

temperature
humidity
pressure
wind_direction
wind_speed

Let's start by forecasting just the temperature:

$ python3 train.py --data data/weather.csv --inputs temperature --outputs temperature --horizon 1

train RMSE: [1.7638184641368702]
train R2:   [0.9768890819461414]

val RMSE:   [1.788160646675811]
val R2:     [0.9815134518452414]

Weather Forecasting

Next we can incorporate multiple inputs/outputs and simultaneously predict the temperature, humidity, and barometric pressure:

$ python3 train.py --data data/weather.csv --inputs temperature,humidity,pressure --outputs temperature,humidity,pressure --horizon 1

train RMSE: [1.8732083404885846, 7.086468834684506, 12.398559674547002]
train R2:   [0.9735385787621987, 0.7405181652792221, 0.4753518787407489]

val RMSE:   [1.8272543024543522, 10.621018369410514, 3.4025864627892943]
val R2:     [0.9821397234156162, 0.5664843260674557, 0.8365918355499764]

Weather Forecasting

Solar Power Prediction

This dataset contains solar panel power generation data along with environmental conditions from a solar power plant. The goal is to predict generated power given sthe ambient temperature and amount of sunlight. In this example, we are predicting 2 outputs (AC and DC power)

$ python3 train.py --data data/solar_power.csv --inputs AMBIENT_TEMPERATURE,IRRADIATION --outputs DC_POWER,AC_POWER

train RMSE: [6912.877912624019, 660.7508599953275]
train R2:   [0.9940444439752174, 0.9942998898150646]

val RMSE:   [4932.04556598682, 482.82950183757634]
val R2:     [0.9963377448275983, 0.9963286618121212]

Solar Power Prediction

Space Shuttle Classification

This classification dataset from the UCI Machine Learning Repository contains the values from 9 sensors and has 7 state classes:

class distribution:
  [0] 'Rad Flow' - 45586 samples
  [1] 'Fpv Close' - 50 samples
  [2] 'Fpv Open' - 171 sampless
  [3] 'High' - 8903 samples
  [4] 'Bypass' - 3267 samples
  [5] 'Bpv Close' - 10 samples
  [6] 'Bpv Open' - 13 samples

total:  58000 samples

The goal is to predict the state of the system from the current sensor data. Given the unbalanced distribution of data between the classes, this example is akin to anomoly detection.

$ python3 train.py --data data/shuttle.csv --inputs 0,1,2,3,4,5,6,7,8 --outputs class --classification --epochs 100

train accuracy:  [0.9995689655172414]
train precision: [0.9995585721164452]
train recall:    [0.9995689655172414]
train F1:        [0.9995573360381868]

val accuracy:    [0.9987068965517242]
val precision:   [0.9987528787795457]
val recall:      [0.9987068965517242]
val F1:          [0.9986359711781727]

pytorch-timeseries's People

Contributors

dusty-nv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

aysemutlu

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.