mahout分类源码分析

mahout分类源码分析
接口Interface OnlineLearner:
实现的类:
AbstractOnlineLogisticRegression, AdaptiveLogisticRegression, CrossFoldLearner, OnlineLogisticRegression
方法如下:
void train(int actual,
           Vector instance)
更新模型,实用一个目标变量的值和一个特征向量,主意这里假定:如果对训练数据进行多次,那么训练样本应该有相同的顺序。
参数说明:
actual:目标变量的值,这个值应该是一个半开区间[0....n)其中n是目标变来那个的类别。
instance:特征向量
void train(long trackingKey,
           java.lang.String groupKey,
           int actual,
           Vector instance)
更新模型,实用一个目标变量的值和一个特征向量
Parameters:
trackingKey - The tracking key for this training example.
groupKey - An optional value that allows examples to be grouped in the computation of the update to the model.
actual - The value of the target variable. This value should be in the half-open interval [0..n) where n is the number of target categories.
instance - The feature vector for this example.

void train(long trackingKey,
           int actual,
           Vector instance)
Updates the model using a particular target variable value and a feature vector.
Parameters:
trackingKey - The tracking key for this training example.
actual - The value of the target variable. This value should be in the half-open interval [0..n) where n is the number of target categories.
instance - The feature vector for this example.
void close()
为分类做准备,去掉任何临时数据结构,一个在线分类器应该能接受更多的训练在调用clouse(),但是关闭分类器或许使分类更有效。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值