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
38f9b4c7
Commit
38f9b4c7
authored
Dec 20, 2019
by
舒皓月
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
20191220_0
parent
6c7c84f4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
AUC_time.py
AUC_time.py
+7
-1
No files found.
AUC_time.py
View file @
38f9b4c7
...
@@ -294,7 +294,8 @@ class AUCMonitor:
...
@@ -294,7 +294,8 @@ class AUCMonitor:
fields
=
{
'wf_biz_no'
:
1
,
'wf_created_at'
:
1
,
'wf_loan_type'
:
1
,
fields
=
{
'wf_biz_no'
:
1
,
'wf_created_at'
:
1
,
'wf_loan_type'
:
1
,
'passdue_day'
:
1
,
'wf_biz_channel'
:
1
,
'applied_channel_cn'
:
1
,
'passdue_day'
:
1
,
'wf_biz_channel'
:
1
,
'applied_channel_cn'
:
1
,
'lam_transaction_status'
:
1
,
'lam_transaction_status'
:
1
,
'repayment_status'
:
1
'repayment_status'
:
1
,
'deadline'
:
1
}
}
for
f
in
self
.
field_query_list
:
# 加入Excel中预置的模型分名称
for
f
in
self
.
field_query_list
:
# 加入Excel中预置的模型分名称
fields
[
f
]
=
1
fields
[
f
]
=
1
...
@@ -302,6 +303,7 @@ class AUCMonitor:
...
@@ -302,6 +303,7 @@ class AUCMonitor:
print
(
'MongoDB数据获取成功.'
)
print
(
'MongoDB数据获取成功.'
)
self
.
mongo_df
.
to_csv
(
self
.
save_path
+
'data/mongo_data.csv'
,
index
=
False
)
self
.
mongo_df
.
to_csv
(
self
.
save_path
+
'data/mongo_data.csv'
,
index
=
False
)
self
.
mongo_df
=
pd
.
read_csv
(
self
.
save_path
+
'data/mongo_data.csv'
)
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_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
[
'wf_created_at'
]
self
.
mongo_df
[
'applied_from'
]
=
self
.
mongo_df
[
'wf_biz_channel'
]
self
.
mongo_df
[
'applied_from'
]
=
self
.
mongo_df
[
'wf_biz_channel'
]
...
@@ -315,7 +317,11 @@ class AUCMonitor:
...
@@ -315,7 +317,11 @@ class AUCMonitor:
else
:
else
:
self
.
mongo_df
=
pd
.
read_csv
(
self
.
save_path
+
'data/mongo_data.csv'
)
self
.
mongo_df
=
pd
.
read_csv
(
self
.
save_path
+
'data/mongo_data.csv'
)
self
.
mongo_df
=
self
.
mongo_df
.
loc
[
self
.
mongo_df
[
'applied_type'
]
.
notna
()]
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
[
'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
]
# 定义逾期用户.
# 定义逾期用户.
def
overdue
(
data
):
def
overdue
(
data
):
...
...
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