Ml4iiot
A framework to implement Machine Learning methods for time series data.
Install / Use
/learn @maechler/Ml4iiotREADME
Machine Learning 4 IIoT
This is the repository of ml4iiot a framework to implement Machine Learning methods for time series data.
Example: Autoencoder on FFT of IMS Bearing Data Set
This example shows an autoencoder being trained on the Fast Fourier transform
of the acceleration of bearing 1 of the IMS Bearing Data Set.
The configuration of this experiment can be found in config/ims_bearing_data_set_autoencoder.yaml.
The autoencoder learns (adjusts its weights) and predicts until the 2004-02-17 and after that does only predictions anymore (see do_fit).
The results show that the upcoming crash shows up in an increasing reconstruction error of the autoencoder.
- Run IMS Bearing Data Set Autoencoder example:
python ml4iiot/cli_runner.py -c config/ims_bearing_data_set_autoencoder.yaml - Plot acceleration of bearing 1:
python ml4iiot/plot_csv.py -p out/YYYY_MM_DD/ims_bearing_data_set/HH_MM_SS_csv_output.csv -itime acceleration_bearing_1 - Plot reconstruction error:
python ml4iiot/plot_csv.py -p out/YYYY_MM_DD/ims_bearing_data_set/HH_MM_SS_csv_output.csv -itime absolute_reconstruction_error_moving

Architecture
We abstract the entire process into a pipeline consisting of different processing steps. Each pipeline must have an input, an algorithm and an output step. Before and after the algorithm step there can be any number of pre- or post-processing steps.
A pipeline can configured using YAML or JSON files and can be started with the CLI runner.

The main abstraction between individual pipeline steps are pandas DataFrames. Each step can add additional columns to the dataframe but should not alter existing columns.

Development
Setup virtualenv
pip install virtualenv;
python -m virtualenv env;
source env/bin/activate;
Install dependencies
pip install -r requirements.txt;
pip install -e .;
Testing
Run unit tests with: python -m unittest discover tests/*
Leave virtualenv
deactivate
CLI runner
python ml4iiot/cli_runner.py -c config/your_config.yaml
Performance
Resample the training data in advance and use integer timestamps instead of formatted date strings to speed up trainings. Use the following commands to profile your code:
python -m cProfile -o out/cli_runner.profile ml4iiot/cli_runner.py -c config/your_config.yaml
snakeviz out/cli_runner.profile
Docker
version: '3'
services:
ml4iiot:
image: still/to/be/published
volumes:
- ./ml4iiot/config:/usr/src/ml4iiot/config
Pipeline configuration
A pipeline always consists of an input adapter, an output adapter as well as an algorithm in between.
pipeline:
input:
class: ml4iiot.input.csv.CsvInput
config:
windowing_strategy:
class: ml4iiot.input.windowing.CountBasedWindowingStrategy
config:
window_size: 100
stride_size: 100
batch_size: 20000
delimiter: ','
csv_file: /path/to/your/data.csv
index_column: time
columns:
time:
type: datetime
datetime_format: timestamp
sensor_value: float
algorithm:
class: ml4iiot.algorithm.stochastic.average.ExponentialWeightedMovingAverage
config:
column_mapping:
sensor_value: sensor_value_average
output:
class: ml4iiot.output.compound.CompoundOutput
config:
output_adapters:
- class: ml4iiot.output.std.StdOutput
config:
show_columns_progress:
- column: index
- column: sensor_value
- column: sensor_value_average
- class: ml4iiot.output.plot.PlotOutput
config:
show_plots: True
figures:
plots:
- column: sensor_value
color: blue
- column: sensor_value_average
color: red
Inputs
ml4iiot.input.csv.CsvInputml4iiot.input.kafka.KafkaInput
Windowing strategies
ml4iiot.input.windowing.TimeBasedWindowingStrategyml4iiot.input.windowing.CountBasedWindowingStrategy
Algorithms
ml4iiot.algorithm.stochastic.average.ExponentialWeightedMovingAverageml4iiot.algorithm.stochastic.average.ExponentialWeightedMovingMinMaxAverageml4iiot.algorithm.stochastic.mad.Madml4iiot.algorithm.stochastic.zscore.ModifiedZScoreml4iiot.algorithm.clustering.dbscan.DBSCANml4iiot.algorithm.autoencoder.fullyconnected.FullyConnectedAutoencoderml4iiot.algorithm.autoencoder.cnn.CNNAutoencoderml4iiot.algorithm.autoencoder.cnn.BottleneckCNNAutoencoderml4iiot.algorithm.autoencoder.lstm.ReconstructionLSTMAutoencoderml4iiot.algorithm.autoencoder.lstm.PredictionLSTMAutoencoderml4iiot.algorithm.autoencoder.variational.VariationalAutoencoder
Processing
ml4iiot.processing.normalization.MinMaxScalerml4iiot.processing.smoothing.MovingExponentialSmoothingml4iiot.processing.transform.Averageml4iiot.processing.transform.StandardDeviationml4iiot.processing.transform.Minimumml4iiot.processing.transform.Maximumml4iiot.processing.transform.FastFourierTransformml4iiot.processing.control.SkipDataFrame
Outputs
ml4iiot.output.compound.CompoundOutputml4iiot.output.std.StdOutputml4iiot.output.plot.PlotOutputml4iiot.output.csv.CsvOutputml4iiot.output.kafka.KafkaOutputml4iiot.output.config.ConfigOutput
Related Skills
TrendRadar
49.4k⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。
kubeshark
11.8kCluster-wide network observability for Kubernetes. Captures L4 packets, L7 API calls, and decrypted TLS traffic using eBPF, with full Kubernetes context. Available to AI agents via MCP and human operators via dashboard.
mcp-shrimp-task-manager
2.1kShrimp Task Manager is a task tool built for AI Agents, emphasizing chain-of-thought, reflection, and style consistency. It converts natural language into structured dev tasks with dependency tracking and iterative refinement, enabling agent-like developer behavior in reasoning AI systems.
Unla
2.1k🧩 MCP Gateway - A lightweight gateway service that instantly transforms existing MCP Servers and APIs into MCP servers with zero code changes. Features Docker deployment and management UI, requiring no infrastructure modifications.
