# Toy Data
#df = [ ["P1",1,2,10],["P2",3,5,26],["P3",1,1,6],["P4",6,2,20],["P5",5,3,22] ]
# [0,1,2,3]

model = baseRegressor(raw_data=df,feature_stop=265,target_column=DAT,
                      regressor=True,features_to_use=wt,stoppage=10000000);
model.fit(alpha=0.000000000001,target_error=1); # Best I could find for 268
"""
model = baseRegressor(raw_data=df,feature_stop=265,target_column=266,
                      regressor=False,features_to_use=wt);
model.fit(alpha=0.00000000001,target_error=0.1);   # For Classification
"""

print model.weights;     # Returns a list of random values.
l = map(abs, model.weights);
#print "Should return 2,4"

#print model.baseError_plot # this is a list

b = sorted(range(len(l)),key=lambda k: l[k]);
b.reverse()
print b;

ys = return_single_column(df,dex=DAT);
print ys[0:10];
print model.predict(df[0:10]);




wt = [12, 21, 25, 20, 11, 28, 27, 16, 26, 32, 13, 29, 2, 33, 1, 17, 30, 14]
wt_class = [0.005282546933085302, 
    0.00019005094290200331, 
    -0.3208438520005847, 
    0.060298374167868034, 
    0.47575278102153445, 
    -0.007341090879961012, 
    -0.0003345576888578404, 
    -0.34825960673644474, 
    0.0003877180341366817, 
    -0.28494755094203117, 
    2.964726478234287e-06, 
    -0.01292471641406875, 
    0.0005911449483264154, 
    0.008637346773164302, 
    0.1367495624114614, 
    0.004521909748139259, 
    -0.009062774664435601, 
    -0.01652866109254906]

model = baseRegressor(raw_data=training,
                      feature_stop=3,
                      target_column=4,
                      regressor=False,
                      existing_weights=wt_class,
                      features_to_use=wt);

predictions = model.predict(validation);
answers = return_single_column(validation,dex=266);
print "Percentage Correct: " + str(binary_cv(predictions,answers));