Large scale machine learning - Online learning

In this class, let's talk about a new large scale machine learning setting called the online learning setting. It allows us to model problems where we have a continuous flood of data coming in and we would like the algorithm to learn from that. Today, many of the largest website companies use different versions of online learning algorithms to learn from the flood of users that keep on coming to, back to the website.

 figure-1

Suppose you run a shipping service. Users come and ask you to help ship their package from location A to location B. Your website offers to ship the package for some asking price. Based on the price you offer to the users, the users sometimes chose to use a shipping service, that's a positive example (y=1); sometimes they go way and do not choose to purchase your shipping service(y=0). So let's say that we want a learning algorithm to help us to optimize what is the asking price that we want to offer to our users.

Specifically, let's say we come up with some sort of features that capture properties of the users: the origin and destination of the package, and the price we happen to offer to them for shipping the package. What we want to do is to learn what is the probability p(y=1|x;\theta ) that they will elect to ship the package using our shipping service given these features, note that the feature x also captures the price that we're asking for. So if we could estimate the chance that they'll agree to use our service for any given price, then we can try to pick a price so that they have a pretty high probability of choosing our website while simultaneously hopefully offering us a fair return, offering us a fair profit for shipping their package. We can choose logistic regression or neural network or something else. But let's start with logistic regression.

figure-2

In figure-2, it shows what an online learning algorithm would do. The "repeat forever" means our website is going to keep on staying up. Occasionally, a user will come and for the user that comes, we get some (x,y) pair corresponding to a user on the website. So the feature x are the origin and destination specified by the user and the price we happened to offer to them this time. And y is either 0 or 1 depending on whether or not they chose to use our shipping service. Once we get this (x,y) pair, the online learning algorithm then updates the parameters \theta using just this example (x,y) as \theta _{j}:=\theta _{j}-\alpha (h_\theta (x)-y)x_{j}, where j=0,...n.

Note that here for online learning algorithm, I didn't write the example as (x^{(i)}, y^{(i)}), the reason is we throw the example away after we learn from that example. We never use it again.

One interesting effect of this sort of online learning algorithm is that it can adapt to changing user preferences. In particular, if over time because of changes in the economy, maybe users start to become more price sensitive and less willing to pay high prices. Or if they become less price sensitive and they're willing to pay higher prices. Or if different things become more important to users, if new types of users coming to your website. If your pool of users changes, then these updates to your parameters \theta will just slowly adapt your parameters to whatever your latest pool of users looks like.

figure-3

Let's look at another online learning example. This is an application on product search in which we want to apply the learning algorithm to give good search listings to a user. Let's say you run an online store that sells cell phones. And you have a user interface where a user can come to your website and type in a query like "Android phone 1080p camera". Suppose we have a hundred phones in our store. And because of the way our website is laid out, when a user types in a search query, we would like to find a choice of ten different phones to show what to offer to the user. What we would like to do is have a learning algorithm help us figure out what are the ten phones out of the 100 we should return the user in response to a user search query like the one here.

Here's how we can go about the problem:

For each phone and given a specific user query, we can construct a feature vector x. The feature vector x may capture different properties of the phone. It may capture things like how similar the user search query is to the phones. We capture things like how many words in the user search query match the name of the phone, how many words in the query match the description of the phone and so on. So the feature x captures the properties of the phone and how similar or how well the phone matches the user query along different dimensions. What we would like to do is estimate the probability that a user will click on the link for a specific phone, because we want to show the user phones that they have high probability of clicking on in the web browser. I'll define y=1 if user clicked on the link and y=0 otherwise. The problem of learning this is actually called the problem of learning the predicted click-through rate (CTR). Just means learning the probability that the user will click on the specific link that you offer them. We can compute the probability p(y=1|x;\theta) for each of the 100 phones, and just select 10 phones that the user is most likely to click on, this would be a pretty reasonable way to decide what ten results to show to the user.

Just to be clear, suppose every time a user does a search, we return ten results. What that will do is it actually gives us 10 (x,y) pairs. So each time a user comes, you'll get 10 examples, and then use an online learning algorithm to update the parameters using essentially 10 steps. And then you can throw the data away.

Last, I'll quickly mention a few other examples.

  1. If you have a website and trying to decide what special offer to show the user.
  2. If you have a website and you're a news aggregator and you show different users different articles.
  3. Closely related to special offers, we have product recommendations

And in fact, if you have a collaborative filtering system, you can even imagine the system gives you additional features to feed into a logistic regression classifier to try to predict the click through rate for different products that you might recommend to a user.

<end>

"sgmediation.zip" 是一个包含 UCLA(加利福尼亚大学洛杉矶分校)开发的 sgmediation 插件的压缩包。该插件专为统计分析软件 Stata 设计,用于进行中介效应分析。在社会科学、心理学、市场营销等领域,中介效应分析是一种关键的统计方法,它帮助研究人员探究变量之间的因果关系,尤其是中间变量如何影响因变量与自变量之间的关系。Stata 是一款广泛使用的统计分析软件,具备众多命令和用户编写的程序来拓展其功能,sgmediation 插件便是其中之一。它能让用户在 Stata 中轻松开展中介效应分析,无需编写复杂代码。 下载并解压 "sgmediation.zip" 后,需将解压得到的 "sgmediation" 文件移至 Stata 的 ado 目录结构中。ado(ado 目录并非“adolescent data organization”缩写,而是 Stata 的自定义命令存放目录)目录是 Stata 存放自定义命令的地方,应将文件放置于 "ado\base\s" 子目录下。这样,Stata 启动时会自动加载该目录下的所有 ado 文件,使 "sgmediation" 命令在 Stata 命令行中可用。 使用 sgmediation 插件的步骤如下:1. 安装插件:将解压后的 "sgmediation" 文件放入 Stata 的 ado 目录。如果 Stata 安装路径是 C:\Program Files\Stata\ado\base,则需将文件复制到 C:\Program Files\Stata\ado\base\s。2. 启动 Stata:打开 Stata,确保软件已更新至最新版本,以便识别新添加的 ado 文件。3. 加载插件:启动 Stata 后,在命令行输入 ado update sgmediation,以确保插件已加载并更新至最新版本。4
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值