Skip to main content

No project description provided

Project description

MultiInputTimeSeriesGenerator

Build Status

Multi Input Timeseries Generator: It works Incase We have multi input, The keras timeseries generator only works for only single input. Keras timeseries generator can only generate sequences for single input.

In this Library we have added functionality of multi input by modifying keras source code to work it for multi input.

  • ✨Multi Input Time Series Generator✨

Problem

This was the problem keras wasn't able to handle

image

This is what we want as multi input timeseries generator

image

We have given solution to this , We can make generator for equal instances.

Example working

gen=MultiInputTimeseriesGenerator(df[["ID","f2","f3"]].values,df[["output"]].values,length=2,batch_size=10,ptotal=3,same=0)
ID f2 f3 output
1 2 3 1
1 2 5 2
1 2 3 5
2 9 7 3
2 8 3 4
2 78 24 5

Sequences Generated are : input:

ID f2 f3
1 2 3
1 2 5
output: 5

input:

ID f2 f3
2 9 7
2 8 3
output: 5
gen=MultiInputTimeseriesGenerator(df[["ID","f2","f3"]].values,df[["output"]].values,length=2,batch_size=10,ptotal=3,same=1)

Sequences Generated are : input:

ID f2 f3
1 2 3
1 2 5
output: 2
ID f2 f3
1 2 5
1 2 3
output: 5

input:

ID f2 f3
2 9 7
2 8 3
output: 4

input:

ID f2 f3
2 8 3
2 78 24
output: 5

Parameters

Parameters required to Pass

Parameter To be passed Format
data Independent Vairables (Input) Numpy Array
targets Dependent Vairable (Output) Numpy Array
length Sequence Length or Window Length a number
ptotal Total number of equal instances a number
same Same row output(1) or next row output(0) 0 or 1

Calling

from MultiInputTimeseriesGenerator import MultiInputTimeseriesGenerator

gen=MultiInputTimeseriesGenerator(input,output,length=36,batch_size=1024,ptotal=36,same=0) # training generator
t_gen=MultiInputTimeseriesGenerator(input,output,length=36,batch_size=1024,ptotal=36,same=0) # testing generator

Passing to Model

history=model.fit_generator(gen,validation_data=t_gen,epochs =8 ,use_multiprocessing=False)

Can also do

gen[0]#independent vairable
gen[1]#dependent Vairable
gen[0][0]#single instance gen input
gen[0][1]#single instance gen output
gen[0][0][0] #single row
gen[0][0][0][0]#single value
1 can be used inplace of 0 to get output

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MultiInputTimeseriesGenerator-0.0.7.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

MultiInputTimeseriesGenerator-0.0.7-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file MultiInputTimeseriesGenerator-0.0.7.tar.gz.

File metadata

  • Download URL: MultiInputTimeseriesGenerator-0.0.7.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.11

File hashes

Hashes for MultiInputTimeseriesGenerator-0.0.7.tar.gz
Algorithm Hash digest
SHA256 58cd6a0cdfb8f70dcb084d10671cdb7b08f2dbcb71ec393dbbc56cc4761fd158
MD5 05be68fb8dd6eeb036f758e5b0f57361
BLAKE2b-256 459b6be1d9f1569fe11e0e8f3b5aeb2caef9c17c5831a110d40513765130130b

See more details on using hashes here.

File details

Details for the file MultiInputTimeseriesGenerator-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: MultiInputTimeseriesGenerator-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.11

File hashes

Hashes for MultiInputTimeseriesGenerator-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ac04e10c9029612445d5639503fd8805086fbf7467413b94283e6e4cceb5403e
MD5 26fc1e6328b444a66a35a729e2716f01
BLAKE2b-256 97dc63e16a7d17008ddc59ae63173cfb565269ac4f16d9dd6d952411fbe66401

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page