Giter Site home page Giter Site logo

angus924 / hydra Goto Github PK

View Code? Open in Web Editor NEW
44.0 2.0 5.0 701 KB

HYDRA: Competing convolutional kernels for fast and accurate time series classification

License: GNU General Public License v3.0

Python 100.00%
scalable time-series-classification dictionary convolution rocket

hydra's Introduction

ROCKET · MINIROCKET · HYDRA

HYDRA

HYDRA: Competing convolutional kernels for fast and accurate time series classification

arXiv:2203.13652 (preprint)

We demonstrate a simple connection between dictionary methods for time series classification, which involve extracting and counting symbolic patterns in time series, and methods based on transforming input time series using convolutional kernels, namely ROCKET and its variants. We show that by adjusting a single hyperparameter it is possible to move by degrees between models resembling dictionary methods and models resembling ROCKET. We present HYDRA, a simple, fast, and accurate dictionary method for time series classification using competing convolutional kernels, combining key aspects of both ROCKET and conventional dictionary methods. HYDRA is faster and more accurate than the most accurate existing dictionary methods, and can be combined with ROCKET and its variants to further improve the accuracy of these methods.

Please cite as:

@article{dempster_etal_2022,
  author  = {Dempster, Angus and Schmidt, Daniel F and Webb, Geoffrey I},
  title   = {{HYDRA}: Competing convolutional kernels for fast and accurate time series classification},
  year    = {2022},
  journal = {arXiv:2203.13652}
}

Results

UCR Archive (112 Datasets, 30 Resamples)

Requirements

  • Python
  • PyTorch
  • NumPy
  • scikit-learn (or similar)

Code

experimental
* Hydra + SGD for larger datasets (i.e., more than approx. 10,000 training examples)

Examples

from hydra import Hydra, SparseScaler
from sklearn.linear_model import RidgeClassifierCV

[...] # load data (torch.FloatTensor, shape = (num_examples, 1, length))

transform = Hydra(X_training.shape[-1])

X_training_transform = transform(X_training)
X_test_transform = transform(X_test)

scaler = SparseScaler()

X_training_transform = scaler.fit_transform(X_training_transform)
X_test_transform = scaler.transform(X_test_transform)

classifier = RidgeClassifierCV(alphas = np.logspace(-3, 3, 10))
classifier.fit(X_training_transform, Y_training)

predictions = classifier.predict(X_test_transform)

Acknowledgements

We thank Professor Eamonn Keogh and all the people who have contributed to the UCR time series classification archive. Figures in our paper showing mean ranks were produced using code from Ismail Fawaz et al. (2019).

🐲

hydra's People

Contributors

angus924 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

Watchers

 avatar  avatar

hydra's Issues

Add an example

Could you please upload an example using a multi-channel database?I'm a beginner. I want to repeat the program.

how to use minirocket_multi and HydraMultivariate together?

so (sample, feature, length) gets transformed into (sample, features) by both mini rocket multi and hydra multi, so should I just transform the data separately and combine them (sample, rocket feature + hydra feature)? or is any alternative way present?

Why use simple linear classifiers?

Thank you for your great works (i.e., rocket, minirocket, multirocket and hydra), which are really insightful and valuable!

I am curious why you use simple linear classifiers in all your works. I guess there may be two reasons. First, the feature dimension is large, so it is better to select simple classifiers with fewer parameters. Second, simple linear classifiers really work fine and achieve the SOTA on the UCR archive. Are there any other reasons?

Since the random convolution kernel transform is highly integrated and independent of subsequent classifications, I wonder if it is feasible to make some efforts on the classifiers.

Thank you for your time!

Why use .clamp(0).sqrt() on transformed input?

Hi,

I've been reading your paper and looking through the code, but I have difficulty understanding why you use .clamp(0).sqrt() on the transformed input data. See, e.g., line 94 in softmax.py:

94 X_training_transform = transform.batch(X_training).clamp(0).sqrt()

Have I missed something in the paper or somewhere else?

Thank you in advance for any help you can provide!

Best regards, Kristian

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.