Downsampling
Downsampling algorithms for time series data(LTOB, LTTB, LTD, OSI-PI Plot)
Install / Use
/learn @avina/DownsamplingREADME
关于本项目
时序数据降采样算法(LTOB, LTTB, LTD, OSI-PI Plot 等)的Java实现。<br/> README - English
算法
- LTOB: Largest-Triangel-One-Bucket
- LTTB: Largest-Triangel-Three-Bucket
- LTD: Largest-Triangel-Dynamic
- PIPLOT: OSI Soft PI 趋势图的降采样算法
- MAXMIN: 取最大、最小值的降采样算法
最大三角形系列算法的作者为Sveinn Steinarsson.<br/> LTD算法的实现与原版有区别: 动态桶大小迭代的次数为 datasize / threshold / 10 且上限500.
用法
使用 DSAlgorithms 类获得算法的实例。
实现降采样:
List<Event> rawData = getData(); // Read data.
DownSamplingAlgorithm algorithm = DSAlgorithms.LTTB // get a algorithm.
List<Event> downsampled = algorithm.process(rawData, threshold); // do downsampling
混合算法:
MixedAlgorithm mixed = new MixedAlgorithm();
mixed.add(DSAlgorithms.LTTB, 1); // add LTTB with threshold * 1
mixed.add(new TimeGapAlgorithm(), 0.1); // add TG with threshold * 0.1
List<Event> downsampled = mixed.process(rawData, threshold); // do downsampling
例子
运行test包下的 DownsampleTest类
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
