Coder Social home page Coder Social logo

niumeng07 / alphaplm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from castellanzhang/alphaplm

0.0 2.0 0.0 13 KB

Multi-thread implementation of Piece-wise Linear Model(PLM) or Mixture of LR(MLR) with FTRL for binary-class classification problem.

Makefile 0.91% C++ 99.09%

alphaplm's Introduction

alphaPLM

前言:

  • alphaPLM是Large Scale Piece-wise Linear Model(LS-PLM)的一个单机多线程版本实现,用于解决二分类问题,比如CTR预估,优化算法采用了FTRL。

  • LS-PLM据说是之前阿里广告主要的ctr预估模型,早期应该叫做MLR,具体算法原理见盖坤大神最近放出的论文: Learning Piece-wise Linear Models from Large Scale Data for Ad Click Prediction,代码实现所用优化方法见我的博客文章:http://castellanzhang.github.io/2017/06/01/mlr_plm/

  • 此代码基于之前的alphaFM修改实现,且正赶上alphaGo再次完虐人类,便仍然冠以alpha前缀。

  • 安装方法和使用方法跟alphaFM非常类似,不再详述。

模型文件格式(假定分片数为f):

第一行是bias的参数:
bias u1 u2 ... uf w1 w2 ... wf u_n1 u_n2 ... u_nf w_n1 w_n2 ... w_nf u_z1 u_z2 ... u_zf w_z1 w_z2 ... w_zf
其他行的格式为:
feature_name u1 u2 ... uf w1 w2 ... wf u_n1 u_n2 ... u_nf w_n1 w_n2 ... w_nf u_z1 u_z2 ... u_zf w_z1 w_z2 ... w_zf

预测结果格式:

label score
其中label为1或-1,score等于预测为正样本的概率值。

参数说明(可以直接执行./plm_train和./plm_predict查看参数列表):

plm_train的参数:

-m: 设置模型文件的输出路径。
-u_bias: 1或0表示u是否有偏置项。 default:1
-w_bias: 1或0表示w是否有偏置项。 default:1
-piece_num: 分片数。 default:4
-u_stdev: u的初始化使用均值为0的高斯分布,u_stdev为标准差。 default:0.1
-w_stdev: w的初始化使用均值为0的高斯分布,w_stdev为标准差。 default:0.1
-u_alpha: u的FTRL超参数alpha。 default:0.05
-u_beta: u的FTRL超参数beta。 default:1.0
-u_l1: u的L1正则。 default:0.1
-u_l2: u的L2正则。 default:5.0
-w_alpha: w的FTRL超参数alpha。 default:0.05
-w_beta: w的FTRL超参数beta。 default:1.0
-w_l1: w的L1正则。 default:0.1
-w_l2: w的L2正则。 default:5.0
-core: 计算线程数。 default:1
-im: 上次模型的路径,用于初始化模型参数。如果是第一次训练则不用设置此参数。

plm_predict的参数:

-m: 模型文件路径。
-piece_num: 分片数。 default:4
-core: 计算线程数。 default:1
-out: 输出文件路径。

alphaplm's People

Contributors

castellanzhang avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.