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
6b9a3ffe
Commit
6b9a3ffe
authored
Dec 20, 2019
by
舒皓月
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
20191220_1
parent
38f9b4c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
AUC_time.py
AUC_time.py
+9
-6
No files found.
AUC_time.py
View file @
6b9a3ffe
...
...
@@ -22,6 +22,7 @@ plt.rcParams['font.sans-serif'] = ['SimHei']
plt
.
rcParams
[
'axes.unicode_minus'
]
=
False
plt
.
rcParams
[
'savefig.dpi'
]
=
150
class
AUCMonitor
:
'''
定时间段查看AUC.
...
...
@@ -259,6 +260,7 @@ class AUCMonitor:
return
'-'
.
join
(
data
)
except
:
return
'全渠道'
for
user_group_name
in
info_dict
:
tmp_dict
=
{
'model_name'
:
[
self
.
field_query_name_dict
[
field
]],
'app_type'
:
[
app_type
(
user_group_name
)],
...
...
@@ -288,10 +290,10 @@ class AUCMonitor:
# 获取MongoDB数据.
if
self
.
if_read
:
condition
=
{
'
wf_created_at
'
:
{
'$gte'
:
'
%
s 00:00:00'
%
self
.
date_list
[
0
],
'$lte'
:
'
%
s 00:00:00'
%
self
.
date_list
[
-
1
]},
condition
=
{
'
lam_loan_start_date
'
:
{
'$gte'
:
'
%
s 00:00:00'
%
self
.
date_list
[
0
],
'$lte'
:
'
%
s 00:00:00'
%
self
.
date_list
[
-
1
]},
'passdue_day'
:
{
'$ne'
:
None
}}
fields
=
{
'wf_biz_no'
:
1
,
'
wf_created_at
'
:
1
,
'wf_loan_type'
:
1
,
fields
=
{
'wf_biz_no'
:
1
,
'
lam_loan_start_date
'
:
1
,
'wf_loan_type'
:
1
,
'passdue_day'
:
1
,
'wf_biz_channel'
:
1
,
'applied_channel_cn'
:
1
,
'lam_transaction_status'
:
1
,
'repayment_status'
:
1
,
...
...
@@ -305,12 +307,12 @@ class AUCMonitor:
self
.
mongo_df
=
pd
.
read_csv
(
self
.
save_path
+
'data/mongo_data.csv'
)
self
.
mongo_df
[
'applied_type'
]
=
self
.
mongo_df
[
'wf_loan_type'
]
.
apply
(
func_0
)
self
.
mongo_df
[
'applied_at'
]
=
self
.
mongo_df
[
'
wf_created_at
'
]
self
.
mongo_df
[
'applied_at'
]
=
self
.
mongo_df
[
'
lam_loan_start_date
'
]
self
.
mongo_df
[
'applied_from'
]
=
self
.
mongo_df
[
'wf_biz_channel'
]
self
.
mongo_df
[
'applied_channel'
]
=
self
.
mongo_df
[
'applied_channel_cn'
]
del
self
.
mongo_df
[
'wf_loan_type'
]
del
self
.
mongo_df
[
'
wf_created_at
'
]
del
self
.
mongo_df
[
'
lam_loan_start_date
'
]
del
self
.
mongo_df
[
'wf_biz_channel'
]
del
self
.
mongo_df
[
'applied_channel_cn'
]
...
...
@@ -319,7 +321,8 @@ class AUCMonitor:
self
.
mongo_df
=
self
.
mongo_df
.
loc
[
self
.
mongo_df
[
'applied_type'
]
.
notna
()]
last_day
=
datetime
.
datetime
.
today
()
self
.
mongo_df
[
'deadline'
]
=
self
.
mongo_df
[
'deadline'
]
.
apply
(
lambda
x
:
pd
.
datetime
.
strptime
(
x
,
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
))
self
.
mongo_df
[
'deadline'
]
=
self
.
mongo_df
[
'deadline'
]
.
apply
(
lambda
x
:
pd
.
datetime
.
strptime
(
x
,
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
))
self
.
mongo_df
[
'is_behave'
]
=
self
.
mongo_df
[
'deadline'
]
.
apply
(
lambda
x
:
int
((
last_day
-
x
)
.
days
>
15
))
self
.
mongo_df
=
self
.
mongo_df
.
loc
[
self
.
mongo_df
[
'is_behave'
]
==
1
]
...
...
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