Commit b5a3f366 authored by linfang.wang's avatar linfang.wang

引入电话邦

parent dda80e02
...@@ -3,51 +3,54 @@ import numpy as np ...@@ -3,51 +3,54 @@ import numpy as np
import datetime import datetime
from mvp import xgbreport from mvp import xgbreport
from data.analyis import datacal from data.analyis import datacal
from mvp import dhb
if __name__ == '__main__': if __name__ == '__main__':
features=[ # features=[
'third_data_source#xy_pan_newapplyAcredibility', # 'third_data_source#xy_pan_newapplyAcredibility',
'third_data_source#xy_pan_newapplyAscore', # 'third_data_source#xy_pan_newapplyAscore',
'third_data_source#xy_pan_newconsfinAavgAlimit', # 'third_data_source#xy_pan_newconsfinAavgAlimit',
'third_data_source#xy_pan_newconsfinAcredibility', # 'third_data_source#xy_pan_newconsfinAcredibility',
'third_data_source#xy_pan_newconsfinAcreditAlimit', # 'third_data_source#xy_pan_newconsfinAcreditAlimit',
'third_data_source#xy_pan_newconsfinAmaxAlimit', # 'third_data_source#xy_pan_newconsfinAmaxAlimit',
'third_data_source#xy_pan_newconsfinAorgAcountq', # 'third_data_source#xy_pan_newconsfinAorgAcountq',
'third_data_source#xy_pan_newconsfinAorgAcountx', # 'third_data_source#xy_pan_newconsfinAorgAcountx',
'third_data_source#xy_pan_newconsfinAproductAcount', # 'third_data_source#xy_pan_newconsfinAproductAcount',
'third_data_source#xy_pan_newhistoryAfailAfee', # 'third_data_source#xy_pan_newhistoryAfailAfee',
'third_data_source#xy_pan_newhistoryAsucAfee', # 'third_data_source#xy_pan_newhistoryAsucAfee',
'third_data_source#xy_pan_newlatestAoneAmonthAfail', # 'third_data_source#xy_pan_newlatestAoneAmonthAfail',
'third_data_source#xy_pan_newlatestAoneAmonthAsuc', # 'third_data_source#xy_pan_newlatestAoneAmonthAsuc',
'third_data_source#xy_pan_newlatestAoneAmonthd', # 'third_data_source#xy_pan_newlatestAoneAmonthd',
'third_data_source#xy_pan_newlatestAoneAmonthj', # 'third_data_source#xy_pan_newlatestAoneAmonthj',
'third_data_source#xy_pan_newlatestAqueryAtime', # 'third_data_source#xy_pan_newlatestAqueryAtime',
'third_data_source#xy_pan_newlatestAsixAmontha', # 'third_data_source#xy_pan_newlatestAsixAmontha',
'third_data_source#xy_pan_newlatestAsixAmonthv', # 'third_data_source#xy_pan_newlatestAsixAmonthv',
'third_data_source#xy_pan_newlatestAthreeAmonthb', # 'third_data_source#xy_pan_newlatestAthreeAmonthb',
'third_data_source#xy_pan_newlatestAthreeAmonthf', # 'third_data_source#xy_pan_newlatestAthreeAmonthf',
'third_data_source#xy_pan_newloansAavgAlimit', # 'third_data_source#xy_pan_newloansAavgAlimit',
'third_data_source#xy_pan_newloansAcashAcount', # 'third_data_source#xy_pan_newloansAcashAcount',
'third_data_source#xy_pan_newloansAcount', # 'third_data_source#xy_pan_newloansAcount',
'third_data_source#xy_pan_newloansAcredibilityh', # 'third_data_source#xy_pan_newloansAcredibilityh',
'third_data_source#xy_pan_newloansAcredibilitys', # 'third_data_source#xy_pan_newloansAcredibilitys',
'third_data_source#xy_pan_newloansAcreditAlimit', # 'third_data_source#xy_pan_newloansAcreditAlimit',
'third_data_source#xy_pan_newloansAlatestAtime', # 'third_data_source#xy_pan_newloansAlatestAtime',
'third_data_source#xy_pan_newloansAlongAtime', # 'third_data_source#xy_pan_newloansAlongAtime',
'third_data_source#xy_pan_newloansAmaxAlimit', # 'third_data_source#xy_pan_newloansAmaxAlimit',
'third_data_source#xy_pan_newloansAorgAcounta', # 'third_data_source#xy_pan_newloansAorgAcounta',
'third_data_source#xy_pan_newloansAorgAcountg', # 'third_data_source#xy_pan_newloansAorgAcountg',
'third_data_source#xy_pan_newloansAoverdueAcount', # 'third_data_source#xy_pan_newloansAoverdueAcount',
'third_data_source#xy_pan_newloansAproductAcount', # 'third_data_source#xy_pan_newloansAproductAcount',
'third_data_source#xy_pan_newloansAscore', # 'third_data_source#xy_pan_newloansAscore',
'third_data_source#xy_pan_newloansAsettleAcount', # 'third_data_source#xy_pan_newloansAsettleAcount',
'third_data_source#xy_pan_newqueryAcashAcount', # 'third_data_source#xy_pan_newqueryAcashAcount',
'third_data_source#xy_pan_newqueryAfinanceAcount', # 'third_data_source#xy_pan_newqueryAfinanceAcount',
'third_data_source#xy_pan_newqueryAorgAcount', # 'third_data_source#xy_pan_newqueryAorgAcount',
'third_data_source#xy_pan_newqueryAsumAcount' # 'third_data_source#xy_pan_newqueryAsumAcount'
] # ]
label='y' dhb = dhb.dhb()
df=pd.read_csv('test.csv') 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') 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')
...@@ -18,7 +18,7 @@ API : ...@@ -18,7 +18,7 @@ API :
''' '''
class dhb(): class dhb:
# features as Series format # features as Series format
features = ['dhb_last_30_and_60_days_dun_call_avg_duration', features = ['dhb_last_30_and_60_days_dun_call_avg_duration',
'dhb_last_30_and_60_days_dun_call_duration_above60', 'dhb_last_30_and_60_days_dun_call_duration_above60',
...@@ -249,7 +249,7 @@ class dhb(): ...@@ -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_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_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.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 + "时段样本") 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 return dhb_loan
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment