Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm_strategy_cvr
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rank
gm_strategy_cvr
Commits
d4f9db15
Commit
d4f9db15
authored
Sep 03, 2020
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove cross field for tractate
parent
e31cd2ac
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
56 deletions
+56
-56
tractate_fe.py
src/models/esmm/fe/tractate_fe.py
+42
-42
tractate_model.py
src/models/esmm/tractate_model.py
+14
-14
No files found.
src/models/esmm/fe/tractate_fe.py
View file @
d4f9db15
...
...
@@ -288,20 +288,20 @@ CATEGORICAL_COLUMNS = [
"click_tractate_id5"
,
"is_related_service"
,
"service_city"
,
"device_fd2"
,
"device_sd2"
,
"device_fs2"
,
"device_ss2"
,
"device_fp2"
,
"device_sp2"
,
"device_p2"
,
"device_fd3"
,
"device_sd3"
,
"device_fs3"
,
"device_ss3"
,
"device_fp3"
,
"device_sp3"
,
"device_p3"
,
#
"device_fd2",
#
"device_sd2",
#
"device_fs2",
#
"device_ss2",
#
"device_fp2",
#
"device_sp2",
#
"device_p2",
#
"device_fd3",
#
"device_sd3",
#
"device_fs3",
#
"device_ss3",
#
"device_fp3",
#
"device_sp3",
#
"device_p3",
]
CROSS_COLUMNS
=
[
[
"device_fd"
,
"content_fd"
],
...
...
@@ -434,21 +434,21 @@ def join_features(device_df, tractate_df, cc_df):
df
[
"device_sp"
]
=
df
[
"second_positions_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
0
))
df
[
"device_p"
]
=
df
[
"projects_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
0
))
df
[
"device_fd2"
]
=
df
[
"first_demands_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
1
))
df
[
"device_sd2"
]
=
df
[
"second_demands_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
1
))
df
[
"device_fs2"
]
=
df
[
"first_solutions_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
1
))
df
[
"device_ss2"
]
=
df
[
"second_solutions_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
1
))
df
[
"device_fp2"
]
=
df
[
"first_positions_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
1
))
df
[
"device_sp2"
]
=
df
[
"second_positions_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
1
))
df
[
"device_p2"
]
=
df
[
"projects_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
1
))
#
df["device_fd2"] = df["first_demands_x"].apply(lambda x: nth_element(x, 1))
#
df["device_sd2"] = df["second_demands_x"].apply(lambda x: nth_element(x, 1))
#
df["device_fs2"] = df["first_solutions_x"].apply(lambda x: nth_element(x, 1))
#
df["device_ss2"] = df["second_solutions_x"].apply(lambda x: nth_element(x, 1))
#
df["device_fp2"] = df["first_positions_x"].apply(lambda x: nth_element(x, 1))
#
df["device_sp2"] = df["second_positions_x"].apply(lambda x: nth_element(x, 1))
#
df["device_p2"] = df["projects_x"].apply(lambda x: nth_element(x, 1))
df
[
"device_fd3"
]
=
df
[
"first_demands_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
2
))
df
[
"device_sd3"
]
=
df
[
"second_demands_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
2
))
df
[
"device_fs3"
]
=
df
[
"first_solutions_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
2
))
df
[
"device_ss3"
]
=
df
[
"second_solutions_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
2
))
df
[
"device_fp3"
]
=
df
[
"first_positions_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
2
))
df
[
"device_sp3"
]
=
df
[
"second_positions_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
2
))
df
[
"device_p3"
]
=
df
[
"projects_x"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
2
))
#
df["device_fd3"] = df["first_demands_x"].apply(lambda x: nth_element(x, 2))
#
df["device_sd3"] = df["second_demands_x"].apply(lambda x: nth_element(x, 2))
#
df["device_fs3"] = df["first_solutions_x"].apply(lambda x: nth_element(x, 2))
#
df["device_ss3"] = df["second_solutions_x"].apply(lambda x: nth_element(x, 2))
#
df["device_fp3"] = df["first_positions_x"].apply(lambda x: nth_element(x, 2))
#
df["device_sp3"] = df["second_positions_x"].apply(lambda x: nth_element(x, 2))
#
df["device_p3"] = df["projects_x"].apply(lambda x: nth_element(x, 2))
df
[
"content_fd"
]
=
df
[
"first_demands_y"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
0
))
df
[
"content_sd"
]
=
df
[
"second_demands_y"
]
.
apply
(
lambda
x
:
nth_element
(
x
,
0
))
...
...
@@ -538,20 +538,20 @@ def device_tractate_fe(device_id, tractate_ids, device_dict, tractate_dict):
device_info
[
"device_fp"
]
=
nth_element
(
device_fp
,
0
)
device_info
[
"device_sp"
]
=
nth_element
(
device_sp
,
0
)
device_info
[
"device_p"
]
=
nth_element
(
device_p
,
0
)
device_info
[
"device_fd2"
]
=
nth_element
(
device_fd
,
1
)
device_info
[
"device_sd2"
]
=
nth_element
(
device_sd
,
1
)
device_info
[
"device_fs2"
]
=
nth_element
(
device_fs
,
1
)
device_info
[
"device_ss2"
]
=
nth_element
(
device_ss
,
1
)
device_info
[
"device_fp2"
]
=
nth_element
(
device_fp
,
1
)
device_info
[
"device_sp2"
]
=
nth_element
(
device_sp
,
1
)
device_info
[
"device_p2"
]
=
nth_element
(
device_p
,
1
)
device_info
[
"device_fd3"
]
=
nth_element
(
device_fd
,
2
)
device_info
[
"device_sd3"
]
=
nth_element
(
device_sd
,
2
)
device_info
[
"device_fs3"
]
=
nth_element
(
device_fs
,
2
)
device_info
[
"device_ss3"
]
=
nth_element
(
device_ss
,
2
)
device_info
[
"device_fp3"
]
=
nth_element
(
device_fp
,
2
)
device_info
[
"device_sp3"
]
=
nth_element
(
device_sp
,
2
)
device_info
[
"device_p3"
]
=
nth_element
(
device_p
,
2
)
#
device_info["device_fd2"] = nth_element(device_fd, 1)
#
device_info["device_sd2"] = nth_element(device_sd, 1)
#
device_info["device_fs2"] = nth_element(device_fs, 1)
#
device_info["device_ss2"] = nth_element(device_ss, 1)
#
device_info["device_fp2"] = nth_element(device_fp, 1)
#
device_info["device_sp2"] = nth_element(device_sp, 1)
#
device_info["device_p2"] = nth_element(device_p, 1)
#
device_info["device_fd3"] = nth_element(device_fd, 2)
#
device_info["device_sd3"] = nth_element(device_sd, 2)
#
device_info["device_fs3"] = nth_element(device_fs, 2)
#
device_info["device_ss3"] = nth_element(device_ss, 2)
#
device_info["device_fp3"] = nth_element(device_fp, 2)
#
device_info["device_sp3"] = nth_element(device_sp, 2)
#
device_info["device_p3"] = nth_element(device_p, 2)
tractate_lst
=
[]
tractate_ids_res
=
[]
for
id
in
tractate_ids
:
...
...
src/models/esmm/tractate_model.py
View file @
d4f9db15
...
...
@@ -167,20 +167,20 @@ _categorical_columns = [
"click_tractate_id4"
,
"click_tractate_id5"
,
"service_city"
,
"device_fd2"
,
"device_sd2"
,
"device_fs2"
,
"device_ss2"
,
"device_fp2"
,
"device_sp2"
,
"device_p2"
,
"device_fd3"
,
"device_sd3"
,
"device_fs3"
,
"device_ss3"
,
"device_fp3"
,
"device_sp3"
,
"device_p3"
,
#
"device_fd2",
#
"device_sd2",
#
"device_fs2",
#
"device_ss2",
#
"device_fp2",
#
"device_sp2",
#
"device_p2",
#
"device_fd3",
#
"device_sd3",
#
"device_fs3",
#
"device_ss3",
#
"device_fp3",
#
"device_sp3",
#
"device_p3",
]
PREDICTION_ALL_COLUMNS
=
_int_columns
+
_float_columns
+
_categorical_columns
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment