【模式识别】Learning To Rank之RankBoost
RankBoost的思想比較简单,是二元Learning to rank的常规思路:通过构造目标分类器,使得pair之间的对象存在相对大小关系。通俗点说,把对象组成一对对的pair,比方一组排序r1>r2>r3>r4,那能够构成pair:(r1,r2)(r1,r3),(r1,r4),(r2,r3)(r3,r4),这种pair是正值,也就是label是1。而余下的pair如(r2,r1)的值应该是-1或0。这样一个排序问题就被巧妙的转换为了分类问题。近来CV界许多又用这种learning to rank的思想做识别问题(最早应该是这篇《Person Re-Identification by Support Vector Ranking》),也就是把识别转换为排序问题再转换为分类问题。
Pairwise的排序方法主要用RankSVM和RankBoost,这里主要说RankBoost,总体还是一个Boost的框架:
注意其与常规Boost的不同组要是Update的时候。当然数据分布也不同。这里能够看出对于终于的排序值。也就是ranking score。其值是没有实际意义的,相对的顺序才有意义。比方r1和r2终于得分是10分和1分。与r1,r2终于得分是100分和1分的信息量区别并不大,我们能得到的结论都是r1应该排在r2前面。
因为和传统的Boost目标不一样。求解也须要很巧妙的方法,主要在于定义分类器的Loss函数:
详细的,因为以及
我们能够得到分布D的损失:
于是,目标就变成了最小化
至此,传统的Boost线性搜索策略已经能够求解,但还有更巧妙的办法。因为函数:
于是,对于所以[-1 1]范围内的x。Z能够近似为:
当中。这样直接能够Z最小时
。此时。
于是被转换为最大化|r|的问题。
下面是一段RankBoost的代码:
function [ rbf ] = RankBoost( X,Y,D,T )
%RankBoost implemetation of RankBoost algoritm
% Input:
% X - train set.
% Y - train labels.
% D - distribution function over X times X, it the form of 2D matrix.
% T - number of iteration of the boosting.
% Output:
% rbf - Ranking Function. rbf = RankBoostFunc(T);
% w - the current distribution in any iteration, initilize to D
w = D;
for t=1:T
tic;
fprintf('RankBoost: creating the function, iteration %d out of %d\n',t,T);
WL = getBestWeakLearner(X,Y,w);
rbf.addWeakLearner(WL,t);
rbf.addAlpha(WL.alpha,t);
alpha=WL.alpha; %update the distribution
%eval the weak learnler on the set of X and Y
h=WL.eval(X);
[hlen, ~] = size(h);
tmph = (repmat(h,1,hlen) - repmat(h',hlen,1));
w=w.*exp(tmph.*alpha);
%normalize w
w = w./sum(w(:));
toc;
end
end
一个比較明显的问题是RankBoost须要维持一个很大的|X|*|X|的矩阵。程序执行十分占内存,常常
抛出“Out of memory”的错误。
所以诸如
tmph = (repmat(h,1,hlen) - repmat(h',hlen,1));
之类的操作不如换成例如以下方式:
% tmph = (repmat(h,1,hlen) - repmat(h',hlen,1));
%w=w.*exp(tmph.*alpha);
[rows, cols] = size(w);
sumw = 0;
for r=1:rows
for c=1:cols
w(r,c) = w(r,c)*exp((h(r)-h(c))*alpha);
sumw = sumw + w(r,c);
end
end %normalize w
%w = w./sum(w(:));
w = w./sumw;
(转载请注明作者和出处:http://blog.csdn.net/xiaowei_cqu 未经同意请勿用于商业用途)
【模式识别】Learning To Rank之RankBoost的更多相关文章
- Learning to rank 介绍
PS:文章主要转载自CSDN大神hguisu的文章"机器学习排序": http://blog.csdn.net/hguisu/article/details/79 ...
- [Machine Learning] Learning to rank算法简介
声明:以下内容根据潘的博客和crackcell's dustbin进行整理,尊重原著,向两位作者致谢! 1 现有的排序模型 排序(Ranking)一直是信息检索的核心研究问题,有大量的成熟的方法,主要 ...
- learning to rank
Learning to Rank入门小结 + 漫谈 Learning to Rank入门小结 Table of Contents 1 前言 2 LTR流程 3 训练数据的获取4 特征抽取 3.1 人工 ...
- Learning to Rank 简介
转自:http://www.cnblogs.com/kemaswill/archive/2013/06/01/3109497.html,感谢分享! 本文将对L2R做一个比较深入的介绍,主要参考了刘铁岩 ...
- Learning to Rank简介
Learning to Rank是采用机器学习算法,通过训练模型来解决排序问题,在Information Retrieval,Natural Language Processing,Data Mini ...
- 芝麻HTTP: Learning to Rank概述
Learning to Rank,即排序学习,简称为 L2R,它是构建排序模型的机器学习方法,在信息检索.自然语言处理.数据挖掘等场景中具有重要的作用.其达到的效果是:给定一组文档,对任意查询请求给出 ...
- Learning to Rank(转)
https://blog.csdn.net/kunlong0909/article/details/16805889 Table of Contents 1 前言 2 LTR流程 3 训练数据的获取4 ...
- Learning to rank的讲解,单文档方法(Pointwise),文档对方法(Pairwise),文档列表方法(Listwise)
学习排序(Learning to Rank) LTR(Learning torank)学习排序是一种监督学习(SupervisedLearning)的排序方法.LTR已经被广泛应用到文本挖掘的很多领域 ...
- Learning to Rank:Point-wise、Pair-wise 和 List-wise区别
机器学习的 ranking 技术——learning2rank,包括 pointwise.pairwise.listwise 三大类型. [Ref-1]给出的: <Point wise rank ...
随机推荐
- python的Requests模块使用tips
post方法提交的是表单,要用data放dict get方法请求的是参数,要用params放dict HTTP头部是大小写不敏感的
- 设置layoutControl1 中的 控件的 focus
设置 layoutControl1 中的layoutControl EnableAutoTabOrder 为 false; this.layoutControl1.ActiveControl = th ...
- 在Lua里写unity游戏笔记
gameobject.GetComponent<Transform>(); 翻译成Lua: gameObject:GetComponent (luanet.ctype (Transform ...
- webstorm下设置sass
关于sass,就不想多说什么了.只要你有css基础,十分钟入门好吗.可以参考下资料:http://www.w3cplus.com/sassguide/ 今天想说的是webStorm下如何实现sass自 ...
- oracleasm方式创建ASM
1.准备oracleasm包 [root@localhost oracle]# uname -r 2.6.18-164.el5 [oracle@localhost ~]$ ls -l total 26 ...
- 瞬间从IT屌丝变大神——HTML规范
HTML规范包含以下内容: DTD统一用<!DOCTYPE HTML PUBLIC "_//W3C//DTD XHTML 1.0 Transitional//EN"" ...
- Signs of a poorly written jQuery plugin 翻译 (Jquery插件开发注意事项,Jquey官方推荐)
原文链接:http://remysharp.com/2010/06/03/signs-of-a-poorly-written-jquery-plugin/ 原文作者:remy sharp So far ...
- linux 配置免密码登录
主要就是两步 : 1. scp ~/.ssh/id_rsa.pub root@远程ip地址:~/ 2. cat id_rsa.pub >> ~/.ssh/authorized_keys,把 ...
- substr函数
substr(字符串,截取开始位置,截取长度) //返回截取的字 substr('Hello World',0,1) //返回结果为 'H' *从字符串第一个字符开始截取长度为1的字符串 subst ...
- 转载IEnumerable与IEnumerator区别
public interface IEnumerable { IEnumerator GetEnumerator(); } public interface IEnumerator { ...