aimclub / Fedot.Industrial

Python framework for automated time series classification, regression and forecasting
https://fedotindustrial.readthedocs.io
BSD 3-Clause "New" or "Revised" License
76 stars 7 forks source link
anomaly-detection automl evolutionary-algorithms feature-extraction fedot machine-learning time-series-classification

.. image:: /docs/img/fedot-industrial.png :width: 600px :align: center :alt: Fedot Industrial logo

================================================================================

.. start-badges .. list-table:: :stub-columns: 1

.. |version| image:: https://badge.fury.io/py/fedot-ind.svg :target: https://badge.fury.io/py/fedot-ind :alt: PyPi version

.. |python| image:: https://img.shields.io/pypi/pyversions/fedot_ind.svg :alt: Supported Python Versions :target: https://img.shields.io/pypi/pyversions/fedot_ind

.. |build| image:: https://badgen.net/#badge/build/error/red?icon=pypi :alt: Build Status

.. |integration| image:: https://github.com/aimclub/Fedot.Industrial/actions/workflows/integration_tests.yml/badge.svg?branch=main :alt: Integration Tests Status :target: https://github.com/aimclub/Fedot.Industrial/actions/workflows/integration_tests.yml

.. |coverage| image:: https://codecov.io/gh/aimclub/Fedot.Industrial/branch/main/graph/badge.svg :target: https://codecov.io/gh/aimclub/Fedot.Industrial/

.. |mirror| image:: https://img.shields.io/badge/mirror-GitLab-orange :alt: GitLab mirror for this repository :target: https://gitlab.actcognitive.org/itmo-nss-team/Fedot.Industrial

.. |docs| image:: https://readthedocs.org/projects/ebonite/badge/ :target: https://fedotindustrial.readthedocs.io/en/latest/ :alt: Documentation Status

.. |binder| image:: https://mybinder.org/badge_logo.svg :target: https://mybinder.org/v2/gh/aimclub/Fedot.Industrial/HEAD

.. |downloads| image:: https://static.pepy.tech/personalized-badge/fedot-ind?period=total&units=international_system&left_color=black&right_color=blue&left_text=Downloads :target: https://pepy.tech/project/fedot-ind :alt: Downloads

.. |support| image:: https://img.shields.io/badge/Telegram-Group-blue.svg :target: https://t.me/FEDOT_helpdesk :alt: Support

.. |rus| image:: https://img.shields.io/badge/lang-ru-yellow.svg :target: /README.rst

.. |eng| image:: https://img.shields.io/badge/lang-eng-green.svg :target: /README_en.rst

.. |itmo| image:: https://github.com/aimclub/open-source-ops/blob/master/badges/ITMO_badge_flat.svg :alt: Acknowledgement to ITMO :target: https://en.itmo.ru/en/

.. |sai| image:: https://github.com/ITMO-NSS-team/open-source-ops/blob/master/badges/SAI_badge_flat.svg :alt: Acknowledgement to SAI :target: https://sai.itmo.ru/

Fedot.Ind is a automated machine learning framework designed to solve industrial problems related to time series forecasting, classification, and regression. It is based on the AutoML framework FEDOT_ and utilizes its functionality to build and tune pipelines.

Installation

Fedot.Ind is available on PyPI and can be installed via pip:

.. code-block:: bash

pip install fedot_ind

To install the latest version from the main branch_:

.. code-block:: bash

git clone https://github.com/aimclub/Fedot.Industrial.git
cd FEDOT.Industrial
poetry install

How to Use

Fedot.Ind provides a high-level API that allows you to use its capabilities in a simple way. The API can be used for classification, regression, and time series forecasting problems, as well as for anomaly detection.

To use the API, follow these steps:

  1. Import FedotIndustrial class

.. code-block:: python

from fedot_ind.api.main import FedotIndustrial

  1. Initialize the FedotIndustrial object and define the type of modeling task. It provides a fit/predict interface:

NumPy arrays or Pandas DataFrames can be used as sources of input data. In the case below, x_train / x_test, y_train / y_test are pandas.DataFrame() and numpy.ndarray respectively:

.. code-block:: python

dataset_name = 'Epilepsy'
industrial = FedotIndustrial(problem='classification',
                             metric='f1',
                             timeout=5,
                             n_jobs=2,
                             logging_level=20)

train_data, test_data = DataLoader(dataset_name=dataset_name).load_data()

model = industrial.fit(train_data)

labels = industrial.predict(test_data)
probs = industrial.predict_proba(test_data)
metrics = industrial.get_metrics(target=test_data[1],
                                 rounding_order=3,
                                 metric_names=['f1', 'accuracy', 'precision', 'roc_auc'])

More information about the API is available in the documentation <https://fedotindustrial.readthedocs.io/en/latest/API/index.html>__ section.

Documentation and examples

The comprehensive documentation is available on readthedocs_.

Useful tutorials and examples can be found in the examples_ folder.

.. list-table:: :widths: 100 70 :header-rows: 1

Benchmarking

Univariate time series classification

Benchmarking was performed on the collection of 112 out of 144 datasets from the UCR archive_.

.. list-table:: :widths: 100 30 30 30 30

Multivariate time series classification

Benchmarking was performed on the following datasets: BasicMotions, Cricket, LSST, FingerMovements, HandMovementDirection, NATOPS, PenDigits, RacketSports, Heartbeat, AtrialFibrillation, SelfRegulationSCP2

.. list-table:: :widths: 100 30

Time series regression

Benchmarking was performed on the following datasets: HouseholdPowerConsumption1, AppliancesEnergy, HouseholdPowerConsumption2, IEEEPPG, FloodModeling1, BeijingPM25Quality, BenzeneConcentration, FloodModeling3, BeijingPM10Quality, FloodModeling2, AustraliaRainfall

.. list-table:: :widths: 100 30

Real world cases

Building energy consumption

Link to the dataset on Kaggle <https://www.kaggle.com/competitions/ashrae-energy-prediction>_

Full notebook with solution is here <https://github.com/ITMO-NSS-team/Fedot.Industrial/blob/14bdb2f488c1246376fa138f5a2210795fcc16aa/cases/industrial_examples/energy_monitoring/building_energy_consumption.ipynb>_

The challenge is to develop accurate counterfactual models that estimate energy consumption savings post-retrofit. Leveraging a dataset comprising three years of hourly meter readings from over a thousand buildings, the goal is to predict energy consumption (in kWh). Key predictors include air temperature, dew temperature, wind direction, and wind speed.

.. image:: /docs/img/building-target.png :align: center :alt: building target

.. image:: /docs/img/building_energy.png :align: center :alt: building results

Results:

.. list-table:: :widths: 100 60 :header-rows: 1

Permanent magnet synchronous motor (PMSM) rotor temperature

Link to the dataset on Kaggle <https://www.kaggle.com/datasets/wkirgsn/electric-motor-temperature>_

Full notebook with solution is here <https://github.com/ITMO-NSS-team/Fedot.Industrial/blob/d3d5a4ddc2f4861622b6329261fc7b87396e0a6d/cases/industrial_examples/equipment_monitoring/motor_temperature.ipynb>_

This dataset focuses on predicting the maximum recorded rotor temperature of a permanent magnet synchronous motor (PMSM) during 30-second intervals. The data, sampled at 2 Hz, includes sensor readings such as ambient temperature, coolant temperatures, d and q components of voltage, and current. These readings are aggregated into 6-dimensional time series of length 60, representing 30 seconds.

The challenge is to develop a predictive model using the provided predictors to accurately estimate the maximum rotor temperature, crucial for monitoring the motor's performance and ensuring optimal operating conditions.

.. image:: /docs/img/rotor-temp.png :align: center :alt: rotor temp

.. image:: /docs/img/motor-temperature.png :align: center :alt: solution

Results:

.. list-table:: :widths: 100 70 :header-rows: 1

================================================================================

R&D plans

– Expansion of anomaly detection model list.

– Development of new time series forecasting models.

– Implementation of explainability module (Issue <https://github.com/aimclub/Fedot.Industrial/issues/93>_)

Citation

Here we will provide a list of citations for the project as soon as the articles are published.

.. code-block:: bibtex

@article{REVIN2023110483,
title = {Automated machine learning approach for time series classification pipelines using evolutionary optimisation},
journal = {Knowledge-Based Systems},
pages = {110483},
year = {2023},
issn = {0950-7051},
doi = {https://doi.org/10.1016/j.knosys.2023.110483},
url = {https://www.sciencedirect.com/science/article/pii/S0950705123002332},
author = {Ilia Revin and Vadim A. Potemkin and Nikita R. Balabanov and Nikolay O. Nikitin
}

.. _AutoML framework FEDOT: https://github.com/aimclub/FEDOT .. _UCR archive: https://www.cs.ucr.edu/~eamonn/time_series_data/ .. _main branch: https://github.com/aimclub/Fedot.Industrial .. _readthedocs: https://fedotindustrial.readthedocs.io/en/latest/ .. _examples: https://github.com/aimclub/Fedot.Industrial/tree/main/examples