Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleRec
提交
189f986f
P
PaddleRec
项目概览
PaddlePaddle
/
PaddleRec
通知
68
Star
12
Fork
5
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
27
列表
看板
标记
里程碑
合并请求
10
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleRec
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
27
Issue
27
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
189f986f
编写于
6月 02, 2020
作者:
Y
yaoxuefeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add lr fix codes
上级
e0f6e95b
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
11 addition
and
5 deletion
+11
-5
models/rank/deepfm/data/get_slot_data.py
models/rank/deepfm/data/get_slot_data.py
+4
-2
models/rank/logistic_regression/data/get_slot_data.py
models/rank/logistic_regression/data/get_slot_data.py
+7
-2
models/rank/logistic_regression/data/preprocess.py
models/rank/logistic_regression/data/preprocess.py
+0
-1
未找到文件。
models/rank/deepfm/data/get_slot_data.py
浏览文件 @
189f986f
...
...
@@ -12,9 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
yaml
import
yaml
,
os
from
paddlerec.core.reader
import
Reader
from
paddlerec.core.utils
import
envs
import
paddle.fluid.incubate.data_generator
as
dg
try
:
import
cPickle
as
pickle
except
ImportError
:
...
...
@@ -44,7 +46,7 @@ class TrainReader(dg.MultiSlotDataGenerator):
self
.
continuous_range_
=
range
(
1
,
14
)
self
.
categorical_range_
=
range
(
14
,
40
)
# load preprocessed feature dict
self
.
feat_dict_name
=
"
aid
_data/feat_dict_10.pkl2"
self
.
feat_dict_name
=
"
sample
_data/feat_dict_10.pkl2"
self
.
feat_dict_
=
pickle
.
load
(
open
(
self
.
feat_dict_name
,
'rb'
))
def
_process_line
(
self
,
line
):
...
...
models/rank/logistic_regression/data/get_slot_data.py
浏览文件 @
189f986f
...
...
@@ -13,8 +13,12 @@
# limitations under the License.
import
yaml
import
os
from
paddlerec.core.reader
import
Reader
from
paddlerec.core.utils
import
envs
import
paddle.fluid.incubate.data_generator
as
dg
try
:
import
cPickle
as
pickle
except
ImportError
:
...
...
@@ -44,7 +48,7 @@ class TrainReader(dg.MultiSlotDataGenerator):
self
.
continuous_range_
=
range
(
1
,
14
)
self
.
categorical_range_
=
range
(
14
,
40
)
# load preprocessed feature dict
self
.
feat_dict_name
=
"
aid
_data/feat_dict_10.pkl2"
self
.
feat_dict_name
=
"
sample
_data/feat_dict_10.pkl2"
self
.
feat_dict_
=
pickle
.
load
(
open
(
self
.
feat_dict_name
,
'rb'
))
def
_process_line
(
self
,
line
):
...
...
@@ -90,6 +94,7 @@ class TrainReader(dg.MultiSlotDataGenerator):
return
data_iter
reader
=
TrainReader
(
"../config.yaml"
)
reader
=
TrainReader
(
"../config.yaml"
)
# run this file in original folder to find config.yaml
reader
.
init
()
reader
.
run_from_stdin
()
models/rank/logistic_regression/data/preprocess.py
浏览文件 @
189f986f
...
...
@@ -66,7 +66,6 @@ def get_feat_dict():
categorical_range_
=
range
(
14
,
40
)
if
not
os
.
path
.
exists
(
dir_feat_dict_
):
# print('generate a feature dict')
# Count the number of occurrences of discrete features
feat_cnt
=
Counter
()
with
open
(
'train.txt'
,
'r'
)
as
fin
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录