Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.
/ o3iss Public archive

Iterated-sums signature implemented in Rust

License

Notifications You must be signed in to change notification settings

ntapiam/o3iss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Iterated-sums signature in Rust Build

This is an implementation of the one-dimensional iterated-sums signature in Rust, with Python 3 bindings.

Installation

From PyPI

Normally, this package can be installed by running

pip3 install o3iss

From source

Curretly we provide wheels for Linux, macOS and 64-bit Windows. If your system is not included in any of these targets, you will have to compile the package yourself. This will require you to have a Rust compiler, which can be obtained from [https://www.rust-lang.org/tools/install].

Start by cloning this repository by running

git clone https://github.com/ntapiam/o3iss.git

Then, enter the directory and run

python3 setup.py install

This should compile and install the package on your system.

Usage

This implementation offers only a single function: iss.compute with signature (np.ndarray, int) -> np.ndarray where both the input and ouput arrays are one-dimensional.

In v0.1.2, we introduced partial support for the sklearn framework. Example (assuming that sktime is present):

from o3iss import IssClassifier
from sktime.datasets import load_gunpoint
from sktime.utils.data_processing import from_nested_to_2d_array


Xtrain, ytrain = load_gunpoint(split="train", return_X_y=True)
Xtest, ytest = load_gunpoint(split="test", return_X_y=True)
Xtrain, Xtest = (
    from_nested_to_2d_array(Xtrain).to_numpy(),
    from_nested_to_2d_array(Xtest).to_numpy(),
)
ytrain, ytest = ytrain.astype(int), ytest.astype(int)

clf = IssClassifier(level=3, n_jobs=7)
clf.fit(Xtrain, ytrain)
print(clf.score(Xtest, ytest))
>> 0.9133333333333333

TO DO

  • Multidimensional signature
  • Proper sklearn integration
  • Produce a proper Python 3 package

About

Iterated-sums signature implemented in Rust

Resources

License

Stars

Watchers

Forks

Packages

No packages published