Giter Site home page Giter Site logo

sintel-dev / draco Goto Github PK

View Code? Open in Web Editor NEW
52.0 52.0 17.0 15.31 MB

State space and deep generative models for time series.

Home Page: https://sintel-dev.github.io/Draco

License: MIT License

Makefile 1.83% Python 20.78% Jupyter Notebook 77.33% Dockerfile 0.06%
classification machine-learning time-series

draco's People

Contributors

csala avatar joanvaquer avatar kveerama avatar pvk-developer avatar sarahmish avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

draco's Issues

Provide documentation for creating custom featurisation functions

  • GreenGuard version: v0.2.0 - 2020-02-14
  • Python version: 3.7
  • Operating System: Windows

Description

Please provide documentation to explain to users how to write functions to create custom features. For example, a subject matter expert may anticipate that a particular feature will be a good predictor for a particular predictive task, and wants to be able to easily write a function to generate that feature and integrate it into a pipeline.

Wrong default datetime format

  • GreenGuard version: v0.2.0

Description

The default datetime format used by the CSVLoader has a typo and has been written as '%m/%d/%y %M:%H:%S' instead of '%m/%d/%y %H:%M:%S'.

Interim workaround

While this is not fixed, the right format can be passed to the CSVLoader using the datetime_fmt argument:

loader = CSVLoader(..., datetime_fmt='%m/%d/%y %H:%M:%S')

Move from `MLPrimitives` to `ml-stars`

Change the mlprimitives dependency to ml-stars, which is a slimmed down version of MLPrimitives.

Draco will mainly focus on time series modeling using deep learning models alone.

This change will have the following effects:

  • All dfs based pipelines will be deprecated.
  • all mlprimitives primitives will be switched with ml-stars

Files to be removed:

  • dfs_xgb pipelines
  • preprocessing pipelines
  • tutorials/pipelines/dfs_xgb_with_unstack_normalization.ipynb
  • tutorials/pipelines/dfs_xgb_with_double_normalization.ipynb

Upgrade BTB

We want to upgrade to the new version of BTB which implements BTBSession.
This change will improve the following aspects of the current pipeline:

  • Given a list of templates, find the best template and hyperparameter configuration.
  • Dynamically discard templates that are not valid for the given data.
  • Automatically use the best template and hyperparameters found as pipeline.
  • Be able to keep tuning more than one template.

Reorganize pipelines

Reorganize pipelines from types to be named pipelines.

Original organization

draco/pipelines
  ├── classes
      ├── normalize_dfs_xgb_classifier.json
      ├── unstack_dfs_xgb_classifier.json
      ├── unstack_double_lstm_timeseries_classifier.json
      ├── unstack_lstm_timeseries_classifier.json
      └── unstack_normalize_dfs_xgb_classifier.json
  ├── probability
      ├── normalize_dfs_xgb_classifier.json
      ├── unstack_dfs_xgb_classifier.json
      ├── unstack_double_lstm_timeseries_classifier.json
      ├── unstack_lstm_timeseries_classifier.json
      └── unstack_normalize_dfs_xgb_classifier.json
  ├── unstacked
      ├── unstacked_dfs_xgb_classifier.json
      ├── unstacked_double_lstm_timeseries_classifier.json
      ├── unstacked_lstm_timeseries_classifier.json
      └── unstacked_normalize_dfs_xgb_classifier.json

Proposed organization

draco/pipelines
  ├── dfs_xgb
      ├── dfs_xgb.json
      ├── dfs_xgb_with_unstack.json
      ├── dfs_xgb_with_double_normalization.json
      └── dfs_xgb_with_unstack_normalization.json
  ├── lstm
      ├── lstm.json
      └── lstm_with_unstack.json
  ├── double_lstm
      ├── double_lstm.json
      └── double_lstm_with_unstack.json

In addition, for each pipeline, create a documentation page describing the pipeline.

Select targets is too strict

  • GreenGuard version: 0.2.0

Description

The function greenguard.targets.select_valid_targets is using strict inequality operators,
which can make GreenGuard drop target_times that would actually have exactly the needed
data.

The strict inequality operators < should be changed to non strict ones <=.

Update Draco dependencies

Review draco dependencies and make adjustments for easier installation.

After upgrading mlprimitives there are packages that we can leave into default, including:

  • pandas
  • numpy

With respect to storage, we can convert cloudpickle to default python pickle.

Add new False Positive Rate metric

Add a metric that gives the false positive rate for a given/fixed true positive rate for failures. This provides us a single metric to track.

Pipeline failure after `mlprimitives` upgrade to `0.3.1`

After the new mlprimitives version release, our pipelines that use the keras adapters fails due to the new feature. the new feature in mlprimitives tries to infer the shape of the input and the shape of the output.

There is a subtle problem in the pipeline where y gets converted into an array of shape (.., ) and therefore we get the following error in the keras adapter.

  ERROR    mlblocks.mlpipeline:mlpipeline.py:662 Exception caught fitting MLBlock keras.Sequential.LSTMTimeSeriesClassifier#1
  Traceback (most recent call last):
    File "/home/runner/work/GreenGuard/GreenGuard/.tox/unit/lib/python3.6/site-packages/mlblocks/mlpipeline.py", line 644, in _fit_block
      block.fit(**fit_args)
    File "/home/runner/work/GreenGuard/GreenGuard/.tox/unit/lib/python3.6/site-packages/mlblocks/mlblock.py", line 311, in fit
      getattr(self.instance, self.fit_method)(**fit_kwargs)
    File "/home/runner/work/GreenGuard/GreenGuard/.tox/unit/lib/python3.6/site-packages/mlprimitives/adapters/keras.py", line 99, in fit
      self._augment_hyperparameters(y, 'target', kwargs)
    File "/home/runner/work/GreenGuard/GreenGuard/.tox/unit/lib/python3.6/site-packages/mlprimitives/adapters/keras.py", line 90, in _augment_hyperparameters
      length = shape[0]
  IndexError: tuple index out of range
  ERROR    greenguard.benchmark:benchmark.py:444 Could not score template probability.unstack_lstm_timeseries_classifier 
  Traceback (most recent call last):
    File "/home/runner/work/GreenGuard/GreenGuard/greenguard/benchmark.py", line 436, in evaluate_templates
      cache_path=cache_path
    File "/home/runner/work/GreenGuard/GreenGuard/greenguard/benchmark.py", line 179, in evaluate_template
      pipeline.fit(train, readings)
    File "/home/runner/work/GreenGuard/GreenGuard/greenguard/pipeline.py", line 561, in fit
      start_=start_, output_=output_, **kwargs)
    File "/home/runner/work/GreenGuard/GreenGuard/.tox/unit/lib/python3.6/site-packages/mlblocks/mlpipeline.py", line 802, in fit
      self._fit_block(block, block_name, context, debug_info)
    File "/home/runner/work/GreenGuard/GreenGuard/.tox/unit/lib/python3.6/site-packages/mlblocks/mlpipeline.py", line 644, in _fit_block
      block.fit(**fit_args)
    File "/home/runner/work/GreenGuard/GreenGuard/.tox/unit/lib/python3.6/site-packages/mlblocks/mlblock.py", line 311, in fit
      getattr(self.instance, self.fit_method)(**fit_kwargs)
    File "/home/runner/work/GreenGuard/GreenGuard/.tox/unit/lib/python3.6/site-packages/mlprimitives/adapters/keras.py", line 99, in fit
      self._augment_hyperparameters(y, 'target', kwargs)
    File "/home/runner/work/GreenGuard/GreenGuard/.tox/unit/lib/python3.6/site-packages/mlprimitives/adapters/keras.py", line 90, in _augment_hyperparameters
      length = shape[0]
  IndexError: tuple index out of range

resample by filename inside csvloader

  • GreenGuard version: 0.2.0

Description

Inside the CSVLoader, the resampling happens after the data from all the files has been loaded into memory and filtered by signal and timestamp.

As a consequence of this:

  1. All the data is accumulated in memory before its data size is reduced in the resampling step, unnecessarily limiting the amount of data that the can system can process.
  2. If the data is sparse (due to cutoff times not being close enough to each other), the resampling process will generate a lot data to fill the gaps, which later on will not be used at all by the pipelines.

What needs to be done:

The resampling process should happen inside the for filename in filenames loop, right after filtering by timestamp and signal_id.

Fix CSV filename format

  • GreenGuard version: 0.2.0v

Description

At this moment the current csv format is %Y-%M-.csv and should be %Y-%M.csv or : 2010-10-.csv -> 2010-10.csv

Todo

Change the code were this is being used and update the demo generated data to be using the new format.

Integrate with Codecov

  • Integrate with Codecov to make sure all the changes from PR improve the code coverage of tests.
  • Update the readme with the new badge.

Remove `dfs` based pipelines

Remove dfs based pipelines from the Draco repository.
Draco will be restricted to space state models and support deep learning based pipelines such as LSTM.

Expose partial outputs and executions in the GreenGuardPipeline

MLBlocks has a feature that allows running only a subset of the pipeline and capturing intermediate results.

Since GreenGuard wraps around the MLBlocks pipeline, this functionality is not fully exposed.

We should add arguments to expose it in the fit and predict methods.

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.