Files
MCM-ICM_Toolkit/src/mcm_toolkit/models/__init__.py
T
guzhujushi 5319589dfd chore: 初始化 MCM/ICM Toolkit 仓库骨架
审查并精简 ChatGPT 的建库建议后落地的第一版骨架,只定接口不写实现。

- 建议审查:14 个包 → 7 个;约 250 个函数 → 约 40 个;5 个 Result 类 → 1 个
  (docs/01-suggestion-review.md)
- docs/:架构、路线图(含永久不做清单)、环境、Git 工作流、函数卡片模板
- src/mcm_toolkit/:core / data / stats / models / solve / decision / viz
  共 23 个模块,均为签名 + docstring + NotImplementedError
- tests/:9 个文件,其中 test_api_surface.py 已通过(20 passed)
- examples/ problems/ notebooks/ figures/ tables/ 骨架
- pyproject.toml(核心依赖 4 个 + 6 组 extras)、environment.yml
- scripts/:setup-venv.ps1(ASCII + LF)、setup-conda.ps1、doctor.ps1
- 环境:.venv(system-site-packages)与 conda 环境 mcm-toolkit 均已建好,
  数值栈版本与 base 完全对齐(numpy 2.4.6 / scipy 1.18.1 / pandas 3.0.6,MKL 后端)
2026-10-01 17:43:48 +08:00

42 lines
978 B
Python

"""models —— 建模:回归 / 时间序列 / 机器学习(薄封装)。
原建议把 `regression/` 和 `ml/` 拆成两个包,但两边的
`fit_linear` 与 `fit_linear_regression` 明显重复。
这里合并为一个包,共享一套 `fit / predict / score` 协议和一份指标实现。
"""
from .metrics import (
adjusted_r2,
compare_models,
mae,
mape,
r2_score,
rmse,
smape,
)
from .ml import cross_validate, fit_forest, fit_logistic, kmeans, pca
from .regression import fit_linear, fit_nonlinear, fit_polynomial, predict
from .timeseries import exponential_smoothing, fit_arima, forecast
__all__ = [
"fit_linear",
"fit_polynomial",
"fit_nonlinear",
"predict",
"exponential_smoothing",
"fit_arima",
"forecast",
"fit_forest",
"fit_logistic",
"kmeans",
"pca",
"cross_validate",
"rmse",
"mae",
"mape",
"smape",
"r2_score",
"adjusted_r2",
"compare_models",
]