Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add some papers #4

Open
wants to merge 196 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
196 commits
Select commit Hold shift + click to select a range
66ad725
Update README.md
QinHsiu Mar 4, 2023
0d32915
update
QinHsiu Mar 4, 2023
2a7cbfb
Create README.md
QinHsiu Apr 13, 2023
7cf011d
Update README.md
QinHsiu Apr 13, 2023
2050a8b
Update README.md
QinHsiu Apr 13, 2023
c0a045e
Update README.md
QinHsiu Apr 13, 2023
db7f4c5
Create README.md
QinHsiu Apr 13, 2023
7d9961d
Update README.md
QinHsiu Apr 13, 2023
210f6da
Update README.md
QinHsiu Apr 16, 2023
f8e2735
Create README.md
QinHsiu Apr 16, 2023
8925a4f
Update README.md
QinHsiu Apr 16, 2023
18b3f10
Update README.md
QinHsiu Apr 16, 2023
b28dbd5
Update README.md
QinHsiu Apr 16, 2023
aa6e250
Create README.md
QinHsiu Apr 18, 2023
adffcb3
Update README.md
QinHsiu Apr 18, 2023
ed99512
Create README.md
QinHsiu Apr 20, 2023
bd5c1c7
Create README.md
QinHsiu Apr 20, 2023
a2cf868
Create README.md
QinHsiu Apr 20, 2023
dd08ec4
Create README.md
QinHsiu Apr 20, 2023
731c4fa
Create README.md
QinHsiu Apr 20, 2023
927cb3a
Create README.md
QinHsiu Apr 20, 2023
7f00a86
Create README.md
QinHsiu Apr 20, 2023
9e43a61
Create README.md
QinHsiu Apr 20, 2023
55c6ab8
Create README.md
QinHsiu Apr 20, 2023
cf3e2eb
Create README.md
QinHsiu Apr 20, 2023
ef4e1be
Create README.md
QinHsiu Apr 20, 2023
6bc94c0
Create README.md
QinHsiu Apr 20, 2023
da8c474
Create README.md
QinHsiu Apr 20, 2023
e989b9e
Create README.md
QinHsiu Apr 20, 2023
2661f9f
Create README.md
QinHsiu Apr 20, 2023
06ab861
Create README.md
QinHsiu Apr 20, 2023
2675a7e
Update README.md
QinHsiu Apr 20, 2023
d8f113d
Update README.md
QinHsiu May 4, 2023
b2b6974
Update README.md
QinHsiu May 4, 2023
ea6986b
Update README.md
QinHsiu Jun 17, 2023
f9a4150
Update README.md
QinHsiu Jun 17, 2023
6198d94
Update README.md
QinHsiu Jun 17, 2023
1908425
Update README.md
QinHsiu Jun 17, 2023
0f93edb
Update README.md
QinHsiu Jun 17, 2023
9650200
Update README.md
QinHsiu Jun 17, 2023
2c6541e
Update README.md
QinHsiu Jun 17, 2023
6f9dd4b
Update README.md
QinHsiu Jun 17, 2023
19ef2e3
Update README.md
QinHsiu Jun 17, 2023
b301374
Update README.md
QinHsiu Jun 17, 2023
11de020
Update README.md
QinHsiu Jun 17, 2023
1d2b20c
Update README.md
QinHsiu Jun 17, 2023
c159a35
Update README.md
QinHsiu Jun 17, 2023
ddf5c4f
Update README.md
QinHsiu Jun 17, 2023
da4674f
Update README.md
QinHsiu Jun 17, 2023
343a0a9
Update README.md
QinHsiu Jun 17, 2023
c4dfa17
Update README.md
QinHsiu Jun 17, 2023
b4dc886
Update README.md
QinHsiu Jun 17, 2023
c2810b7
Update README.md
QinHsiu Jun 17, 2023
54e2829
Update README.md
QinHsiu Jun 17, 2023
7ce784c
Update README.md
QinHsiu Jun 17, 2023
ec782bb
Update README.md
QinHsiu Jun 17, 2023
57dad4a
Update README.md
QinHsiu Jun 17, 2023
f2a1051
Update README.md
QinHsiu Jun 17, 2023
7858269
Update README.md
QinHsiu Jun 17, 2023
2a136ad
Update README.md
QinHsiu Jun 17, 2023
c194f7c
Update README.md
QinHsiu Jun 17, 2023
ce9bab7
Update README.md
QinHsiu Jun 17, 2023
54b3fb8
Update README.md
QinHsiu Jun 17, 2023
3604fed
Update README.md
QinHsiu Jun 17, 2023
0675808
Update README.md
QinHsiu Jun 17, 2023
bac57fa
Update README.md
QinHsiu Jun 17, 2023
190a1a1
Update README.md
QinHsiu Jun 19, 2023
712ea2a
Update README.md
QinHsiu Jun 19, 2023
eabb6ba
Update README.md
QinHsiu Jun 19, 2023
ed32ac5
Update README.md
QinHsiu Jun 21, 2023
3f05569
Update README.md
QinHsiu Jul 13, 2023
1def5c3
Update README.md
QinHsiu Jul 13, 2023
3012684
Update README.md
QinHsiu Jul 13, 2023
aaa62c2
Update README.md
QinHsiu Jul 13, 2023
c3f7319
Update README.md
QinHsiu Jul 13, 2023
79e0ed4
Update README.md
QinHsiu Jul 13, 2023
0e3385d
Update README.md
QinHsiu Jul 13, 2023
53cfaea
Update README.md
QinHsiu Jul 13, 2023
d15b13a
Update README.md
QinHsiu Jul 13, 2023
553f28b
Update README.md
QinHsiu Jul 13, 2023
eaf53fd
Update README.md
QinHsiu Jul 13, 2023
c7c3e16
Update README.md
QinHsiu Jul 13, 2023
4114dce
Update README.md
QinHsiu Jul 13, 2023
09bd21e
Update README.md
QinHsiu Jul 13, 2023
ea904d0
Update README.md
QinHsiu Jul 13, 2023
c61cff1
Update README.md
QinHsiu Jul 17, 2023
7e0152f
Update README.md
QinHsiu Jul 17, 2023
40b2d9c
Update README.md
QinHsiu Jul 17, 2023
95bab54
Update README.md
QinHsiu Jul 17, 2023
3ca7872
Update README.md
QinHsiu Jul 17, 2023
d3cd806
Update README.md
QinHsiu Jul 17, 2023
d44e684
Update README.md
QinHsiu Jul 17, 2023
89cdbd9
Update README.md
QinHsiu Jul 17, 2023
f88b084
Update README.md
QinHsiu Jul 17, 2023
c5ec527
Update README.md
QinHsiu Jul 17, 2023
a85f57f
Update README.md
QinHsiu Jul 17, 2023
d7610b0
Update README.md
QinHsiu Jul 17, 2023
0822a00
Update README.md
QinHsiu Jul 17, 2023
e42ae56
Update README.md
QinHsiu Jul 17, 2023
c00736f
Update README.md
QinHsiu Jul 17, 2023
1ec3f50
Update README.md
QinHsiu Jul 17, 2023
ddb3721
Update README.md
QinHsiu Jul 17, 2023
62cc28c
Update README.md
QinHsiu Jul 17, 2023
6c9bf3c
Update README.md
QinHsiu Jul 17, 2023
394f54a
Update README.md
QinHsiu Jul 17, 2023
4d29817
Update README.md
QinHsiu Jul 17, 2023
2ef4441
Update README.md
QinHsiu Jul 17, 2023
88951b8
Update README.md
QinHsiu Jul 17, 2023
b53a8e9
Update README.md
QinHsiu Jul 17, 2023
dd85ac3
Update README.md
QinHsiu Jul 17, 2023
acc43ea
Update README.md
QinHsiu Jul 17, 2023
a102635
Update README.md
QinHsiu Jul 17, 2023
5572493
Update README.md
QinHsiu Jul 17, 2023
2fa032b
Update README.md
QinHsiu Jul 17, 2023
2648c76
Update README.md
QinHsiu Jul 17, 2023
7df6495
Update README.md
QinHsiu Jul 17, 2023
698f75f
Update README.md
QinHsiu Jul 17, 2023
d4a4b62
Update README.md
QinHsiu Jul 17, 2023
9148bc3
Update README.md
QinHsiu Jul 17, 2023
879cc86
Update README.md
QinHsiu Jul 18, 2023
76c8e9a
Update README.md
QinHsiu Jul 18, 2023
cbbbff7
Update README.md
QinHsiu Jul 18, 2023
e9a0f6c
Update README.md
QinHsiu Jul 18, 2023
45dca18
Update README.md
QinHsiu Jul 18, 2023
c22fad4
Update README.md
QinHsiu Jul 18, 2023
6ec3fb8
Update README.md
QinHsiu Jul 18, 2023
09ded5a
Update README.md
QinHsiu Jul 18, 2023
5396a15
Update README.md
QinHsiu Jul 18, 2023
bef7740
Update README.md
QinHsiu Jul 18, 2023
7ffb452
Update README.md
QinHsiu Jul 18, 2023
68bfd19
Update README.md
QinHsiu Jul 18, 2023
66c2747
Update README.md
QinHsiu Jul 18, 2023
3c6a3da
Update README.md
QinHsiu Jul 18, 2023
63c10f4
Update README.md
QinHsiu Jul 18, 2023
3d6df40
Update README.md
QinHsiu Jul 18, 2023
b59cb52
Update README.md
QinHsiu Jul 18, 2023
1695dd9
Update README.md
QinHsiu Jul 18, 2023
e6052cd
Update README.md
QinHsiu Jul 18, 2023
4a47992
Update README.md
QinHsiu Jul 18, 2023
34e6346
Update README.md
QinHsiu Jul 18, 2023
13f4437
Update README.md
QinHsiu Jul 18, 2023
15f1f5b
Update README.md
QinHsiu Jul 18, 2023
0d38a9e
Update README.md
QinHsiu Jul 18, 2023
e50b414
Update README.md
QinHsiu Jul 18, 2023
d9e06b9
Update README.md
QinHsiu Jul 18, 2023
8baf118
Update README.md
QinHsiu Jul 18, 2023
fbc870c
Update README.md
QinHsiu Jul 18, 2023
8c8e993
Update README.md
QinHsiu Jul 18, 2023
6b84806
Update README.md
QinHsiu Jul 27, 2023
db4a7c0
Update README.md
QinHsiu Aug 9, 2023
4790670
Update README.md
QinHsiu Aug 11, 2023
59aab80
Update README.md
QinHsiu Aug 11, 2023
c86fbb6
Update README.md
QinHsiu Aug 11, 2023
06f75c4
Update README.md
QinHsiu Aug 24, 2023
42a8189
Update README.md
QinHsiu Aug 24, 2023
4e3e042
Update README.md
QinHsiu Aug 24, 2023
6a34a66
Update README.md
QinHsiu Aug 24, 2023
8a14b90
Update README.md
QinHsiu Aug 24, 2023
2b07fd4
Update README.md
QinHsiu Aug 24, 2023
fe66a35
Update README.md
QinHsiu Sep 4, 2023
276058b
Add files via upload
QinHsiu Sep 4, 2023
9a7d55d
Update README.md
QinHsiu Sep 4, 2023
df50a87
Add files via upload
QinHsiu Sep 4, 2023
3c9b152
Update README.md
QinHsiu Sep 4, 2023
939714c
Update README.md
QinHsiu Sep 5, 2023
6a4c081
Update README.md
QinHsiu Sep 5, 2023
76bc761
Update README.md
QinHsiu Sep 5, 2023
e02012b
Update README.md
QinHsiu Sep 5, 2023
a5a0ccd
Update README.md
QinHsiu Sep 5, 2023
4c5bb5d
Update README.md
QinHsiu Oct 2, 2023
45b96ed
Update README.md
QinHsiu Oct 2, 2023
b91c8c9
Update README.md
QinHsiu Oct 2, 2023
9b8dddd
Update README.md
QinHsiu Oct 2, 2023
700cce3
Update README.md
QinHsiu Oct 2, 2023
ce85404
Update README.md
QinHsiu Oct 2, 2023
efb7de6
Add files via upload
QinHsiu Oct 14, 2023
73d2a4e
Create README.md
QinHsiu Oct 14, 2023
67d985d
Update README.md
QinHsiu Oct 14, 2023
10a6edb
Update README.md
QinHsiu Oct 14, 2023
7d91537
Update README.md
QinHsiu Oct 14, 2023
0504a0f
Update README.md
QinHsiu Oct 14, 2023
e6ac528
Update README.md
QinHsiu Oct 14, 2023
24b746c
Update README.md
QinHsiu Oct 14, 2023
0ffa96b
Update README.md
QinHsiu Oct 14, 2023
98feb7d
Update README.md
QinHsiu Oct 14, 2023
0247c4c
Update README.md
QinHsiu Oct 14, 2023
3ed9e3d
Update README.md
QinHsiu Oct 14, 2023
d5d7ddb
Update README.md
QinHsiu Nov 7, 2023
b6eee32
Update README.md
QinHsiu Nov 7, 2023
46c4f81
Update README.md
QinHsiu Nov 7, 2023
0755155
Update README.md
QinHsiu Nov 7, 2023
11e02dc
Update README.md
QinHsiu Jan 7, 2024
fd14142
Update README.md
QinHsiu Jan 7, 2024
20fd153
add LCRec
QinHsiu Jan 7, 2024
8f82694
add uni-ctr
QinHsiu Jan 7, 2024
206213d
add LLM&CSR
QinHsiu Jan 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions 00 Embedding/Note/Word2Vec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Word2Vec

### 1.模型解读

### 2.表达式

### 3.一般步骤

### 4.模型的优缺点

### 5.改进版本

### 6.Python实现

### 7.参考资料

4 changes: 4 additions & 0 deletions 00 Embedding/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- [[EFIN][KDD 23][Tencent]Explicit Feature Interaction-aware Uplift Network for Online Marketing](https://arxiv.org/abs/2306.00315)
- [[SDC][KDD 23][Tencent]Binary Embedding-based Retrieval at Tencent](https://arxiv.org/abs/2302.08714)
- [[MIPS][KDD 23][Meta]Revisiting Neural Retrieval on Accelerators](https://arxiv.org/abs/2306.04039)
- [[UnifileR][KDD 23][Microsoft]UnifieR: A Unified Retriever for Large-Scale Retrieval](https://arxiv.org/abs/2205.11194)
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# AutoFAS: Automatic Feature and Architecture Selection for Pre-Ranking System 论文笔记

[论文](https://arxiv.org/abs/2205.09394)

## Motivation

##### 先前的方法没有明确地对性能收益与计算开销进行建模,在预排序阶段的延迟约束会导致次优的结果;从教师模型中迁移知识到预先定义好结构的学生模型中也会对模型的结果造成影响。

##### AutoFAS第一次同时选择最有价值的特征和使用神经结构搜索选择网络结构,其能够在排序教师模型的帮助下选择最合适的预排序结构。

![image-20230213201512193](C:\Users\QinHsiu\AppData\Roaming\Typora\typora-user-images\image-20230213201512193.png)

## Model

![image-20230213212911390](C:\Users\QinHsiu\AppData\Roaming\Typora\typora-user-images\image-20230213212911390.png)

##### 其模型结构主要包含两部分,左边的排序教师模型和右边的预排序学生模型,左边的教师模型主要用于特征的选择以及表征的学习,预排序网络结构中主要是多种不同的多层感知机,感知机的输入结构不一样,通过结构搜索技术为该学生模型选择合适的架构,避免了人工搜索带来的问题。其算法流程如下所示:输入相关的数据,先训练一个排序模型,然后使用训练好的排序模型作为教师模型,然后训练网络更新Mask和L参数,在每一个层中选择最重要的特征和结构,然后使用知识蒸馏训练该选中的结构,输出预先排序模型

![image-20230213214002972](C:\Users\QinHsiu\AppData\Roaming\Typora\typora-user-images\image-20230213214002972.png)

## Performance

##### 从实验结果可以看出使用该方法不仅提高了精度,还大大减少了内存消耗和时间延迟,从表4可以看出其提升了精度,并且其资源消耗以及时间延迟较与baseline都是可以比较的

![image-20230213214043421](C:\Users\QinHsiu\AppData\Roaming\Typora\typora-user-images\image-20230213214043421.png)

![image-20230213214156777](C:\Users\QinHsiu\AppData\Roaming\Typora\typora-user-images\image-20230213214156777.png)

## Ablation Study

##### 从实验结果看出其每一个板块都是有用的,并且在增大学生网络参数的时候其结构化搜索会使得模型消耗更少的时间

![image-20230213214216508](C:\Users\QinHsiu\AppData\Roaming\Typora\typora-user-images\image-20230213214216508.png)

## Conclusion

##### 这篇工作提出了一种端到端的自动化机器学习预排序模型。与简单地考虑特征的连接不同的是,该模型同时地选择特征和模型结构,联合优化使得其在计算开销和表现上都取得不错的效果,另外使用知识蒸馏技术从教师模型中学习有用的知识用于预排序。

## References

10 changes: 10 additions & 0 deletions 01 Ranking/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
![avator](rank.png)
![avator](rank_1.png)
- PreRanking
- [[AutoFAS][KDD 22][Mei tuan]AutoFAS: Automatic Feature and Architecture Selection for Pre-Ranking System](https://arxiv.org/abs/2205.09394)
- [[ATRank][AAAI 18][Alibaba]ATRank: An Attention-Based User Behavior Modeling Framework for Recommendation](https://arxiv.org/abs/1711.06632)
- [[RankFormer][KDD 23][Amazon]RankFormer: Listwise Learning-to-Rank Using Listwide Labels](https://arxiv.org/abs/2306.05808)
- [[MOO][KDD 23][Amazon]Querywise Fair Learning to Rank through Multi-Objective Optimization](https://www.amazon.science/publications/querywise-fair-learning-to-rank-through-multi-objective-optimization)
- [[MLLTR][KDD 23][Amazon]Multi-Label Learning to Rank through Multi-Objective Optimization](https://arxiv.org/abs/2207.03060)
- [[ULTR][KDD 23][Google]Towards Disentangling Relevance and Bias in Unbiased Learning to Rank](https://arxiv.org/abs/2212.13937)

Binary file not shown.
Binary file not shown.
Binary file added 01 Ranking/rank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 01 Ranking/rank_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions 02 ReRank/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- [[AutoIntent][SIGIR 22][Mei tuan]Automatically Discovering User Consumption Intents in Meituan](https://dl.acm.org/doi/pdf/10.1145/3534678.3539122)
- [[CMR][KDD 23][Alibaba]Controllable Multi-Objective Re-ranking with Policy Hypernetworks](https://arxiv.org/abs/2306.05118)
- [[MIREC][KDD 23][Alibaba]Multi-channel Integrated Recommendation with Exposure Constraints](https://arxiv.org/abs/2305.12319)
- [[MPAD][KDD 23][Alibaba]Multi-factor Sequential Re-ranking with Perception-Aware Diversification](https://arxiv.org/abs/2305.12420)
- [[KDD 23][Hua Wei]On-device Integrated Re-ranking with Heterogeneous Behavior Modeling](https://www.youtube.com/watch?v=1UirlORuWgo)
- [[PIER][KDD 23][Mei Tuan]PIER: Permutation-Level Interest-Based End-to-End Re-ranking Framework in E-commerce](https://arxiv.org/abs/2302.03487)
Binary file not shown.
Binary file not shown.
16 changes: 16 additions & 0 deletions 03 CTR/Note/DCN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# DCN

### 1.模型解读

### 2.表达式

### 3.一般步骤

### 4.模型的优缺点

### 5.改进版本

### 6.Python实现

### 7.参考资料

16 changes: 16 additions & 0 deletions 03 CTR/Note/DIN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# DIN

### 1.模型解读

### 2.表达式

### 3.一般步骤

### 4.模型的优缺点

### 5.改进版本

### 6.Python实现

### 7.参考资料

16 changes: 16 additions & 0 deletions 03 CTR/Note/DeepCrossing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# DeepCrossing

### 1.模型解读

### 2.表达式

### 3.一般步骤

### 4.模型的优缺点

### 5.改进版本

### 6.Python实现

### 7.参考资料

16 changes: 16 additions & 0 deletions 03 CTR/Note/DeepFM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# DeepFM

### 1.模型解读

### 2.表达式

### 3.一般步骤

### 4.模型的优缺点

### 5.改进版本

### 6.Python实现

### 7.参考资料

55 changes: 55 additions & 0 deletions 03 CTR/Note/FactorizationMachine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 因子分解机做推荐预测任务

### 1.因子分解的含义

##### 分解机中的分解是来自于其在求解特征交叉项系数的时候用到了矩阵分解,其在逻辑回归的基础上引入了一个特征交叉项,也即考虑了不同特征之间的关系,因为数据系数的原因直接通过观测值来代表特征交叉项的系数会导致大部分数据因为系数(某些特征交叉项系数为0)为0而无法发挥作用;

### 2.因子分解机表达式,以二阶特征交叉为例

### $$线性回归的表达式为:\hat{y}=\omega_{0}+\sum^{n}\limits_{i=1}\omega_{i}x_{i}$$

### $$FM二阶特征交叉表达式为:\hat{y}=\omega_{0}+\sum\limits_{i=1}^{n}\omega_{i}x_{i}+\sum^{n-1}\limits_{i=1}\sum^{n}\limits_{j=i+1}\omega_{ij}x_{i}x_{j}$$

##### 相较于之前的线性回归方法,FM考虑了不同特征之间的交叉关系,现在最关键的一点就是如何求解交叉特征的系数,最简单的方法是依据观测变量得出,但是这会面临数据系数的问题,最合理的方法是通过模型学习来获得;

### $$\omega_{ij}=\textless v_{i},v_{j}\textgreater=v_{i}\cdot v_{j},v_{i}=(v_{i1},v_{i2},...,v_{ik})^{T} \in \mathbb{R}^{k},i=1,2,..,n$$

### $$w_{ij}=v_{i}^{T}v_{j}=\sum^{k}\limits_{i=1}v_{ik}v_{jk},该表达式对应矩阵分解方法,因此模型的方法称之为因子分解机$$

### $$其满足当k足够大的时候,对于任意对称正定实矩阵\hat{\omega}\in\mathbb{R}^{n\times n},均存在一个实矩阵v\in\mathbb{R}^{n\times k},使得\hat{\omega}=vv^{T}.因此vv^{T}的表达能力足够强$$

### 3.因子分解机一般步骤

- 数据处理与LR一致,将特征转换为数值型特征
- 结合业务构建FM模型
- 通过梯度下降算法更新模型参数
- 更具模型输出结果对商品进行排序,返回推荐列表

### 4.因子分解机的优缺点

- 优点
- 引入隐向量可以很好地缓解数据稀疏带来的问题,使用该方法可以使得模型学习到不同特征交叉关系,并且使用隐向量,给定两个特征A和B,当A和B没有交互的时候,可以依据AC更新A,依据BD更新B,大幅度就降低了模型对数据稀疏性的要求;
- 降低了最原始特征交叉的空间复杂度,最原始两两特征交叉需要O(n^2),n表示特征数目,现在只需要nk(k远远小于n)个;
- 其在一定程度上丢失了某些特征组合的精确记忆能力(例如有的特征交叉频繁,使用暴力特征交叉可以学到这一点,但是加入隐向量之后一些重要的交叉特征就变得平凡了),但是其大大提高了模型的泛化性能;
- 缺点
- 在考虑高阶(三阶及以上)特征交叉的时候,会面临梯度爆炸的问题,降低了模型的学习能力

### 5.因子分解机后的改进版本

- FFM
- 在FM的基础上引入特征域,其隐向量由原来的一维变成了多维,也就是说每一个特征对应的不是唯一一个隐向量,而是一组隐向量,给定三个特征A,B,C,在FM中每一个特征对应一个隐向量,分别为va,vb,vc,所以A与B的交叉特征的权重为(va,vb),A与C的交叉特征的权重为(va,vc),这里两个权重中使用的va是同一个隐向量;在FFM中会为每一个特征分配f-1个隐向量,f表示特征的数目,也即同样情况下A的隐向量表示为{vab,vac},B的隐向量表示为{vba,vbc},C的隐向量为{vca,vcb},A与B的交叉特征的权重为(vab,vba),A与C的交叉特征的权重为(vac,vca),这样使得计算两个权重的时候不会互相干扰,增强了模型的表达和泛化能力;

- ### $$\hat{y}=\omega_{0}+\sum\limits_{i=1}^{n}\omega_{i}x_{i}+\sum^{n-1}\limits_{i=1}\sum^{n}\limits_{j=i+1}(\omega_{j1,f2}\cdot\omega_{j2,f1})x_{i}x_{j}$$

- 其参数数量可以表示为nxfxk,其中n表示特征数目,f表示特征域(一般为特征数目-1),k表示隐向量维度,这里其计算复杂度为O(kn^2),其复杂度较于FM有显著的提升,但是其泛化能力有所提高;其和FM一样只适用于二阶特征交叉,三阶会导致梯度爆炸的问题;

### 6.python实现

### 7.参考资料

[1]

[2] 王喆《深度学习推荐系统》

[3] [分解机推荐算法原理](https://www.cnblogs.com/pinard/p/6370127.html)

105 changes: 105 additions & 0 deletions 03 CTR/Note/LogisticRegression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# 逻辑回归做推荐预测任务

### 1.逻辑回归的含义

##### 逻辑回归是线性回归的衍生,线性回归的输出为预测值,逻辑回归的输出为转换后的概率值,一般使用sigmod函数求解,其中逻辑logit是log odds对数几率的意思,几率表示的是正样本的相对可能性;

### 2.逻辑回归的表达式以及求导

### $$线性回归的表达式:y=\omega x+b$$

### $$y=\sigma(\omega^{T} x+b)=\frac{1}{1+\exp(-\omega^{T} x-b)},y表示模型输出的预测概率,\ln\frac{y}{1-y}=\omega^{T}x+b,\frac{y}{1-y}表示几率,其含义是预测x为正例的概率的相对可能性,\ln(\frac{y}{1-y})表示对数几率,也即logit$$

##### 给定一个二分类任务y={0,1},假设就y的后验概率估计分别为p(y=1|x)和p(y=0|x),则对应的表达式可以改写为:

### $$\ln\frac{p(y=1|x)}{p(y=0|x)}=\omega^{T}x+b,p(y=1|x)=\frac{\exp(\omega^{T}x+b)}{1+\exp(\omega^{T}x+b)},p(y=0|x)=\frac{1}{1+\exp(\omega^{T}x+b)}$$

##### 优化目标是为了让模型尽可能预测出正确的类别,可以通过极大似然来估计对应的omega和bias,求解步骤如下所示:

### $$假设\beta=(\omega;b),\hat{x}=(x;1),\beta^{T}\hat{x}=\omega^{T}x+b,再令p_{1}(y=1|x)=p_{1}(y=1|\hat{x};\beta)=\frac{\exp(\beta^{T}\hat{x})}{1+\beta^{T}\hat{x}},p_{0}(y=0|x)=1-p_{1}(y=1|\hat{x};\beta)=\frac{1}{1+\exp(\beta^{T}\hat{x})}$$

### $$优化目标为最大化对数似然,\mathcal{l}(\omega,b)=\sum\limits^{m}_{i=1}\ln p(y_{i}|\hat{x};\beta)$$

### $$极大似然可以重写为:p(y_{i}|x_{i};\beta)=y_{i}p_{1}(\hat{x};\beta)+(1-y_{i})p_{0}(\hat{x};\beta))$$

### $$综合上面两个式子,最大化对数似然相当于最小化\mathcal{l}(\beta)=\sum^{m}\limits_{i=1}(-y_{i}\beta^{T}\hat{x}+\ln(1+\exp(\beta^{T}\hat{x})))$$

### $$其中\beta为高阶可导连续凸函数,由凸优化理论可知^{2},其最优解可以由梯度下降算法和牛顿法获得,\beta^{\star}=\arg\max\limits_{\beta}(\mathcal{l}(\beta)),其牛顿法迭代公式如下所示:$$

### $$牛顿法:\beta^{t+1}=\beta^{t}-(\frac{\partial^{2}\mathcal{l(\beta)}}{\partial \beta \partial \beta^{T}})^{-1}\frac{\partial \mathcal{l}(\beta)}{\partial \beta},一阶导数:\frac{\partial\mathcal{l(\beta)}}{\partial \beta}=-\sum^{m}\limits_{i=1}\hat{x_{i}}(y_{i}-p_{1}(\hat{x_{i}};\beta)),二阶导数:\frac{\partial^{2}\mathcal{l(\beta)}}{\partial \beta \partial \beta^{T}}=\sum^{m}\limits_{i=1}\hat{x_{i}}\hat{x}_{i}^{T}p_{1}(\hat{x_{i}};\beta)(1-p_{1}(\hat{x_{i}};\beta))$$

### $$梯度下降法:\beta^{t+1}=\beta^{t}-\gamma\frac{\partial \mathcal{l}(\beta)}{\partial\beta}$$

### 3.逻辑回归的一般步骤

- 构建和处理训练数据,将所有特征转换为数值型特征向量
- 确立逻辑回归模型的优化目标,建立逻辑回归模型(确定是二分类还是多分类模型)
- 模型训练,优化和更新模型参数
- 对测试集做出相关预测,并根据预测结果对商品进行排序,返回推荐列表

### 4.逻辑回归的优缺点

- 优点
- 有数学支撑,其假设因变量y服从伯努利分布(0-1分布,n重二项式分布),线性模型假设y服从高斯分布,明显不适用于分类问题,可解释性强,其为每一个特征分配不同的权重,考虑了预测过程中不同特征的重要性不同
- 实现简单,分类时计算量小,速度快,存储资源消耗低,易于理解和实现,广泛应用于工业问题
- 便于观察样本分类概率分数
- 可以结合L2正则化技术来缓解多重共线性问题

- 缺点
- 特征空间较大的时候其性能会有所下降,难以处理大量多类特征或变量
- 表达能力差,无法进行特征交叉、特征筛选等一系列更具可解释性的操作,因而造成信息的损失,容易欠拟合,其准确度一般不高
- 大多处于二分类问题,使用softmax可以处理多分类,但主要用于线性可分的情况
- 对于非线性特征,需要进行特征转换

### 5.LR的演化版本

- GBDT+LR
- GBDT是由多棵回归树组成的树林,后一棵树以前面树林的结果与目标结果的残差作为拟合目标,例如当前有三棵树,其拟合结果为T3(x)=t1(x)+t2(x)+t3(x),目标值为F(x),则当前的残差为R(x)=F(x)-T3(x),第四棵树的拟合目标即为R(x),其每一棵树的生成过程是一棵树的标准的回归树生成过程,因此其回归树中每一个节点的分裂是一个自然的特征选择的过程,而多层节点的结构则对特征进行了有效的自动组合,高效地简化了特征选择和特征组合所带来的繁琐问题;
- 该方法分两步进行,第一步使用GBDT进行特征组合,第二步使用LR进行预估;
- 优点
- 特征工程模型化,减少了复杂的人力劳动(对数据的处理,对模型中特征交叉的设计等);
- 决策树的深度决定了特征交叉的阶数,使用三层就可以完成特征的三阶交叉,其缓解了FM不能进行高阶特征交叉的问题,大大提升了模型的泛化性能;
- 缺点
- GBDT容易发生过拟合,另外使用该方法会丢失大量特征的数值信息;
- 无法完全进行并行训练,更新参数所需的训练时间较长;

- LS-PLM;MLR

- 其在逻辑回归的基础上引入分治的思想,其分两步骤进行,第一步先对全量数据进行聚类,第二步对每一个类别单独进行逻辑回归预测;

- ### $$y=\sum^{m}\limits_{i=1}\pi_{i}(x)\cdot\eta_{i}(x)=\sum^{m}\limits_{i=1}softmax(x)\sigma(x)=\sum^{m}\limits_{i=1}\frac{\exp(\mu_{i}\cdot x)}{\sum^{m}\limits_{j=1}\exp(\mu_{j}\cdot x)}\cdot\frac{1}{1+\exp(-\omega_{i} x)}$$

- 其中m表示聚类的数目,m越大其分的粒度越细,可以较好地平衡模型的拟合和推广能力,m=1时其退化为简单的逻辑回归模型;另外其模型参数规模也随m的增大而线性增长,模型收敛所需的训练样本也随之增长;

- 优点

- 端到端的非线性的拟合能力:其具有样本分片的能力,可以挖掘数据中的非线性模式,省去了大量的人工处理样本和特征工程的过程,使得该算法可以端到端的进行训练,便于用一个全局模型对不同应用领域、业务场景进行统一建模;
- 模型的稀疏性强:其在建模过程中引入了L1和L2范数,可以使得最终训练出来的模型具有较高的稀疏度,使得模型的部署更加轻量级;模型服务过程中仅需使用权重非0的特征,因此稀疏模型也使其在线推断效率更高;
- 模型架构类似于三层神经网络,具备较强的表达能力;

- 缺点

- 模型结构相对简单,有进一步提高的空间

### 6.python实现

- 使用sklearn自带的包,使用案例:[LogisticRegression](https://github.com/QinHsiu/DataScience_Basic/tree/main/02 Sklearn)

```python
from sklearn.linear_model import LogisticRegression
```

- 使用python实现,代码链接:[Logistic_Regression](https://github.com/QinHsiu/DataScience_Basic/tree/main/03 Maching_Learning_in_Action/chapter 05-Logistic_Regression)

### 7.参考资料

[1] 周志华《机器学习》

[2] [Algorithms for Convex Optimization](https://convex-optimization.github.io/)

[3] 王喆《深度学习推荐系统》





16 changes: 16 additions & 0 deletions 03 CTR/Note/PNN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# PNN

### 1.模型解读

### 2.表达式

### 3.一般步骤

### 4.模型的优缺点

### 5.改进版本

### 6.Python实现

### 7.参考资料

1 change: 1 addition & 0 deletions 03 CTR/Note/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

36 changes: 36 additions & 0 deletions 03 CTR/Note/Wide_and_Deep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Wide and Deep做CTR预估

## 1.Wide与Deep的含义

Wide与Deep分别表示模型的两个部分,两者的含义如下所示:

- Wide部分,一个逻辑回归模型,直接对一些数值型特征做LR回归计算
- Deep部分,一个深度神经网络模型,使用

## 2.Wide and Deep表达式

### $$y=W^{T}x+b$$

### $$$$

## 3.Wide and Deep一般步骤

-

## 4.Wide and Deep的优点与缺点

- 优点
- 减少了对人工特征的依赖,使用深度学习模型自动学习特征交叉,提高了模型的泛化能力
- 缺点
- 使用Embedding方式对特征进行降维,在面对数据长尾分布的情况时候会导致一些特征无法被充分学习,也有可能无法学习到一些稀疏的高阶特征,从而导致模型过度泛化

## 5.Wide and Deep后续改进版本

-

## 6.python实现

## 7.参考资料

[1]

Loading