コード例 #1
0
import os
import sys
import pandas as pd
sys.path.append("lib")

from AllStatePredictor import AllStatePredictor

p = AllStatePredictor()

def concat_ABCDEFG(x):
    return "%d%d%d%d%d%d%d" % (x['A'], x['B'], x['C'], x['D'], x['E'], x['F'], x['G'])

print "prediction classe 2 linear svc..."
customer_ID_list_2 = p.get_customer_ID_list("2")
a_prediction_2 = p.predict("A", "linearsvc", "not_centered", "2")
b_prediction_2 = p.predict("B", "linearsvc", "not_centered", "2")
c_prediction_2 = p.predict("C", "linearsvc", "not_centered", "2")
d_prediction_2 = p.predict("D", "linearsvc", "not_centered", "2")
e_prediction_2 = p.predict("E", "linearsvc", "not_centered", "2")
f_prediction_2 = p.predict("F", "linearsvc", "not_centered", "2")
g_prediction_2 = p.predict("G", "linearsvc", "not_centered", "2")

prediction_2_detail = pd.DataFrame(
    {
        'A' : a_prediction_2,
        'B' : b_prediction_2,
        'C' : c_prediction_2,
        'D' : d_prediction_2,
        'E' : e_prediction_2,
        'F' : f_prediction_2,
        'G' : g_prediction_2
コード例 #2
0
import pandas as pd
sys.path.append("lib")

from AllStatePredictor import AllStatePredictor

p = AllStatePredictor()


def concat_ABCDEFG(x):
    return "%d%d%d%d%d%d%d" % (x['A'], x['B'], x['C'], x['D'], x['E'], x['F'],
                               x['G'])


print "prediction classe 2 linear svc..."
customer_ID_list_2 = p.get_customer_ID_list("2")
a_prediction_2 = p.predict("A", "logistic", "not_centered", "2")
b_prediction_2 = p.predict("B", "logistic", "not_centered", "2")
c_prediction_2 = p.predict("C", "logistic", "not_centered", "2")
d_prediction_2 = p.predict("D", "logistic", "not_centered", "2")
e_prediction_2 = p.predict("E", "logistic", "not_centered", "2")
f_prediction_2 = p.predict("F", "logistic", "not_centered", "2")
g_prediction_2 = p.predict("G", "logistic", "not_centered", "2")

prediction_2_detail = pd.DataFrame(
    {
        'A': a_prediction_2,
        'B': b_prediction_2,
        'C': c_prediction_2,
        'D': d_prediction_2,
        'E': e_prediction_2,
        'F': f_prediction_2,