Files
playbook/skills/tsl-api-reference/references/codegen/module/recent-updates-32215.md
T

6.8 KiB

应用专题 / 数学算法

create(epsilon, tol, c, loss, fit_intercept, intercept_scaling, dual, verbose, random_state, max_iter)

声明:function

构造函数

参数 类型 说明
epsilon any 模型使用的 epsilon 参数
tol any 优化过程的停止容差
c any 模型或计算过程使用的约束参数
loss any 模型使用的损失函数
fit_intercept any 构造函数使用的 fit_intercept 输入值
intercept_scaling any 构造函数使用的 intercept_scaling 输入值
dual boolean 是否求解对偶优化问题
verbose boolean 是否输出详细运行信息
random_state any 随机数生成器的种子或状态
max_iter any 最大迭代次数

返回:any

create(nu, c, kernel, degree, gamma, coef_0, shrinking, tol, cache_size, verbose, max_iter)

声明:function

构造函数

参数 类型 说明
nu any 支持向量模型使用的 nu 参数
c any 模型或计算过程使用的约束参数
kernel any 支持向量模型使用的核函数
degree any 多项式核函数的次数
gamma any 核函数使用的 gamma 参数
coef_0 any 核函数使用的独立系数
shrinking boolean 是否使用 shrinking 启发式算法
tol any 优化过程的停止容差
cache_size any 核函数缓存大小
verbose boolean 是否输出详细运行信息
max_iter any 最大迭代次数

返回:any

create(kernel, degree, gamma, coef_0, tol, nu, shrinking, cache_size, verbose, max_iter)

声明:function

构造函数

参数 类型 说明
kernel any 支持向量模型使用的核函数
degree any 多项式核函数的次数
gamma any 核函数使用的 gamma 参数
coef_0 any 核函数使用的独立系数
tol any 优化过程的停止容差
nu any 支持向量模型使用的 nu 参数
shrinking boolean 是否使用 shrinking 启发式算法
cache_size any 核函数缓存大小
verbose boolean 是否输出详细运行信息
max_iter any 最大迭代次数

返回:any

create(kernel, degree, gamma, coef_0, tol, c, epsilon, shrinking, cache_size, verbose, max_iter)

声明:function

构造函数

参数 类型 说明
kernel any 支持向量模型使用的核函数
degree any 多项式核函数的次数
gamma any 核函数使用的 gamma 参数
coef_0 any 核函数使用的独立系数
tol any 优化过程的停止容差
c any 模型或计算过程使用的约束参数
epsilon any 模型使用的 epsilon 参数
shrinking boolean 是否使用 shrinking 启发式算法
cache_size any 核函数缓存大小
verbose boolean 是否输出详细运行信息
max_iter any 最大迭代次数

返回:any

decision_function(x)

声明:function

预测样本的置信度。样本的置信度得分与样本到超平面的符号距离成正比

参数 类型 说明
x array 数组,形状为(n_samples,n_features),要获取置信度分数的数据

返回:any

fit(x, y, sample_weight)

声明:function

根据给定的训练数据拟合 SVM 模型

参数 类型 说明
x array 数组,形状为 (n_samples, n_features) 或 (n_samples, n_samples),其中 n_samples 是样本数, n_features 是特征数。内核为'precomputed'时,X 的预期形状为 (n_samples, n_samples)
y any 模型训练目标或因变量数据
sample_weight any 各样本对应的权重

返回:any

fit_predict(x, y)

声明:function

对 X 进行拟合,并返回 X 的预测标签。对于离群值,返回 -1;对于正常值,返回 1

参数 类型 说明
x array 数组,形状为 (n_samples, n_features),其中 n_samples 是样本数,n_features 是特征数
y any 模型训练目标或因变量数据

返回:any

score(x)

声明:function

样本的原始决策函数值

参数 类型 说明
x array 数组,形状为(n_samples, n_features),测试样本

返回:any