sklplus

表格上的 sklearn 风格再导出,加少量手拼 Pipeline 时用得到的补丁。

安装

pip install sklplus

克隆后可编辑安装(含测试工具):

pip install -e ".[dev]"

例子

import numpy as np

from sklplus.ensemble import RandomForestClassifier
from sklplus.pipeline import Pipeline
from sklplus.preprocessing import StandardScaler

rng = np.random.RandomState(0)
X = rng.randn(200, 8)
y = (X[:, 0] + 0.5 * X[:, 1] > 0).astype(int)
pipe = Pipeline(
    [
        ("scaler", StandardScaler()),
        ("clf", RandomForestClassifier(n_estimators=20, random_state=0)),
    ]
)
pipe.fit(X, y)
score = pipe.score(X, y)
print(f"classification accuracy: {score:.4f}")

表格分类、回归、聚类、异常。v0.1 不做时序 / NLP 专题。要 PyCaret 那种会话 API,请另找工具。

导入约定和自写变换见 Wiki。