Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
model_monitoring_monthly
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
decision-science
model_monitoring_monthly
Commits
b8b0eeee
Commit
b8b0eeee
authored
Mar 31, 2020
by
smileshy777
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
20200331
parent
850ced25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
PSI_time.py
PSI_time.py
+7
-0
No files found.
PSI_time.py
View file @
b8b0eeee
...
@@ -189,7 +189,10 @@ class PSIMonitor:
...
@@ -189,7 +189,10 @@ class PSIMonitor:
# 分离数据.
# 分离数据.
df_copy
=
self
.
mongo_df
[[
field
,
'date_label'
,
'applied_type'
,
'applied_channel'
,
'applied_at'
]]
.
copy
()
df_copy
=
self
.
mongo_df
[[
field
,
'date_label'
,
'applied_type'
,
'applied_channel'
,
'applied_at'
]]
.
copy
()
if
field
==
'guomei_audit_info#creditScore'
:
df_copy
[
field
]
=
df_copy
[
field
]
.
apply
(
lambda
x
:
x
if
0
<
x
<
1
else
np
.
nan
)
df_copy
=
df_copy
[
df_copy
[
field
]
.
notna
()]
df_copy
=
df_copy
[
df_copy
[
field
]
.
notna
()]
if
df_copy
.
shape
[
0
]
==
0
:
if
df_copy
.
shape
[
0
]
==
0
:
print
(
'仍在空跑.'
)
print
(
'仍在空跑.'
)
return
None
return
None
...
@@ -343,7 +346,11 @@ class PSIMonitor:
...
@@ -343,7 +346,11 @@ class PSIMonitor:
# 清洗数据.
# 清洗数据.
def
clean_data
(
data
):
def
clean_data
(
data
):
if
pd
.
isnull
(
data
):
return
np
.
nan
try
:
try
:
if
data
<=
0
or
data
>
999999
:
return
np
.
nan
return
float
(
data
)
return
float
(
data
)
except
:
except
:
return
np
.
nan
return
np
.
nan
...
...
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