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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ryan Lv
April 14, 2015
Programming
230
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
数据挖掘从0到1
2015-04-14 Shanghai Ruby Tuesday
title: 暴走漫画数据挖掘从0到1
speaker: 丁彦
company: 暴走漫画
Ryan Lv
April 14, 2015
More Decks by Ryan Lv
See All by Ryan Lv
Understanding MySQL Explain
xiaoronglv
1
1.1k
Memcached: consistent hashing, LRU, and memory allocation
xiaoronglv
0
870
Anki Basic
xiaoronglv
0
1.1k
Git Branch Model
xiaoronglv
0
140
Other Decks in Programming
See All in Programming
型も通る、synthも通る、それでも危ない 〜AIのCDKの権限とコストを機械で検証する〜 / It Passes Type Checks, It Passes Synth Checks, but It’s Still Risky — Automatically Verifying Permissions and Costs in AI’s CDK —
seike460
PRO
1
430
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
300
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
150
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
2.4k
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
230
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
120
What's New in Android 2026
veronikapj
0
200
FDEが実現するAI駆動経営の現在地
gonta
2
220
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
140
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
720
Android CLI
fornewid
0
170
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
1
250
Featured
See All Featured
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
3
360
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
340
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
230
GitHub's CSS Performance
jonrohan
1033
470k
Designing Powerful Visuals for Engaging Learning
tmiket
1
460
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
390
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
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