Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
06864b6d
Commit
06864b6d
authored
Dec 26, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add print
parent
4fb45e15
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
ffm.py
tensnsorflow/ffm.py
+17
-1
No files found.
tensnsorflow/ffm.py
View file @
06864b6d
...
...
@@ -218,15 +218,23 @@ def get_predict_set(ucity_id,model,ccity_name,manufacturer,channel):
print
(
"before filter:"
)
print
(
df
.
shape
)
print
(
df
.
loc
[
df
[
"device_id"
]
==
"358035085192742"
]
.
shape
)
df
=
df
[
df
[
"ucity_id"
]
.
isin
(
ucity_id
)]
print
(
"after ucity filter:"
)
print
(
df
.
shape
)
print
(
df
.
loc
[
df
[
"device_id"
]
==
"358035085192742"
]
.
shape
)
df
=
df
[
df
[
"ccity_name"
]
.
isin
(
ccity_name
)]
print
(
"after ccity_name filter:"
)
print
(
df
.
shape
)
print
(
df
.
loc
[
df
[
"device_id"
]
==
"358035085192742"
]
.
shape
)
df
=
df
[
df
[
"manufacturer"
]
.
isin
(
manufacturer
)]
print
(
"after manufacturer filter:"
)
print
(
df
.
shape
)
print
(
df
.
loc
[
df
[
"device_id"
]
==
"358035085192742"
]
.
shape
)
df
=
df
[
df
[
"channel"
]
.
isin
(
channel
)]
print
(
"after channel filter:"
)
print
(
df
.
shape
)
print
(
df
.
loc
[
df
[
"device_id"
]
==
"358035085192742"
]
.
shape
)
df
[
"cid_id"
]
=
df
[
"cid_id"
]
.
astype
(
"str"
)
df
[
"clevel1_id"
]
=
df
[
"clevel1_id"
]
.
astype
(
"str"
)
df
[
"top"
]
=
df
[
"top"
]
.
astype
(
"str"
)
...
...
@@ -251,15 +259,23 @@ def get_predict_set(ucity_id,model,ccity_name,manufacturer,channel):
df
[
"data"
]
=
df
[
"seq"
]
.
str
.
cat
(
df
[
"data"
],
sep
=
","
)
df
=
df
.
drop
([
0
,
"seq"
],
axis
=
1
)
print
(
df
.
head
())
print
(
"after transform"
)
print
(
df
.
shape
)
print
(
df
.
loc
[
df
[
"device_id"
]
==
"358035085192742"
]
.
shape
)
native_pre
=
df
[
df
[
"label"
]
==
"0"
]
native_pre
=
native_pre
.
drop
(
"label"
,
axis
=
1
)
print
(
"native"
)
print
(
native_pre
.
shape
)
print
(
native_pre
.
loc
[
native_pre
[
"device_id"
]
==
"358035085192742"
]
.
shape
)
native_pre
.
to_csv
(
path
+
"native.csv"
,
sep
=
"
\t
"
,
index
=
False
)
# print("native_pre shape")
# print(native_pre.shape)
nearby_pre
=
df
[
df
[
"label"
]
==
"1"
]
nearby_pre
=
nearby_pre
.
drop
(
"label"
,
axis
=
1
)
print
(
"nearby"
)
print
(
nearby_pre
.
shape
)
print
(
nearby_pre
.
loc
[
nearby_pre
[
"device_id"
]
==
"358035085192742"
]
.
shape
)
nearby_pre
.
to_csv
(
path
+
"nearby.csv"
,
sep
=
"
\t
"
,
index
=
False
)
# print("nearby_pre shape")
# print(nearby_pre.shape)
...
...
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