CastellanZhang / lambdaFM

Multi-thread implementation of lambdaFM with FTRL for ranking problem. LambdaFM is a learning-to-rank algorithm by combining LambdaRank and Factorization Machines.
MIT License
111 stars 31 forks source link

fm_sample.sh 读feature部分 #1

Open gucasbrg opened 7 years ago

gucasbrg commented 7 years ago
if(this->x.find(key) == this->x.end())
{
    this->x[key] = value;
}
else
{
    this->x[key] += value;
}

麻烦问一下,这段代码特征自加是个什么场景?

CastellanZhang commented 7 years ago

同一行样本出现了重复的特征名,我采取的做法是把特征值累加,当然也可以覆盖,或者直接报错。看项目需要。