def run(scale, scp, scp2, ngrid, addymin, mdeg, C): MyCData = cdata(scp, scp2, mdeg, ngrid, xmax, xmin, ymax, ymin, scale) MyCData.train(df1, C=C) Ytest = MyCData.test(df2) dfout = pd.DataFrame(columns=cats, data=Ytest) with gzip.GzipFile('myout.csv.gz',mode='w',compresslevel=9) as gzfile: dfout.to_csv(gzfile, index_label='Id')
def run(scale, scp, scp2, ngrid, addymin, mdeg, C): MyCData = cdata(scp, scp2, mdeg, ngrid, xmax, xmin, ymax, ymin, scale) MyCData.train(df1, C=C) Ytest = MyCData.test(df2) dfout = pd.DataFrame(columns=cats, data=Ytest) with gzip.GzipFile('myout.csv.gz', mode='w', compresslevel=9) as gzfile: dfout.to_csv(gzfile, index_label='Id')
def run(scale, scp, scp2, ngrid, addymin, mdeg, C): MyCData = cdata(scp, scp2, mdeg, ngrid, xmax, xmin, ymax, ymin, scale) MyCData.train(df1, C=C) Ytest = MyCData.test(df2) y = df2.Category.as_matrix() s = "scale = %f, C = %f, scp = %f, scp2 = %f, order = %d, logloss = %f" % (scale, C, scp, scp2, mdeg, Ent(y, Ytest)) #print s sl.append(s)