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
190
数据挖掘从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
1k
Memcached: consistent hashing, LRU, and memory allocation
xiaoronglv
0
740
Anki Basic
xiaoronglv
0
960
Git Branch Model
xiaoronglv
0
130
Other Decks in Programming
See All in Programming
今ならAmazon ECSのサービス間通信をどう選ぶか / Selection of ECS Interservice Communication 2025
tkikuc
20
3.7k
技術同人誌をMCP Serverにしてみた
74th
1
430
Modern Angular with Signals and Signal Store:New Rules for Your Architecture @enterJS Advanced Angular Day 2025
manfredsteyer
PRO
0
140
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
510
XSLTで作るBrainfuck処理系
makki_d
0
210
Composerが「依存解決」のためにどんな工夫をしているか #phpcon
o0h
PRO
1
240
第9回 情シス転職ミートアップ 株式会社IVRy(アイブリー)の紹介
ivry_presentationmaterials
1
250
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
1.1k
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
240
Beyond Portability: Live Migration for Evolving WebAssembly Workloads
chikuwait
0
400
なぜ適用するか、移行して理解するClean Architecture 〜構造を超えて設計を継承する〜 / Why Apply, Migrate and Understand Clean Architecture - Inherit Design Beyond Structure
seike460
PRO
1
700
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
440
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
930
Six Lessons from altMBA
skipperchong
28
3.9k
Rebuilding a faster, lazier Slack
samanthasiow
82
9.1k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
Being A Developer After 40
akosma
90
590k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Fireside Chat
paigeccino
37
3.5k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
How GitHub (no longer) Works
holman
314
140k
A Tale of Four Properties
chriscoyier
160
23k
Building an army of robots
kneath
306
45k
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