Skip to main content

Primitives and Pipelines for Time Series Data.

Project description

DAI-Lab An Open Source Project from the Data to AI Lab, at MIT

Development Status PyPi Shield Tests Downloads Binder

ml-stars

Primitives for machine learning and time series.

Overview

This repository contains primitive annotations to be used by the MLBlocks library, as well as the necessary Python code to make some of them fully compatible with the MLBlocks API requirements.

There is also a collection of custom primitives contributed directly to this library, which either combine third party tools or implement new functionalities from scratch.

Installation

Requirements

ml-stars has been developed and tested on Python 3.8, 3.9, 3.10, 3.11, and 3.12

Also, although it is not strictly required, the usage of a virtualenv is highly recommended in order to avoid interfering with other software installed in the system where ml-stars is run.

Install with pip

The easiest and recommended way to install ml-stars is using pip:

pip install ml-stars

This will pull and install the latest stable release from PyPi.

If you want to install from source or contribute to the project please read the Contributing Guide.

Quickstart

This section is a short series of tutorials to help you getting started with ml-stars.

We will be executing a single primitive for data transformation.

1. Load a Primitive

The first step in order to run a primitive is to load it.

This will be done using the mlstars.load_primitive function, which will load the indicated primitive as an MLBlock Object from MLBlocks

In this case, we will load the sklearn.preprocessing.MinMaxScaler primitive.

from mlstars import load_primitive

primitive = load_primitive('sklearn.preprocessing.MinMaxScaler')

2. Load some data

The StandardScaler is a transformation primitive which scales your data into a given range.

To use this primtives, we generate a synthetic data with some numeric values.

import numpy as np

data = np.array([10, 1, 3, -1, 5, 6, 0, 4, 13, 4]).reshape(-1, 1)

The data is a list of integers where their original range is between [-1, 13].

3. Fit the primitive

In order to run our primitive, we first need to fit it.

This is the process where it analyzes the data to detect what is the original range of the data.

This is done by calling its fit method and passing the data as X.

primitive.fit(X=data)

4. Produce results

Once the pipeline is fit, we can process the data by calling the produce method of the primitive instance and passing agin the data as X.

transformed = primitive.produce(X=data)
transformed

After this is done, we can see how the transformed data contains the transformed values:

array([[0.78571429],
       [0.14285714],
       [0.28571429],
       [0.        ],
       [0.42857143],
       [0.5       ],
       [0.07142857],
       [0.35714286],
       [1.        ],
       [0.35714286]])

The data is now in [0, 1] range.

What's Next?

Documentation

History

0.2.0 – 2023-10-24

  • Upgrade python tests & remove python 3.7 Issue #11 - by @sarahmish
  • Add deprecation warning for old ARIMA primitive Issue #10 - by @sarahmish
  • Remove python 3.6 Issue #9 - by @sarahmish
  • Add support for python 3.10 & 3.11 Issue #8 - by @sarahmish

0.1.3 – 2023-09-25

  • Update keras adapter Issue #7 - by @sarahmish

0.1.2 – 2023-08-04

  • Add python 3.9 Issue #6 - by @sarahmish

0.1.1 - 2023-05-17

  • Fix ARIMA adapter Issue #5 - by @sarahmish
  • Add Documentation Issue #4 - by @sarahmish

0.1.0 - 2023-04-18

First official ml-stars release to PyPI: https://pypi.org/project/ml-stars/

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

ml_stars-0.2.1.dev0.tar.gz (91.4 kB view details)

Uploaded Source

Built Distribution

ml_stars-0.2.1.dev0-py2.py3-none-any.whl (62.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ml_stars-0.2.1.dev0.tar.gz.

File metadata

  • Download URL: ml_stars-0.2.1.dev0.tar.gz
  • Upload date:
  • Size: 91.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.11.2 readme-renderer/43.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.2.3 tqdm/4.67.0 importlib-metadata/4.13.0 keyring/25.5.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.12.7

File hashes

Hashes for ml_stars-0.2.1.dev0.tar.gz
Algorithm Hash digest
SHA256 d4e1fb7ef6fa9e98a0032c5c56b6a8d82d1ee310a5a2192b9927bfb21981086f
MD5 66b66c272951bdd6d562f6143a5da267
BLAKE2b-256 7e339bd66afff7b151e0d683ea00959858e420a97ebee3065ffdf0b4f25eac0b

See more details on using hashes here.

File details

Details for the file ml_stars-0.2.1.dev0-py2.py3-none-any.whl.

File metadata

  • Download URL: ml_stars-0.2.1.dev0-py2.py3-none-any.whl
  • Upload date:
  • Size: 62.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.11.2 readme-renderer/43.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.2.3 tqdm/4.67.0 importlib-metadata/4.13.0 keyring/25.5.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.12.7

File hashes

Hashes for ml_stars-0.2.1.dev0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 252813d2c70668bf187abb1fb02172f863e8c7e501a3274f2608befa9c9b8c63
MD5 59fd5af86bfbfcb814e04c11539ec8b2
BLAKE2b-256 c722c096b5f1cfe98444b411adccebb20db69bcbdb9185c4c22f15da4c7c56e0

See more details on using hashes here.

Supported by

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