Model Deployment

Back To Index

4_model_deployment
In [1]:
###################################################
#  Filename : 4_model_deployment_1                #
#  Purpose : To deploy the model for regular      #
#       use by internal clients.                  #
#  Author : Niel S.                               #
#  (c) The English Tea Company LLC                #
###################################################

import sys
sys.path.append('C:\\Users\\singa72\\Desktop\\Euler\\')

import Euler as Eu
from matplotlib import pyplot as plt

data_folder = 'C:\\Users\\singa72\\Desktop\\Tutorial2\\bank-additional\\bank-additional\\'
data_work   = data_folder+'data_work.db'

from sklearn.linear_model import LogisticRegression
from sklearn import metrics
from sklearn import svm

def main():
    conn = Eu.connection(data_work)
    
    vvarsL = ('marital','job','education', 'deflt', 
        'housing','contact','campaign','month', 'loan',
        'day_of_week','poutcome','previous',
        'age','duration','pdays','emp_var_rate',
        'cons_price_idx','cons_conf_idx',
        'euribor_m','nr_employed')


    try:
        
        #D A T A   I N S P E C T I O N
        #The clients to be approached
        file = data_folder +'new_clients.csv'
    
        #Dump file into sqlite database
        pcsv = Eu.pycsv_reader(file)
        pcsv.to_database(tabName='clients',database=data_work,verbose=False)
    
        #See if the data looks okay
        Eu.run('select * from clients limit 5',conn)
 

        # D A T A  E N C O D I N G
        
        #Note : Encoding is done using same 
         # dictionaries that were created during training
         # phase.
         
        vvars = ',\n'.join(vvarsL)
        
        sql = '''
        DROP TABLE IF EXISTS client_coded;
        CREATE TABLE client_coded as

        select
        rowid rownum,
        ?variable_list?
        from clients
        '''.replace('?variable_list?',vvars)
        
        
        Eu.execute(sql,conn)
        
        
        #Now replace actual values by codes.
        ##Note there are better/faster ways of doing 
        ###following but this one is the easiest to 
        ####understand.
        sql = '''
        UPDATE client_coded 
        SET ?var? = 1.0*(select code
        from ?var?_coding  
        where client_coded.?var?=?var?_coding.?var?) 
        '''
        
        for v in vvarsL:
            sqli = sql.replace('?var?',v)
            Eu.execute(sqli,conn)
            Eu.run('select * from client_coded limit 10',conn=conn)
        
        ##P R E D  I C T I O N  A N D  S C O R I N G  B A C K
        
        #Loading the data
        
        xvars_list = ['1.0*'+v for v in vvarsL]
        xvars = ','.join(xvars_list)
        
        sql = '''
        SELECT 1*rownum,?vvars?
        FROM client_coded
        order by rownum desc
        '''.replace('?vvars?',xvars)
        
        print (sql)
        new_clients = Eu.get_bysql(sql,conn)
        
        ####First column in each row is rownum. 
        ####We need to take it out
        new_clients_id = [row[0] for row in new_clients]
        new_clients = [row[1:] for row in new_clients]
        
        
        #Load the trained model
        from sklearn.externals import joblib
        f = data_folder+'logistic_regression.pkl'
        clf_load = joblib.load(f) 
        
        #Now is the time to score.
        new_clients_y = clf_load.predict_proba(new_clients)[:,1]
        
        #Fetch the data in [[row1],[row2]...] format        
        clients = Eu.get_bysql('''
                               select * from clients order by rowid
                               ''',conn)
        
        
        #Attach the predicted probability score to each row.
        clients= [row+[prob] for row,prob in zip(clients,new_clients_y)]


        #outfile.
        ofile = data_folder+'score_new_clients.csv'
        ofile = open(ofile,'w')
        for client in clients:
            client = [str(c) for c in client]+['\n']
            client = ','.join(client)
            ofile.write(client)
        

    
    except Exception as err:
        Eu.print_error(err)
    finally:
        pcsv.close()
        conn.close()
        ofile.close()





if __name__ == '__main__':
    main()
************************************************
*                    EULER                     *
*    A SQLITE POWERED DATA SCIENCE TOOLKIT     *
*          SINGH.AP79@GMAIL.NOSPAM.COM         *
************************************************

drop table if exists clients
Here!
Done
Lines Read:  0
Lines Read:  100
Lines Read:  200
Lines Read:  300
Lines Read:  400
================================================================================================================================================================================
age,job,marital,education,deflt,housing,loan,contact,month,day_of_week,duration,campaign,pdays,previous,poutcome,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
================================================================================================================================================================================
42,blue-collar,married,basic.6y,unknown,yes,no,telephone,jun,thu,108,4,999,0,nonexistent,1.4,94.465,-41.8,4.961,5228.1
32,admin.,single,high.school,no,yes,no,cellular,nov,mon,92,1,999,1,failure,-0.1,93.2,-42,4.191,5195.8
33,management,married,university.degree,no,yes,no,cellular,nov,wed,418,2,999,0,nonexistent,-0.1,93.2,-42,4.12,5195.8
48,admin.,divorced,university.degree,no,yes,no,cellular,jul,wed,121,3,999,0,nonexistent,1.4,93.918,-42.7,4.963,5228.1
51,services,married,high.school,unknown,yes,yes,cellular,jul,fri,239,5,999,0,nonexistent,1.4,93.918,-42.7,4.962,5228.1
================================================================================================================================================================================


        DROP TABLE IF EXISTS client_coded

        CREATE TABLE client_coded as

        select
        rowid rownum,
        marital,
job,
education,
deflt,
housing,
contact,
campaign,
month,
loan,
day_of_week,
poutcome,
previous,
age,
duration,
pdays,
emp_var_rate,
cons_price_idx,
cons_conf_idx,
euribor_m,
nr_employed
        from clients
        

        UPDATE client_coded 
        SET marital = 1.0*(select code
        from marital_coding  
        where client_coded.marital=marital_coding.marital) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,blue-collar,basic.6y,unknown,yes,telephone,4,jun,no,thu,nonexistent,0,42,108,999,1.4,94.465,-41.8,4.961,5228.1
2,0.14,admin.,high.school,no,yes,cellular,1,nov,no,mon,failure,1,32,92,999,-0.1,93.2,-42,4.191,5195.8
3,0.1016,management,university.degree,no,yes,cellular,2,nov,no,wed,nonexistent,0,33,418,999,-0.1,93.2,-42,4.12,5195.8
4,0.1032,admin.,university.degree,no,yes,cellular,3,jul,no,wed,nonexistent,0,48,121,999,1.4,93.918,-42.7,4.963,5228.1
5,0.1016,services,high.school,unknown,yes,cellular,5,jul,yes,fri,nonexistent,0,51,239,999,1.4,93.918,-42.7,4.962,5228.1
6,0.1032,technician,professional.course,no,yes,cellular,1,nov,yes,thu,nonexistent,0,45,705,999,-0.1,93.2,-42,4.076,5195.8
7,0.1016,management,university.degree,no,no,cellular,1,nov,no,thu,nonexistent,0,44,277,999,-0.1,93.2,-42,4.076,5195.8
8,0.1016,admin.,high.school,no,yes,cellular,2,may,no,fri,nonexistent,0,35,141,999,-1.8,92.893,-46.2,1.313,5099.1
9,0.1016,unknown,basic.4y,unknown,no,cellular,5,aug,no,wed,nonexistent,0,53,116,999,1.4,93.444,-36.1,4.964,5228.1
10,0.1016,housemaid,university.degree,no,no,cellular,1,nov,no,mon,nonexistent,0,42,176,999,-0.1,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET job = 1.0*(select code
        from job_coding  
        where client_coded.job=job_coding.job) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,basic.6y,unknown,yes,telephone,4,jun,no,thu,nonexistent,0,42,108,999,1.4,94.465,-41.8,4.961,5228.1
2,0.14,0.1297,high.school,no,yes,cellular,1,nov,no,mon,failure,1,32,92,999,-0.1,93.2,-42,4.191,5195.8
3,0.1016,0.1122,university.degree,no,yes,cellular,2,nov,no,wed,nonexistent,0,33,418,999,-0.1,93.2,-42,4.12,5195.8
4,0.1032,0.1297,university.degree,no,yes,cellular,3,jul,no,wed,nonexistent,0,48,121,999,1.4,93.918,-42.7,4.963,5228.1
5,0.1016,0.0814,high.school,unknown,yes,cellular,5,jul,yes,fri,nonexistent,0,51,239,999,1.4,93.918,-42.7,4.962,5228.1
6,0.1032,0.1083,professional.course,no,yes,cellular,1,nov,yes,thu,nonexistent,0,45,705,999,-0.1,93.2,-42,4.076,5195.8
7,0.1016,0.1122,university.degree,no,no,cellular,1,nov,no,thu,nonexistent,0,44,277,999,-0.1,93.2,-42,4.076,5195.8
8,0.1016,0.1297,high.school,no,yes,cellular,2,may,no,fri,nonexistent,0,35,141,999,-1.8,92.893,-46.2,1.313,5099.1
9,0.1016,0.1121,basic.4y,unknown,no,cellular,5,aug,no,wed,nonexistent,0,53,116,999,1.4,93.444,-36.1,4.964,5228.1
10,0.1016,0.1,university.degree,no,no,cellular,1,nov,no,mon,nonexistent,0,42,176,999,-0.1,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET education = 1.0*(select code
        from education_coding  
        where client_coded.education=education_coding.education) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,unknown,yes,telephone,4,jun,no,thu,nonexistent,0,42,108,999,1.4,94.465,-41.8,4.961,5228.1
2,0.14,0.1297,0.1084,no,yes,cellular,1,nov,no,mon,failure,1,32,92,999,-0.1,93.2,-42,4.191,5195.8
3,0.1016,0.1122,0.1372,no,yes,cellular,2,nov,no,wed,nonexistent,0,33,418,999,-0.1,93.2,-42,4.12,5195.8
4,0.1032,0.1297,0.1372,no,yes,cellular,3,jul,no,wed,nonexistent,0,48,121,999,1.4,93.918,-42.7,4.963,5228.1
5,0.1016,0.0814,0.1084,unknown,yes,cellular,5,jul,yes,fri,nonexistent,0,51,239,999,1.4,93.918,-42.7,4.962,5228.1
6,0.1032,0.1083,0.1135,no,yes,cellular,1,nov,yes,thu,nonexistent,0,45,705,999,-0.1,93.2,-42,4.076,5195.8
7,0.1016,0.1122,0.1372,no,no,cellular,1,nov,no,thu,nonexistent,0,44,277,999,-0.1,93.2,-42,4.076,5195.8
8,0.1016,0.1297,0.1084,no,yes,cellular,2,may,no,fri,nonexistent,0,35,141,999,-1.8,92.893,-46.2,1.313,5099.1
9,0.1016,0.1121,0.1025,unknown,no,cellular,5,aug,no,wed,nonexistent,0,53,116,999,1.4,93.444,-36.1,4.964,5228.1
10,0.1016,0.1,0.1372,no,no,cellular,1,nov,no,mon,nonexistent,0,42,176,999,-0.1,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET deflt = 1.0*(select code
        from deflt_coding  
        where client_coded.deflt=deflt_coding.deflt) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,yes,telephone,4,jun,no,thu,nonexistent,0,42,108,999,1.4,94.465,-41.8,4.961,5228.1
2,0.14,0.1297,0.1084,0.1288,yes,cellular,1,nov,no,mon,failure,1,32,92,999,-0.1,93.2,-42,4.191,5195.8
3,0.1016,0.1122,0.1372,0.1288,yes,cellular,2,nov,no,wed,nonexistent,0,33,418,999,-0.1,93.2,-42,4.12,5195.8
4,0.1032,0.1297,0.1372,0.1288,yes,cellular,3,jul,no,wed,nonexistent,0,48,121,999,1.4,93.918,-42.7,4.963,5228.1
5,0.1016,0.0814,0.1084,0.0515,yes,cellular,5,jul,yes,fri,nonexistent,0,51,239,999,1.4,93.918,-42.7,4.962,5228.1
6,0.1032,0.1083,0.1135,0.1288,yes,cellular,1,nov,yes,thu,nonexistent,0,45,705,999,-0.1,93.2,-42,4.076,5195.8
7,0.1016,0.1122,0.1372,0.1288,no,cellular,1,nov,no,thu,nonexistent,0,44,277,999,-0.1,93.2,-42,4.076,5195.8
8,0.1016,0.1297,0.1084,0.1288,yes,cellular,2,may,no,fri,nonexistent,0,35,141,999,-1.8,92.893,-46.2,1.313,5099.1
9,0.1016,0.1121,0.1025,0.0515,no,cellular,5,aug,no,wed,nonexistent,0,53,116,999,1.4,93.444,-36.1,4.964,5228.1
10,0.1016,0.1,0.1372,0.1288,no,cellular,1,nov,no,mon,nonexistent,0,42,176,999,-0.1,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET housing = 1.0*(select code
        from housing_coding  
        where client_coded.housing=housing_coding.housing) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,telephone,4,jun,no,thu,nonexistent,0,42,108,999,1.4,94.465,-41.8,4.961,5228.1
2,0.14,0.1297,0.1084,0.1288,0.1162,cellular,1,nov,no,mon,failure,1,32,92,999,-0.1,93.2,-42,4.191,5195.8
3,0.1016,0.1122,0.1372,0.1288,0.1162,cellular,2,nov,no,wed,nonexistent,0,33,418,999,-0.1,93.2,-42,4.12,5195.8
4,0.1032,0.1297,0.1372,0.1288,0.1162,cellular,3,jul,no,wed,nonexistent,0,48,121,999,1.4,93.918,-42.7,4.963,5228.1
5,0.1016,0.0814,0.1084,0.0515,0.1162,cellular,5,jul,yes,fri,nonexistent,0,51,239,999,1.4,93.918,-42.7,4.962,5228.1
6,0.1032,0.1083,0.1135,0.1288,0.1162,cellular,1,nov,yes,thu,nonexistent,0,45,705,999,-0.1,93.2,-42,4.076,5195.8
7,0.1016,0.1122,0.1372,0.1288,0.1088,cellular,1,nov,no,thu,nonexistent,0,44,277,999,-0.1,93.2,-42,4.076,5195.8
8,0.1016,0.1297,0.1084,0.1288,0.1162,cellular,2,may,no,fri,nonexistent,0,35,141,999,-1.8,92.893,-46.2,1.313,5099.1
9,0.1016,0.1121,0.1025,0.0515,0.1088,cellular,5,aug,no,wed,nonexistent,0,53,116,999,1.4,93.444,-36.1,4.964,5228.1
10,0.1016,0.1,0.1372,0.1288,0.1088,cellular,1,nov,no,mon,nonexistent,0,42,176,999,-0.1,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET contact = 1.0*(select code
        from contact_coding  
        where client_coded.contact=contact_coding.contact) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,0.0523,4,jun,no,thu,nonexistent,0,42,108,999,1.4,94.465,-41.8,4.961,5228.1
2,0.14,0.1297,0.1084,0.1288,0.1162,0.1474,1,nov,no,mon,failure,1,32,92,999,-0.1,93.2,-42,4.191,5195.8
3,0.1016,0.1122,0.1372,0.1288,0.1162,0.1474,2,nov,no,wed,nonexistent,0,33,418,999,-0.1,93.2,-42,4.12,5195.8
4,0.1032,0.1297,0.1372,0.1288,0.1162,0.1474,3,jul,no,wed,nonexistent,0,48,121,999,1.4,93.918,-42.7,4.963,5228.1
5,0.1016,0.0814,0.1084,0.0515,0.1162,0.1474,5,jul,yes,fri,nonexistent,0,51,239,999,1.4,93.918,-42.7,4.962,5228.1
6,0.1032,0.1083,0.1135,0.1288,0.1162,0.1474,1,nov,yes,thu,nonexistent,0,45,705,999,-0.1,93.2,-42,4.076,5195.8
7,0.1016,0.1122,0.1372,0.1288,0.1088,0.1474,1,nov,no,thu,nonexistent,0,44,277,999,-0.1,93.2,-42,4.076,5195.8
8,0.1016,0.1297,0.1084,0.1288,0.1162,0.1474,2,may,no,fri,nonexistent,0,35,141,999,-1.8,92.893,-46.2,1.313,5099.1
9,0.1016,0.1121,0.1025,0.0515,0.1088,0.1474,5,aug,no,wed,nonexistent,0,53,116,999,1.4,93.444,-36.1,4.964,5228.1
10,0.1016,0.1,0.1372,0.1288,0.1088,0.1474,1,nov,no,mon,nonexistent,0,42,176,999,-0.1,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET campaign = 1.0*(select code
        from campaign_coding  
        where client_coded.campaign=campaign_coding.campaign) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,0.0523,0.0939,jun,no,thu,nonexistent,0,42,108,999,1.4,94.465,-41.8,4.961,5228.1
2,0.14,0.1297,0.1084,0.1288,0.1162,0.1474,0.1304,nov,no,mon,failure,1,32,92,999,-0.1,93.2,-42,4.191,5195.8
3,0.1016,0.1122,0.1372,0.1288,0.1162,0.1474,0.1146,nov,no,wed,nonexistent,0,33,418,999,-0.1,93.2,-42,4.12,5195.8
4,0.1032,0.1297,0.1372,0.1288,0.1162,0.1474,0.1075,jul,no,wed,nonexistent,0,48,121,999,1.4,93.918,-42.7,4.963,5228.1
5,0.1016,0.0814,0.1084,0.0515,0.1162,0.1474,0.075,jul,yes,fri,nonexistent,0,51,239,999,1.4,93.918,-42.7,4.962,5228.1
6,0.1032,0.1083,0.1135,0.1288,0.1162,0.1474,0.1304,nov,yes,thu,nonexistent,0,45,705,999,-0.1,93.2,-42,4.076,5195.8
7,0.1016,0.1122,0.1372,0.1288,0.1088,0.1474,0.1304,nov,no,thu,nonexistent,0,44,277,999,-0.1,93.2,-42,4.076,5195.8
8,0.1016,0.1297,0.1084,0.1288,0.1162,0.1474,0.1146,may,no,fri,nonexistent,0,35,141,999,-1.8,92.893,-46.2,1.313,5099.1
9,0.1016,0.1121,0.1025,0.0515,0.1088,0.1474,0.075,aug,no,wed,nonexistent,0,53,116,999,1.4,93.444,-36.1,4.964,5228.1
10,0.1016,0.1,0.1372,0.1288,0.1088,0.1474,0.1304,nov,no,mon,nonexistent,0,42,176,999,-0.1,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET month = 1.0*(select code
        from month_coding  
        where client_coded.month=month_coding.month) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,0.0523,0.0939,0.1051,no,thu,nonexistent,0,42,108,999,1.4,94.465,-41.8,4.961,5228.1
2,0.14,0.1297,0.1084,0.1288,0.1162,0.1474,0.1304,0.1014,no,mon,failure,1,32,92,999,-0.1,93.2,-42,4.191,5195.8
3,0.1016,0.1122,0.1372,0.1288,0.1162,0.1474,0.1146,0.1014,no,wed,nonexistent,0,33,418,999,-0.1,93.2,-42,4.12,5195.8
4,0.1032,0.1297,0.1372,0.1288,0.1162,0.1474,0.1075,0.0905,no,wed,nonexistent,0,48,121,999,1.4,93.918,-42.7,4.963,5228.1
5,0.1016,0.0814,0.1084,0.0515,0.1162,0.1474,0.075,0.0905,yes,fri,nonexistent,0,51,239,999,1.4,93.918,-42.7,4.962,5228.1
6,0.1032,0.1083,0.1135,0.1288,0.1162,0.1474,0.1304,0.1014,yes,thu,nonexistent,0,45,705,999,-0.1,93.2,-42,4.076,5195.8
7,0.1016,0.1122,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,no,thu,nonexistent,0,44,277,999,-0.1,93.2,-42,4.076,5195.8
8,0.1016,0.1297,0.1084,0.1288,0.1162,0.1474,0.1146,0.0643,no,fri,nonexistent,0,35,141,999,-1.8,92.893,-46.2,1.313,5099.1
9,0.1016,0.1121,0.1025,0.0515,0.1088,0.1474,0.075,0.106,no,wed,nonexistent,0,53,116,999,1.4,93.444,-36.1,4.964,5228.1
10,0.1016,0.1,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,no,mon,nonexistent,0,42,176,999,-0.1,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET loan = 1.0*(select code
        from loan_coding  
        where client_coded.loan=loan_coding.loan) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,0.0523,0.0939,0.1051,0.1134,thu,nonexistent,0,42,108,999,1.4,94.465,-41.8,4.961,5228.1
2,0.14,0.1297,0.1084,0.1288,0.1162,0.1474,0.1304,0.1014,0.1134,mon,failure,1,32,92,999,-0.1,93.2,-42,4.191,5195.8
3,0.1016,0.1122,0.1372,0.1288,0.1162,0.1474,0.1146,0.1014,0.1134,wed,nonexistent,0,33,418,999,-0.1,93.2,-42,4.12,5195.8
4,0.1032,0.1297,0.1372,0.1288,0.1162,0.1474,0.1075,0.0905,0.1134,wed,nonexistent,0,48,121,999,1.4,93.918,-42.7,4.963,5228.1
5,0.1016,0.0814,0.1084,0.0515,0.1162,0.1474,0.075,0.0905,0.1093,fri,nonexistent,0,51,239,999,1.4,93.918,-42.7,4.962,5228.1
6,0.1032,0.1083,0.1135,0.1288,0.1162,0.1474,0.1304,0.1014,0.1093,thu,nonexistent,0,45,705,999,-0.1,93.2,-42,4.076,5195.8
7,0.1016,0.1122,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,thu,nonexistent,0,44,277,999,-0.1,93.2,-42,4.076,5195.8
8,0.1016,0.1297,0.1084,0.1288,0.1162,0.1474,0.1146,0.0643,0.1134,fri,nonexistent,0,35,141,999,-1.8,92.893,-46.2,1.313,5099.1
9,0.1016,0.1121,0.1025,0.0515,0.1088,0.1474,0.075,0.106,0.1134,wed,nonexistent,0,53,116,999,1.4,93.444,-36.1,4.964,5228.1
10,0.1016,0.1,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,mon,nonexistent,0,42,176,999,-0.1,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET day_of_week = 1.0*(select code
        from day_of_week_coding  
        where client_coded.day_of_week=day_of_week_coding.day_of_week) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,0.0523,0.0939,0.1051,0.1134,0.1212,nonexistent,0,42,108,999,1.4,94.465,-41.8,4.961,5228.1
2,0.14,0.1297,0.1084,0.1288,0.1162,0.1474,0.1304,0.1014,0.1134,0.0995,failure,1,32,92,999,-0.1,93.2,-42,4.191,5195.8
3,0.1016,0.1122,0.1372,0.1288,0.1162,0.1474,0.1146,0.1014,0.1134,0.1167,nonexistent,0,33,418,999,-0.1,93.2,-42,4.12,5195.8
4,0.1032,0.1297,0.1372,0.1288,0.1162,0.1474,0.1075,0.0905,0.1134,0.1167,nonexistent,0,48,121,999,1.4,93.918,-42.7,4.963,5228.1
5,0.1016,0.0814,0.1084,0.0515,0.1162,0.1474,0.075,0.0905,0.1093,0.1081,nonexistent,0,51,239,999,1.4,93.918,-42.7,4.962,5228.1
6,0.1032,0.1083,0.1135,0.1288,0.1162,0.1474,0.1304,0.1014,0.1093,0.1212,nonexistent,0,45,705,999,-0.1,93.2,-42,4.076,5195.8
7,0.1016,0.1122,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.1212,nonexistent,0,44,277,999,-0.1,93.2,-42,4.076,5195.8
8,0.1016,0.1297,0.1084,0.1288,0.1162,0.1474,0.1146,0.0643,0.1134,0.1081,nonexistent,0,35,141,999,-1.8,92.893,-46.2,1.313,5099.1
9,0.1016,0.1121,0.1025,0.0515,0.1088,0.1474,0.075,0.106,0.1134,0.1167,nonexistent,0,53,116,999,1.4,93.444,-36.1,4.964,5228.1
10,0.1016,0.1,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.0995,nonexistent,0,42,176,999,-0.1,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET poutcome = 1.0*(select code
        from poutcome_coding  
        where client_coded.poutcome=poutcome_coding.poutcome) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,0.0523,0.0939,0.1051,0.1134,0.1212,0.0883,0,42,108,999,1.4,94.465,-41.8,4.961,5228.1
2,0.14,0.1297,0.1084,0.1288,0.1162,0.1474,0.1304,0.1014,0.1134,0.0995,0.1423,1,32,92,999,-0.1,93.2,-42,4.191,5195.8
3,0.1016,0.1122,0.1372,0.1288,0.1162,0.1474,0.1146,0.1014,0.1134,0.1167,0.0883,0,33,418,999,-0.1,93.2,-42,4.12,5195.8
4,0.1032,0.1297,0.1372,0.1288,0.1162,0.1474,0.1075,0.0905,0.1134,0.1167,0.0883,0,48,121,999,1.4,93.918,-42.7,4.963,5228.1
5,0.1016,0.0814,0.1084,0.0515,0.1162,0.1474,0.075,0.0905,0.1093,0.1081,0.0883,0,51,239,999,1.4,93.918,-42.7,4.962,5228.1
6,0.1032,0.1083,0.1135,0.1288,0.1162,0.1474,0.1304,0.1014,0.1093,0.1212,0.0883,0,45,705,999,-0.1,93.2,-42,4.076,5195.8
7,0.1016,0.1122,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.1212,0.0883,0,44,277,999,-0.1,93.2,-42,4.076,5195.8
8,0.1016,0.1297,0.1084,0.1288,0.1162,0.1474,0.1146,0.0643,0.1134,0.1081,0.0883,0,35,141,999,-1.8,92.893,-46.2,1.313,5099.1
9,0.1016,0.1121,0.1025,0.0515,0.1088,0.1474,0.075,0.106,0.1134,0.1167,0.0883,0,53,116,999,1.4,93.444,-36.1,4.964,5228.1
10,0.1016,0.1,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.0995,0.0883,0,42,176,999,-0.1,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET previous = 1.0*(select code
        from previous_coding  
        where client_coded.previous=previous_coding.previous) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,0.0523,0.0939,0.1051,0.1134,0.1212,0.0883,0.0883,42,108,999,1.4,94.465,-41.8,4.961,5228.1
2,0.14,0.1297,0.1084,0.1288,0.1162,0.1474,0.1304,0.1014,0.1134,0.0995,0.1423,0.212,32,92,999,-0.1,93.2,-42,4.191,5195.8
3,0.1016,0.1122,0.1372,0.1288,0.1162,0.1474,0.1146,0.1014,0.1134,0.1167,0.0883,0.0883,33,418,999,-0.1,93.2,-42,4.12,5195.8
4,0.1032,0.1297,0.1372,0.1288,0.1162,0.1474,0.1075,0.0905,0.1134,0.1167,0.0883,0.0883,48,121,999,1.4,93.918,-42.7,4.963,5228.1
5,0.1016,0.0814,0.1084,0.0515,0.1162,0.1474,0.075,0.0905,0.1093,0.1081,0.0883,0.0883,51,239,999,1.4,93.918,-42.7,4.962,5228.1
6,0.1032,0.1083,0.1135,0.1288,0.1162,0.1474,0.1304,0.1014,0.1093,0.1212,0.0883,0.0883,45,705,999,-0.1,93.2,-42,4.076,5195.8
7,0.1016,0.1122,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.1212,0.0883,0.0883,44,277,999,-0.1,93.2,-42,4.076,5195.8
8,0.1016,0.1297,0.1084,0.1288,0.1162,0.1474,0.1146,0.0643,0.1134,0.1081,0.0883,0.0883,35,141,999,-1.8,92.893,-46.2,1.313,5099.1
9,0.1016,0.1121,0.1025,0.0515,0.1088,0.1474,0.075,0.106,0.1134,0.1167,0.0883,0.0883,53,116,999,1.4,93.444,-36.1,4.964,5228.1
10,0.1016,0.1,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.0995,0.0883,0.0883,42,176,999,-0.1,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET age = 1.0*(select code
        from age_coding  
        where client_coded.age=age_coding.age) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,0.0523,0.0939,0.1051,0.1134,0.1212,0.0883,0.0883,0.3086,108,999,1.4,94.465,-41.8,4.961,5228.1
2,0.14,0.1297,0.1084,0.1288,0.1162,0.1474,0.1304,0.1014,0.1134,0.0995,0.1423,0.212,0.1852,92,999,-0.1,93.2,-42,4.191,5195.8
3,0.1016,0.1122,0.1372,0.1288,0.1162,0.1474,0.1146,0.1014,0.1134,0.1167,0.0883,0.0883,0.1975,418,999,-0.1,93.2,-42,4.12,5195.8
4,0.1032,0.1297,0.1372,0.1288,0.1162,0.1474,0.1075,0.0905,0.1134,0.1167,0.0883,0.0883,0.3827,121,999,1.4,93.918,-42.7,4.963,5228.1
5,0.1016,0.0814,0.1084,0.0515,0.1162,0.1474,0.075,0.0905,0.1093,0.1081,0.0883,0.0883,0.4198,239,999,1.4,93.918,-42.7,4.962,5228.1
6,0.1032,0.1083,0.1135,0.1288,0.1162,0.1474,0.1304,0.1014,0.1093,0.1212,0.0883,0.0883,0.3457,705,999,-0.1,93.2,-42,4.076,5195.8
7,0.1016,0.1122,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.1212,0.0883,0.0883,0.3333,277,999,-0.1,93.2,-42,4.076,5195.8
8,0.1016,0.1297,0.1084,0.1288,0.1162,0.1474,0.1146,0.0643,0.1134,0.1081,0.0883,0.0883,0.2222,141,999,-1.8,92.893,-46.2,1.313,5099.1
9,0.1016,0.1121,0.1025,0.0515,0.1088,0.1474,0.075,0.106,0.1134,0.1167,0.0883,0.0883,0.4444,116,999,1.4,93.444,-36.1,4.964,5228.1
10,0.1016,0.1,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.0995,0.0883,0.0883,0.3086,176,999,-0.1,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET duration = 1.0*(select code
        from duration_coding  
        where client_coded.duration=duration_coding.duration) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,0.0523,0.0939,0.1051,0.1134,0.1212,0.0883,0.0883,0.3086,0.022,999,1.4,94.465,-41.8,4.961,5228.1
2,0.14,0.1297,0.1084,0.1288,0.1162,0.1474,0.1304,0.1014,0.1134,0.0995,0.1423,0.212,0.1852,0.0187,999,-0.1,93.2,-42,4.191,5195.8
3,0.1016,0.1122,0.1372,0.1288,0.1162,0.1474,0.1146,0.1014,0.1134,0.1167,0.0883,0.0883,0.1975,0.085,999,-0.1,93.2,-42,4.12,5195.8
4,0.1032,0.1297,0.1372,0.1288,0.1162,0.1474,0.1075,0.0905,0.1134,0.1167,0.0883,0.0883,0.3827,0.0246,999,1.4,93.918,-42.7,4.963,5228.1
5,0.1016,0.0814,0.1084,0.0515,0.1162,0.1474,0.075,0.0905,0.1093,0.1081,0.0883,0.0883,0.4198,0.0486,999,1.4,93.918,-42.7,4.962,5228.1
6,0.1032,0.1083,0.1135,0.1288,0.1162,0.1474,0.1304,0.1014,0.1093,0.1212,0.0883,0.0883,0.3457,0.1434,999,-0.1,93.2,-42,4.076,5195.8
7,0.1016,0.1122,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.1212,0.0883,0.0883,0.3333,0.0563,999,-0.1,93.2,-42,4.076,5195.8
8,0.1016,0.1297,0.1084,0.1288,0.1162,0.1474,0.1146,0.0643,0.1134,0.1081,0.0883,0.0883,0.2222,0.0287,999,-1.8,92.893,-46.2,1.313,5099.1
9,0.1016,0.1121,0.1025,0.0515,0.1088,0.1474,0.075,0.106,0.1134,0.1167,0.0883,0.0883,0.4444,0.0236,999,1.4,93.444,-36.1,4.964,5228.1
10,0.1016,0.1,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.0995,0.0883,0.0883,0.3086,0.0358,999,-0.1,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET pdays = 1.0*(select code
        from pdays_coding  
        where client_coded.pdays=pdays_coding.pdays) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,0.0523,0.0939,0.1051,0.1134,0.1212,0.0883,0.0883,0.3086,0.022,1.0,1.4,94.465,-41.8,4.961,5228.1
2,0.14,0.1297,0.1084,0.1288,0.1162,0.1474,0.1304,0.1014,0.1134,0.0995,0.1423,0.212,0.1852,0.0187,1.0,-0.1,93.2,-42,4.191,5195.8
3,0.1016,0.1122,0.1372,0.1288,0.1162,0.1474,0.1146,0.1014,0.1134,0.1167,0.0883,0.0883,0.1975,0.085,1.0,-0.1,93.2,-42,4.12,5195.8
4,0.1032,0.1297,0.1372,0.1288,0.1162,0.1474,0.1075,0.0905,0.1134,0.1167,0.0883,0.0883,0.3827,0.0246,1.0,1.4,93.918,-42.7,4.963,5228.1
5,0.1016,0.0814,0.1084,0.0515,0.1162,0.1474,0.075,0.0905,0.1093,0.1081,0.0883,0.0883,0.4198,0.0486,1.0,1.4,93.918,-42.7,4.962,5228.1
6,0.1032,0.1083,0.1135,0.1288,0.1162,0.1474,0.1304,0.1014,0.1093,0.1212,0.0883,0.0883,0.3457,0.1434,1.0,-0.1,93.2,-42,4.076,5195.8
7,0.1016,0.1122,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.1212,0.0883,0.0883,0.3333,0.0563,1.0,-0.1,93.2,-42,4.076,5195.8
8,0.1016,0.1297,0.1084,0.1288,0.1162,0.1474,0.1146,0.0643,0.1134,0.1081,0.0883,0.0883,0.2222,0.0287,1.0,-1.8,92.893,-46.2,1.313,5099.1
9,0.1016,0.1121,0.1025,0.0515,0.1088,0.1474,0.075,0.106,0.1134,0.1167,0.0883,0.0883,0.4444,0.0236,1.0,1.4,93.444,-36.1,4.964,5228.1
10,0.1016,0.1,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.0995,0.0883,0.0883,0.3086,0.0358,1.0,-0.1,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET emp_var_rate = 1.0*(select code
        from emp_var_rate_coding  
        where client_coded.emp_var_rate=emp_var_rate_coding.emp_var_rate) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,0.0523,0.0939,0.1051,0.1134,0.1212,0.0883,0.0883,0.3086,0.022,1.0,1.0,94.465,-41.8,4.961,5228.1
2,0.14,0.1297,0.1084,0.1288,0.1162,0.1474,0.1304,0.1014,0.1134,0.0995,0.1423,0.212,0.1852,0.0187,1.0,0.6875,93.2,-42,4.191,5195.8
3,0.1016,0.1122,0.1372,0.1288,0.1162,0.1474,0.1146,0.1014,0.1134,0.1167,0.0883,0.0883,0.1975,0.085,1.0,0.6875,93.2,-42,4.12,5195.8
4,0.1032,0.1297,0.1372,0.1288,0.1162,0.1474,0.1075,0.0905,0.1134,0.1167,0.0883,0.0883,0.3827,0.0246,1.0,1.0,93.918,-42.7,4.963,5228.1
5,0.1016,0.0814,0.1084,0.0515,0.1162,0.1474,0.075,0.0905,0.1093,0.1081,0.0883,0.0883,0.4198,0.0486,1.0,1.0,93.918,-42.7,4.962,5228.1
6,0.1032,0.1083,0.1135,0.1288,0.1162,0.1474,0.1304,0.1014,0.1093,0.1212,0.0883,0.0883,0.3457,0.1434,1.0,0.6875,93.2,-42,4.076,5195.8
7,0.1016,0.1122,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.1212,0.0883,0.0883,0.3333,0.0563,1.0,0.6875,93.2,-42,4.076,5195.8
8,0.1016,0.1297,0.1084,0.1288,0.1162,0.1474,0.1146,0.0643,0.1134,0.1081,0.0883,0.0883,0.2222,0.0287,1.0,0.3333,92.893,-46.2,1.313,5099.1
9,0.1016,0.1121,0.1025,0.0515,0.1088,0.1474,0.075,0.106,0.1134,0.1167,0.0883,0.0883,0.4444,0.0236,1.0,1.0,93.444,-36.1,4.964,5228.1
10,0.1016,0.1,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.0995,0.0883,0.0883,0.3086,0.0358,1.0,0.6875,93.2,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET cons_price_idx = 1.0*(select code
        from cons_price_idx_coding  
        where client_coded.cons_price_idx=cons_price_idx_coding.cons_price_idx) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,0.0523,0.0939,0.1051,0.1134,0.1212,0.0883,0.0883,0.3086,0.022,1.0,1.0,0.8823,-41.8,4.961,5228.1
2,0.14,0.1297,0.1084,0.1288,0.1162,0.1474,0.1304,0.1014,0.1134,0.0995,0.1423,0.212,0.1852,0.0187,1.0,0.6875,0.3893,-42,4.191,5195.8
3,0.1016,0.1122,0.1372,0.1288,0.1162,0.1474,0.1146,0.1014,0.1134,0.1167,0.0883,0.0883,0.1975,0.085,1.0,0.6875,0.3893,-42,4.12,5195.8
4,0.1032,0.1297,0.1372,0.1288,0.1162,0.1474,0.1075,0.0905,0.1134,0.1167,0.0883,0.0883,0.3827,0.0246,1.0,1.0,0.6691,-42.7,4.963,5228.1
5,0.1016,0.0814,0.1084,0.0515,0.1162,0.1474,0.075,0.0905,0.1093,0.1081,0.0883,0.0883,0.4198,0.0486,1.0,1.0,0.6691,-42.7,4.962,5228.1
6,0.1032,0.1083,0.1135,0.1288,0.1162,0.1474,0.1304,0.1014,0.1093,0.1212,0.0883,0.0883,0.3457,0.1434,1.0,0.6875,0.3893,-42,4.076,5195.8
7,0.1016,0.1122,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.1212,0.0883,0.0883,0.3333,0.0563,1.0,0.6875,0.3893,-42,4.076,5195.8
8,0.1016,0.1297,0.1084,0.1288,0.1162,0.1474,0.1146,0.0643,0.1134,0.1081,0.0883,0.0883,0.2222,0.0287,1.0,0.3333,0.2697,-46.2,1.313,5099.1
9,0.1016,0.1121,0.1025,0.0515,0.1088,0.1474,0.075,0.106,0.1134,0.1167,0.0883,0.0883,0.4444,0.0236,1.0,1.0,0.4844,-36.1,4.964,5228.1
10,0.1016,0.1,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.0995,0.0883,0.0883,0.3086,0.0358,1.0,0.6875,0.3893,-42,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET cons_conf_idx = 1.0*(select code
        from cons_conf_idx_coding  
        where client_coded.cons_conf_idx=cons_conf_idx_coding.cons_conf_idx) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,0.0523,0.0939,0.1051,0.1134,0.1212,0.0883,0.0883,0.3086,0.022,1.0,1.0,0.8823,0.3766,4.961,5228.1
2,0.14,0.1297,0.1084,0.1288,0.1162,0.1474,0.1304,0.1014,0.1134,0.0995,0.1423,0.212,0.1852,0.0187,1.0,0.6875,0.3893,0.3682,4.191,5195.8
3,0.1016,0.1122,0.1372,0.1288,0.1162,0.1474,0.1146,0.1014,0.1134,0.1167,0.0883,0.0883,0.1975,0.085,1.0,0.6875,0.3893,0.3682,4.12,5195.8
4,0.1032,0.1297,0.1372,0.1288,0.1162,0.1474,0.1075,0.0905,0.1134,0.1167,0.0883,0.0883,0.3827,0.0246,1.0,1.0,0.6691,0.3389,4.963,5228.1
5,0.1016,0.0814,0.1084,0.0515,0.1162,0.1474,0.075,0.0905,0.1093,0.1081,0.0883,0.0883,0.4198,0.0486,1.0,1.0,0.6691,0.3389,4.962,5228.1
6,0.1032,0.1083,0.1135,0.1288,0.1162,0.1474,0.1304,0.1014,0.1093,0.1212,0.0883,0.0883,0.3457,0.1434,1.0,0.6875,0.3893,0.3682,4.076,5195.8
7,0.1016,0.1122,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.1212,0.0883,0.0883,0.3333,0.0563,1.0,0.6875,0.3893,0.3682,4.076,5195.8
8,0.1016,0.1297,0.1084,0.1288,0.1162,0.1474,0.1146,0.0643,0.1134,0.1081,0.0883,0.0883,0.2222,0.0287,1.0,0.3333,0.2697,0.1925,1.313,5099.1
9,0.1016,0.1121,0.1025,0.0515,0.1088,0.1474,0.075,0.106,0.1134,0.1167,0.0883,0.0883,0.4444,0.0236,1.0,1.0,0.4844,0.6151,4.964,5228.1
10,0.1016,0.1,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.0995,0.0883,0.0883,0.3086,0.0358,1.0,0.6875,0.3893,0.3682,4.191,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET euribor_m = 1.0*(select code
        from euribor_m_coding  
        where client_coded.euribor_m=euribor_m_coding.euribor_m) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,0.0523,0.0939,0.1051,0.1134,0.1212,0.0883,0.0883,0.3086,0.022,1.0,1.0,0.8823,0.3766,0.981,5228.1
2,0.14,0.1297,0.1084,0.1288,0.1162,0.1474,0.1304,0.1014,0.1134,0.0995,0.1423,0.212,0.1852,0.0187,1.0,0.6875,0.3893,0.3682,0.8064,5195.8
3,0.1016,0.1122,0.1372,0.1288,0.1162,0.1474,0.1146,0.1014,0.1134,0.1167,0.0883,0.0883,0.1975,0.085,1.0,0.6875,0.3893,0.3682,0.7903,5195.8
4,0.1032,0.1297,0.1372,0.1288,0.1162,0.1474,0.1075,0.0905,0.1134,0.1167,0.0883,0.0883,0.3827,0.0246,1.0,1.0,0.6691,0.3389,0.9814,5228.1
5,0.1016,0.0814,0.1084,0.0515,0.1162,0.1474,0.075,0.0905,0.1093,0.1081,0.0883,0.0883,0.4198,0.0486,1.0,1.0,0.6691,0.3389,0.9812,5228.1
6,0.1032,0.1083,0.1135,0.1288,0.1162,0.1474,0.1304,0.1014,0.1093,0.1212,0.0883,0.0883,0.3457,0.1434,1.0,0.6875,0.3893,0.3682,0.7803,5195.8
7,0.1016,0.1122,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.1212,0.0883,0.0883,0.3333,0.0563,1.0,0.6875,0.3893,0.3682,0.7803,5195.8
8,0.1016,0.1297,0.1084,0.1288,0.1162,0.1474,0.1146,0.0643,0.1134,0.1081,0.0883,0.0883,0.2222,0.0287,1.0,0.3333,0.2697,0.1925,0.1539,5099.1
9,0.1016,0.1121,0.1025,0.0515,0.1088,0.1474,0.075,0.106,0.1134,0.1167,0.0883,0.0883,0.4444,0.0236,1.0,1.0,0.4844,0.6151,0.9816,5228.1
10,0.1016,0.1,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.0995,0.0883,0.0883,0.3086,0.0358,1.0,0.6875,0.3893,0.3682,0.8064,5195.8
=======================================================================================================================================================================================


        UPDATE client_coded 
        SET nr_employed = 1.0*(select code
        from nr_employed_coding  
        where client_coded.nr_employed=nr_employed_coding.nr_employed) 
        
=======================================================================================================================================================================================
rownum,marital,job,education,deflt,housing,contact,campaign,month,loan,day_of_week,poutcome,previous,age,duration,pdays,emp_var_rate,cons_price_idx,cons_conf_idx,euribor_m,nr_employed
=======================================================================================================================================================================================
1,0.1016,0.0689,0.082,0.0515,0.1162,0.0523,0.0939,0.1051,0.1134,0.1212,0.0883,0.0883,0.3086,0.022,1.0,1.0,0.8823,0.3766,0.981,1.0
2,0.14,0.1297,0.1084,0.1288,0.1162,0.1474,0.1304,0.1014,0.1134,0.0995,0.1423,0.212,0.1852,0.0187,1.0,0.6875,0.3893,0.3682,0.8064,0.8779
3,0.1016,0.1122,0.1372,0.1288,0.1162,0.1474,0.1146,0.1014,0.1134,0.1167,0.0883,0.0883,0.1975,0.085,1.0,0.6875,0.3893,0.3682,0.7903,0.8779
4,0.1032,0.1297,0.1372,0.1288,0.1162,0.1474,0.1075,0.0905,0.1134,0.1167,0.0883,0.0883,0.3827,0.0246,1.0,1.0,0.6691,0.3389,0.9814,1.0
5,0.1016,0.0814,0.1084,0.0515,0.1162,0.1474,0.075,0.0905,0.1093,0.1081,0.0883,0.0883,0.4198,0.0486,1.0,1.0,0.6691,0.3389,0.9812,1.0
6,0.1032,0.1083,0.1135,0.1288,0.1162,0.1474,0.1304,0.1014,0.1093,0.1212,0.0883,0.0883,0.3457,0.1434,1.0,0.6875,0.3893,0.3682,0.7803,0.8779
7,0.1016,0.1122,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.1212,0.0883,0.0883,0.3333,0.0563,1.0,0.6875,0.3893,0.3682,0.7803,0.8779
8,0.1016,0.1297,0.1084,0.1288,0.1162,0.1474,0.1146,0.0643,0.1134,0.1081,0.0883,0.0883,0.2222,0.0287,1.0,0.3333,0.2697,0.1925,0.1539,0.5123
9,0.1016,0.1121,0.1025,0.0515,0.1088,0.1474,0.075,0.106,0.1134,0.1167,0.0883,0.0883,0.4444,0.0236,1.0,1.0,0.4844,0.6151,0.9816,1.0
10,0.1016,0.1,0.1372,0.1288,0.1088,0.1474,0.1304,0.1014,0.1134,0.0995,0.0883,0.0883,0.3086,0.0358,1.0,0.6875,0.3893,0.3682,0.8064,0.8779
=======================================================================================================================================================================================


        SELECT 1*rownum,1.0*marital,1.0*job,1.0*education,1.0*deflt,1.0*housing,1.0*contact,1.0*campaign,1.0*month,1.0*loan,1.0*day_of_week,1.0*poutcome,1.0*previous,1.0*age,1.0*duration,1.0*pdays,1.0*emp_var_rate,1.0*cons_price_idx,1.0*cons_conf_idx,1.0*euribor_m,1.0*nr_employed
        FROM client_coded
        order by rownum desc
        

Back To Index