2026a

# resume


修改训练轮次

函数库: TyMachineLearning

# 语法

mdl = resume(clf, X, y, n_estimators)

# 说明

mdl = resume(clfXyn_estimators) 返回基于输入数据 X, y,新的轮次n_estimators和弱模型基数 clf 的模型。

# 示例

修改训练轮次

加载iris数据集。

using TyMachineLearning
X, y = ty_make_classification()
X_train, X_test, y_train, y_test = ty_train_test_split(X, y)

使用整个数据集修改训练轮次。

clf_clas = GradientcBoosting(X_train, y_train)
clf_add = resume(clf_clas, X_test, y_test, 200)
sc = clf_add.score(X_test, y_test)
0.9925

# 输入参数

X - 预测数据
Matrix

预测数据,指定为Matrix。X 的每一行对应一个观测值,每一列对应一个预测变量。

数据类型: Matrix

y- 标签
向量

对观测值的标签。

数据类型: Vector

n_estimators- 增加轮次数
数值

增加模型训练次数

数据类型: Int

clf- 基础模型
对象

未修改的预训练模型

数据类型: 对象

# 输出参数

Mdl - 输出值
加训练的模型对象

经过增加训练的模型对象返回。