41 lines
978 B
Python
41 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",
|
||
|
|
]
|