Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
数据挖掘从0到1
Search
Ryan Lv
April 14, 2015
Programming
0
130
数据挖掘从0到1
2015-04-14 Shanghai Ruby Tuesday
title: 暴走漫画数据挖掘从0到1
speaker: 丁彦
company: 暴走漫画
Ryan Lv
April 14, 2015
Tweet
Share
More Decks by Ryan Lv
See All by Ryan Lv
Understanding MySQL Explain
xiaoronglv
1
790
Memcached: consistent hashing, LRU, and memory allocation
xiaoronglv
0
550
Anki Basic
xiaoronglv
0
700
Git Branch Model
xiaoronglv
0
110
Other Decks in Programming
See All in Programming
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
8
4k
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
110
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
130
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
370
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
200
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
260
Semantic search with Django and pgvector
pauloxnet
0
240
1BRC--Nerd Sniping the Java Community
gunnarmorling
0
340
Komplexe Oberflächen mit SVG und der Web Animation API
joergneumann
0
670
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
170
Anthropic Cookbook のおすすめレシピ
schroneko
7
920
Netty Chicago Java User Group 2024-04-17
sullis
0
170
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
30
6k
Building Applications with DynamoDB
mza
88
5.6k
Navigating Team Friction
lara
178
13k
What's new in Ruby 2.0
geeforr
337
31k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
121
39k
The MySQL Ecosystem @ GitHub 2015
samlambert
243
12k
Clear Off the Table
cherdarchuk
84
310k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Infographics Made Easy
chrislema
238
18k
Building Your Own Lightsaber
phodgson
99
5.7k
YesSQL, Process and Tooling at Scale
rocio
164
13k
Transcript
暴⾛走漫画数据挖掘从0到1 Michael Ding@暴⾛走漫画(上海)
关于我 ⽣生物信息学 硕⼠士 《Git版本控制管理(第2版) 》 第⼆二版 译者 南京 LUG 管理员
代码托管服务(集盒)创始⼈人 微搜索(TinySou) 创始⼈人 暴⾛走漫画 技术总监(数据挖掘,上海技术部) 2
内容概要 搜索服务 相关理论与原理 核⼼心问题 实践 推荐服务 相关理论与原理 ⼀一般步骤 协同过滤为例 未来与挑战
3
构建搜索服务 搜索是寻找资源的最好⽅方式 4
搜索服务的基本流程 5 这⾥里的Data 是数据源(即要搜的东⻄西),可 以是数据库,可以是⽂文件系统,也可以是 互联⺴⽹网(⾕谷歌) 特别注意的是这⾥里的“索引”过程,搜索引 擎并不会直接搜索数据源,⽽而要先将数据 源的内容索引到搜索引擎中 索引
6 索引结构: 倒排表(Inverted Index)
索引(过程)的核⼼心问题 中⽂文分词 统计语⾔言模型 ⼯工程实现(效果:字典,效率:算法) 分词策略(重复索引,组合分词) 中⽂文分词 (英⽂文分词) 拼⾳音分词 n-gram 7
搜索的核⼼心问题 索引查询 倒排表查询,结果取并集(Union),作为候选 结果排序 TF-IDF/BM25 vector space model boost(⾃自定义因素) 机器学习
综合以上 8
TF-IDF/BM25 IDF idf(t) = 1 + log ( numDocs /
(docFreq + 1)) TF tf(t in d) = √frequency BM25 bm25(t in d) = tf(t in d) * (k + 1)/(tf(t in d) + k * (1-b+b*|D|/avgdl) Field-length Norm norm(d) = 1 / √numTerms Weight weight(t in d) = tf * idf * norm (using tf-idf) weight(t in d) = bm25 * if * norm (using bm25) 9
vector space model 原理 查询语句以及每个候选由⼀一个 vector 表⽰示, vector 中的每个值是 term
的 weight 值 计算每个候选 vector 与 查询 vector 的 cosine 值,得分⾼高者排名⾼高 举例: 查询是: 暴⾛走|⼤大|事件 q = [0.8, 0.1, 0.6] 有两个候选: doc1:暴⾛走|漫画 v1 = [0.82, 0, 0] doc2:暴⾛走|事件 v2 = [0.82, 0, 0.63] 计算 cosine: cos(q, v1) < cos(q, v2) 结论 doc2 排名⾼高 10
Boost 排序的外部因素 PageRank 竞价排名 机器学习 暴漫策略: 浏览量/播放量 min(2.0, log(1+0.1v) 和cos(v,
q) 相加 11
⼯工程实现 基于 Elasticsearch 做索引 设计索引结构(分词,相似策略,norm 策略) 排序结果⼲干预 基于 Elasticsearch 做排序(⽂文本相关性
+ boost) 跟踪⽤用户点击⾏行为,利⽤用机器学习调整隐藏因素 12
构建推荐服务 推荐是移动应⽤用的重要⽤用户留存⼿手段 13
主要的推荐⽅方法 Content-Based 你在看⾔言情⼩小说1,可能也会看⾔言情⼩小说2 Item-Hierarchy 你买了打印机,所以你可能也要买墨盒 Collaborative Filtering - Item-based 《蝙蝠侠》和《变形⾦金刚》受众很相似,你看了《蝙蝠侠》,可能也会看《变形⾦金
刚》 Collaborative Filtering - User-based 你和XXX的观影⼜⼝口味很像,XXX最近看了“暴⾛走⼤大事件”,你可能也会看 Graph based 你的不少微信好友都买喜欢王尼玛,你可能也会喜欢王尼玛 Model based 说不清楚的机器学习,告诉我正负样本,我会越来越了解你 14
⼀一般步骤 定义问题,选择推荐⽅方法(组合) 推荐帖⼦子,结合 content-based 和 collaborative filtering 相似度计算 cosine similarity
相似矩阵 预测 给定⼀一个⽤用户,预测他对帖⼦子的兴趣 找出预测出的兴趣最⾼高的帖⼦子,倒序返回 15
协同过滤(item-based) 16 user 0 user 1 user 2 user 3
user 4 article 0 1 1 article 1 1 2 2 article 2 1 1 article 3 1 1 2 article 4 2 1
对于 user0, 我们该推荐什么? 17
计算 article 之间的相似矩阵 18
为候选article打分 19
What’s Next Cached(速度) 异步IO Distributed(速度,计算量) Machine Learning(更加智能) Julia? 20
谢谢 邮箱:
[email protected]
技术博客:http://freestorm.org 微博:Michael爱开源 21