Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
model_mvp
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_mvp
Commits
b5a3f366
Commit
b5a3f366
authored
Apr 22, 2019
by
linfang.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
引入电话邦
parent
dda80e02
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
46 deletions
+49
-46
allocator.py
mvp/allocator.py
+47
-44
dhb.py
mvp/dhb.py
+2
-2
No files found.
mvp/allocator.py
View file @
b5a3f366
...
...
@@ -3,51 +3,54 @@ import numpy as np
import
datetime
from
mvp
import
xgbreport
from
data.analyis
import
datacal
from
mvp
import
dhb
if
__name__
==
'__main__'
:
features
=
[
'third_data_source#xy_pan_newapplyAcredibility'
,
'third_data_source#xy_pan_newapplyAscore'
,
'third_data_source#xy_pan_newconsfinAavgAlimit'
,
'third_data_source#xy_pan_newconsfinAcredibility'
,
'third_data_source#xy_pan_newconsfinAcreditAlimit'
,
'third_data_source#xy_pan_newconsfinAmaxAlimit'
,
'third_data_source#xy_pan_newconsfinAorgAcountq'
,
'third_data_source#xy_pan_newconsfinAorgAcountx'
,
'third_data_source#xy_pan_newconsfinAproductAcount'
,
'third_data_source#xy_pan_newhistoryAfailAfee'
,
'third_data_source#xy_pan_newhistoryAsucAfee'
,
'third_data_source#xy_pan_newlatestAoneAmonthAfail'
,
'third_data_source#xy_pan_newlatestAoneAmonthAsuc'
,
'third_data_source#xy_pan_newlatestAoneAmonthd'
,
'third_data_source#xy_pan_newlatestAoneAmonthj'
,
'third_data_source#xy_pan_newlatestAqueryAtime'
,
'third_data_source#xy_pan_newlatestAsixAmontha'
,
'third_data_source#xy_pan_newlatestAsixAmonthv'
,
'third_data_source#xy_pan_newlatestAthreeAmonthb'
,
'third_data_source#xy_pan_newlatestAthreeAmonthf'
,
'third_data_source#xy_pan_newloansAavgAlimit'
,
'third_data_source#xy_pan_newloansAcashAcount'
,
'third_data_source#xy_pan_newloansAcount'
,
'third_data_source#xy_pan_newloansAcredibilityh'
,
'third_data_source#xy_pan_newloansAcredibilitys'
,
'third_data_source#xy_pan_newloansAcreditAlimit'
,
'third_data_source#xy_pan_newloansAlatestAtime'
,
'third_data_source#xy_pan_newloansAlongAtime'
,
'third_data_source#xy_pan_newloansAmaxAlimit'
,
'third_data_source#xy_pan_newloansAorgAcounta'
,
'third_data_source#xy_pan_newloansAorgAcountg'
,
'third_data_source#xy_pan_newloansAoverdueAcount'
,
'third_data_source#xy_pan_newloansAproductAcount'
,
'third_data_source#xy_pan_newloansAscore'
,
'third_data_source#xy_pan_newloansAsettleAcount'
,
'third_data_source#xy_pan_newqueryAcashAcount'
,
'third_data_source#xy_pan_newqueryAfinanceAcount'
,
'third_data_source#xy_pan_newqueryAorgAcount'
,
'third_data_source#xy_pan_newqueryAsumAcount'
]
label
=
'y'
df
=
pd
.
read_csv
(
'test.csv'
)
# features=[
# 'third_data_source#xy_pan_newapplyAcredibility',
# 'third_data_source#xy_pan_newapplyAscore',
# 'third_data_source#xy_pan_newconsfinAavgAlimit',
# 'third_data_source#xy_pan_newconsfinAcredibility',
# 'third_data_source#xy_pan_newconsfinAcreditAlimit',
# 'third_data_source#xy_pan_newconsfinAmaxAlimit',
# 'third_data_source#xy_pan_newconsfinAorgAcountq',
# 'third_data_source#xy_pan_newconsfinAorgAcountx',
# 'third_data_source#xy_pan_newconsfinAproductAcount',
# 'third_data_source#xy_pan_newhistoryAfailAfee',
# 'third_data_source#xy_pan_newhistoryAsucAfee',
# 'third_data_source#xy_pan_newlatestAoneAmonthAfail',
# 'third_data_source#xy_pan_newlatestAoneAmonthAsuc',
# 'third_data_source#xy_pan_newlatestAoneAmonthd',
# 'third_data_source#xy_pan_newlatestAoneAmonthj',
# 'third_data_source#xy_pan_newlatestAqueryAtime',
# 'third_data_source#xy_pan_newlatestAsixAmontha',
# 'third_data_source#xy_pan_newlatestAsixAmonthv',
# 'third_data_source#xy_pan_newlatestAthreeAmonthb',
# 'third_data_source#xy_pan_newlatestAthreeAmonthf',
# 'third_data_source#xy_pan_newloansAavgAlimit',
# 'third_data_source#xy_pan_newloansAcashAcount',
# 'third_data_source#xy_pan_newloansAcount',
# 'third_data_source#xy_pan_newloansAcredibilityh',
# 'third_data_source#xy_pan_newloansAcredibilitys',
# 'third_data_source#xy_pan_newloansAcreditAlimit',
# 'third_data_source#xy_pan_newloansAlatestAtime',
# 'third_data_source#xy_pan_newloansAlongAtime',
# 'third_data_source#xy_pan_newloansAmaxAlimit',
# 'third_data_source#xy_pan_newloansAorgAcounta',
# 'third_data_source#xy_pan_newloansAorgAcountg',
# 'third_data_source#xy_pan_newloansAoverdueAcount',
# 'third_data_source#xy_pan_newloansAproductAcount',
# 'third_data_source#xy_pan_newloansAscore',
# 'third_data_source#xy_pan_newloansAsettleAcount',
# 'third_data_source#xy_pan_newqueryAcashAcount',
# 'third_data_source#xy_pan_newqueryAfinanceAcount',
# 'third_data_source#xy_pan_newqueryAorgAcount',
# 'third_data_source#xy_pan_newqueryAsumAcount'
# ]
dhb
=
dhb
.
dhb
()
df
=
dhb
.
dhb_features_extract
()
label
=
'target'
# df=pd.read_csv('test.csv')
dftrain
,
dftest
=
datacal
.
split_train_val
(
df
,
trainsplit
=
'timeSeries'
,
trainsplitRatio
=
0.8
,
sort_col
=
'applied_at'
)
xgbreport
.
report
(
dftrain
,
dftest
,
features
,
label
,
''
,
'tmp.doc'
)
xgbreport
.
report
(
dftrain
,
dftest
,
dhb
.
features
,
label
,
''
,
'tmp.doc'
)
mvp/dhb.py
View file @
b5a3f366
...
...
@@ -18,7 +18,7 @@ API :
'''
class
dhb
()
:
class
dhb
:
# features as Series format
features
=
[
'dhb_last_30_and_60_days_dun_call_avg_duration'
,
'dhb_last_30_and_60_days_dun_call_duration_above60'
,
...
...
@@ -249,7 +249,7 @@ class dhb():
dhb_loan
.
loc
[
dhb_loan
.
dhb_overview_dun_call_tel_total_nums
>=
22
,
"dhb_overview_dun_call_tel_total_nums"
]
=
22
dhb_loan
.
loc
[
dhb_loan
.
dhb_last_30_days_dun_call_total_duration
>=
1100
,
"dhb_last_30_days_dun_call_total_duration"
]
=
1100
dhb_loan
.
loc
[
dhb_loan
.
dhb_last_two_weeks_ntdun_call_in_duration
>=
300
,
"dhb_last_two_weeks_ntdun_call_in_duration"
]
=
300
dhb_loan
.
to_csv
(
"./dhb_loan_sample——"
+
str
(
datetime
.
date
.
today
())
+
".csv"
)
#
dhb_loan.to_csv("./dhb_loan_sample——"+str(datetime.date.today())+".csv")
print
(
datetime
.
time
.
strftime
(
'
%
Y.
%
m.
%
d
%
H:
%
M:
%
S'
,
datetime
.
time
.
localtime
(
datetime
.
time
.
time
()))
+
"提取了dhb {}+ "
.
format
(
str
(
self
.
overdue_days
))
+
self
.
start_time_period
+
"to"
+
self
.
end_time_period
+
"时段样本"
)
return
dhb_loan
...
...
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