Skip to content

Commit 555cd5d

Browse files
author
shixiaowen03
committed
Deep Interest Network
1 parent 947b5e8 commit 555cd5d

11 files changed

Lines changed: 1160 additions & 0 deletions

File tree

.gitignore

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
.idea/
2+
logs/
3+
.iml
4+
.model
5+
.csv
6+
.xlsx
7+
.json
8+
.pb
9+
*/.txt
10+
*/.class
11+
*/.so
12+
.project
13+
.classpath
14+
.settings
15+
*.jar
16+
target/
17+
*/target
18+
*/.settings
19+
*/.classpath
20+
*/.project
21+
*/*.iml
22+
*/*.ipr
23+
*/*.iws
24+
*/build
25+
.DS_Store
26+
*/logs
27+
*.log
28+
*/scripts/*.pyc
29+
*/scripts/*.*~
30+
src/main/webapp/WEB-INF/classes
31+
src/main/resources/META-INF/persistence.xml
32+
src/main/webapp/META-INF/
33+
deployService.sh
34+
*/src/main/webapp/WEB-INF/decorators/jsdep.inc
35+
*/src/main/webapp/WEB-INF/decorators/jsdep_debug.inc
36+
src/main/webapp/static/js/site_js_dep.js
37+
*/src/main/webapp/WEB-INF/decorators/revision.properties
38+
target
39+
src/main/webapp/static/media/meituan.mp3
40+
*.myeclipse*
41+
*.mymetadata*
42+
43+
/src/test
44+
waimai_d_assistant_poi.iml
45+
train_data/
46+
test_data/
47+
result/
48+
export_ptr_model/
49+
data/
50+
__pycache__/
51+
52+
53+
model/
54+
55+
*/data/
56+
57+
*.pkl
58+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 2
6+
}

basic/AUC-Demo.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import numpy as np
2+
3+
4+
label_all = np.random.randint(0,2,[10,1]).tolist()
5+
pred_all = np.random.random((10,1)).tolist()
6+
7+
print(label_all)
8+
print(pred_all)
9+
10+
posNum = len(list(filter(lambda s: s[0] == 1, label_all)))
11+
12+
if (posNum > 0):
13+
negNum = len(label_all) - posNum
14+
sortedq = sorted(enumerate(pred_all), key=lambda x: x[1])
15+
16+
posRankSum = 0
17+
for j in range(len(pred_all)):
18+
if (label_all[j][0] == 1):
19+
posRankSum += list(map(lambda x: x[0], sortedq)).index(j) + 1
20+
auc = (posRankSum - posNum * (posNum + 1) / 2) / (posNum * negNum)
21+
print("auc:", auc)

0 commit comments

Comments
 (0)