公司动态
Time-Anchor ModernBERT 32M:重新定义时间序列预测的革命性模型
Time-Anchor ModernBERT 32M重新定义时间序列预测的革命性模型【免费下载链接】time-anchor-modernbert-32m项目地址: https://ai.gitcode.com/hf_mirrors/K-Iwa/time-anchor-modernbert-32mTime-Anchor ModernBERT 32M是一款基于32M参数ModernBERT骨干构建的紧凑型时间序列模型加上时间序列输入/输出头总共33.4M参数。一次调用即可返回三项核心功能分位数预测、变量/时间影响分析和锚定预测为时间序列预测领域带来了革命性的突破。 核心功能亮点 精准的分位数预测提供任意请求分位数水平的概率预测让你对未来数据的分布有清晰的认识。在东京每小时温度Open-Meteo档案64小时的预测中中位数MAE为0.57°C且每个实际值都在q10–q90范围内。 深入的变量/时间影响分析展示每个输入变量在每个时间步的标准化贡献帮助你理解各因素对预测结果的影响程度。通过对东京一周天气数据的分析可以清晰看到每个气象变量每小时的贡献情况且对于每个时间索引所有变量的影响总和为1。 灵活的锚定预测允许你根据指定的已知未来点进行条件预测。在月度航空乘客Box Jenkins24个月的预测中固定6个已知月份可将中位数预测MAE从46千乘客降至10千乘客极大提高了预测的准确性。 简单快速的安装步骤只需一行命令即可完成安装pip install time-anchorpredict_time_anchor接受Hugging Face Hub模型ID或本地 checkpoint 目录。 轻松上手的使用示例分位数预测示例import pandas as pd from time_anchor import predict_time_anchor url ( https://archive-api.open-meteo.com/v1/archive ?latitude35.69longitude139.69start_date2024-10-01end_date2024-12-31 hourlytemperature_2m,relative_humidity_2m,surface_pressure,wind_speed_10mformatcsv ) weather pd.read_csv(url, skiprows3) temperature weather.iloc[:, 1].astype(float32) result predict_time_anchor( K-Iwa/time-anchor-modernbert-32m, target_contexttemperature[:1440], prediction_length64, quantile_levels(0.1, 0.5, 0.9), ) print(pd.DataFrame(result.forecast_rows))变量/时间步影响示例result predict_time_anchor( K-Iwa/time-anchor-modernbert-32m, target_contexttemperature[:168], explanatory_contexts[weather.iloc[:168, i].astype(float32) for i in (2, 3, 4)], gaf{enabled: True, topk_time_steps: 0}, ) print(pd.DataFrame(result.variable_impact_rows))锚定预测示例url https://raw.githubusercontent.com/jbrownlee/Datasets/master/airline-passengers.csv passengers pd.read_csv(url)[Passengers].astype(float32) result predict_time_anchor( K-Iwa/time-anchor-modernbert-32m, target_contextpassengers[:-24], prediction_length24, anchor{ mode: observed, positions: [4, 8, 12, 16, 20, 24], values: [396, 559, 405, 461, 606, 432], }, ) print(pd.DataFrame(result.forecast_rows))️ 强大的命令行工具除了Python API还提供了便捷的命令行工具time-anchor-infer --checkpoint K-Iwa/time-anchor-modernbert-32m \ --input data.csv --target-column Target \ --exogenous-columns Feature1,Feature2,Feature3该命令会生成output/forecast.csv、output/variable_impact.csv和output/result.json文件。添加--no-impact可仅进行预测或使用--anchor-mode observed --anchor-positions 12,24 --anchor-values 0.2,0.4进行锚定预测。 模型详细信息项目详情骨干网络ModernBERT编码器10层隐藏层3846个头部参数数量总计33.4M 31.9M ModernBERT骨干名称中的32M 1.5M时间序列头float32safetensors最大上下文长度3,463步预测 horizon64步训练分位数0.1 – 0.9九个级别归因方法Generalized Attention Flow (GAF) 通过障碍法最大流锚定模式observed,auto,forward,inverted,sparse,hierarchical,hybrid 相关参考Ansari et al. Chronos: Learning the Language of Time Series. TMLR 2024 (OpenReview) — 为预测/ tokenization 设计提供参考。Azarkhalili and Libbrecht. Generalized Attention Flow: Feature Attribution for Transformer Models via Maximum Flow. 2025 — 变量/时间影响方法GAF。 许可证本项目采用 Apache-2.0 许可证。图表使用来自 Open-MeteoCC BY 4.0的历史天气数据和经典的航空乘客数据集Box Jenkins, 1976。要开始使用这个强大的时间序列预测模型请克隆仓库git clone https://gitcode.com/hf_mirrors/K-Iwa/time-anchor-modernbert-32m【免费下载链接】time-anchor-modernbert-32m项目地址: https://ai.gitcode.com/hf_mirrors/K-Iwa/time-anchor-modernbert-32m创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考