Module Expr Str Import alias identifier ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults Num ListLoad ListLoad Num Num Num ListLoad ListLoad Num Num Num Num ListLoad Num Num Num body Assign NameStore BinOpMult NameLoad NameLoad Assign NameStore BinOpSub NameLoad NameLoad Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad SubscriptLoad NameLoad Index Num Index Num SubscriptLoad NameLoad Index Num ListLoad NameLoad Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad SubscriptLoad NameLoad Index Num Index Num SubscriptLoad NameLoad Index Num ListLoad NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad SubscriptLoad NameLoad Index Num Index Num SubscriptLoad NameLoad Index Num ListLoad NameLoad Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad SubscriptLoad NameLoad Index Num Index Num SubscriptLoad NameLoad Index Num ListLoad NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad Num keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad Num keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index NameLoad Assign TupleStore NameStore NameStore NameStore NameStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num Num Assign NameStore AttributeLoad NameLoad attr Assign NameStore BinOpSub Num AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index TupleLoad Num Num BinOpAdd BinOpMult BinOpDiv Num BinOpMult Num AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index TupleLoad Num Num BinOpAdd BinOpMult BinOpDiv Num BinOpMult Num AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index TupleLoad Num Num BinOpMult BinOpDiv Num AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Assign SubscriptStore NameLoad Index TupleLoad Num Num BinOpMult BinOpDiv Num AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Assign SubscriptStore NameLoad Index TupleLoad Num Num BinOpMult BinOpDiv Num AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Assign SubscriptStore NameLoad Index TupleLoad Num Num BinOpMult BinOpDiv Num AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Call AttributeLoad NameLoad attr ListLoad Str NameLoad body Import alias identifier Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Num SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Num keyword Num keyword Str keyword Str Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Num SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Num keyword Num keyword Str keyword Str If CompareGt SubscriptLoad AttributeLoad NameLoad attr Index Num Num body Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Num SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Num keyword Num keyword Str keyword Str If CompareGt SubscriptLoad AttributeLoad NameLoad attr Index Num Num body Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Num SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad Num keyword Num keyword Str keyword Str If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Str Str Expr Call AttributeLoad NameLoad attr Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Num keyword Str Assign NameStore BinOpDiv BinOpAdd BinOpMult BinOpSub SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num NameLoad BinOpSub SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num BinOpSub SubscriptLoad NameLoad Index TupleLoad Num Num SubscriptLoad NameLoad Index TupleLoad Num Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str keyword NameLoad keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Return TupleLoad NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body If CompareGt BinOpAdd BinOpAdd NameLoad NameLoad NameLoad Num body Print Str Return Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call NameLoad BinOpMult NameLoad NameLoad If CompareEq NameLoad Num body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Num NameLoad Slice Assign NameStore Call AttributeLoad NameLoad attr ListLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice NameLoad Slice orelse Assign NameStore Call NameLoad BinOpMult NameLoad BinOpAdd NameLoad NameLoad Print NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Num NameLoad Slice Assign NameStore SubscriptLoad NameLoad ExtSlice Slice NameLoad NameLoad Slice Assign NameStore SubscriptLoad NameLoad ExtSlice Slice NameLoad Slice Return TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list
N/A N/A 
This class generates a 2D dataset with two classes, "positive" and "negative".
Each class follows a Gaussian distribution.
 N/A numpy np SimpleDataSet N/A N/A N/A  
    A simple two dimentional dataset for visualization purposes. 
    The date set contains points from two gaussians with mean u_i and std_i
     __init__ N/A N/A self nr_examples g1 g2 balance split N/A 100 N/A N/A -5 -5 1 N/A N/A 5 5 1 0.5 N/A 0.8 0 0.2 N/A N/A nr_positive N/A nr_examples balance N/A nr_negative N/A nr_examples nr_positive N/A N/A self mean1 N/A g1 N/A 0 N/A N/A self mean2 N/A g2 N/A 0 N/A N/A self variance1 N/A g1 N/A 1 N/A N/A self variance2 N/A g2 N/A 1 N/A N/A self balance balance N/A N/A self nr_points nr_examples N/A X_pos_1 N/A N/A N/A np random normal N/A N/A g1 N/A 0 N/A 0 N/A g1 N/A 1 N/A nr_positive 1 N/A X_pos_2 N/A N/A N/A np random normal N/A N/A g1 N/A 0 N/A 1 N/A g1 N/A 1 N/A nr_positive 1 N/A X_pos N/A N/A np hstack N/A X_pos_1 X_pos_2 N/A X_neg_1 N/A N/A N/A np random normal N/A N/A g2 N/A 0 N/A 0 N/A g2 N/A 1 N/A nr_negative 1 N/A X_neg_2 N/A N/A N/A np random normal N/A N/A g2 N/A 0 N/A 1 N/A g2 N/A 1 N/A nr_negative 1 N/A X_neg N/A N/A np hstack N/A X_neg_1 X_neg_2 N/A y_pos N/A N/A np zeros N/A nr_positive 1 dtype N/A np int N/A y_neg N/A N/A np ones N/A nr_negative 1 dtype N/A np int N/A X N/A N/A np vstack N/A X_pos X_neg N/A y N/A N/A np vstack N/A y_pos y_neg N/A perm N/A N/A N/A np random permutation nr_examples N/A N/A self split split N/A N/A self X N/A X N/A N/A perm N/A N/A N/A self y N/A y N/A perm N/A N/A train_y dev_y test_y train_X dev_X test_X N/A split_train_dev_test N/A self X N/A self y N/A split N/A 0 N/A split N/A 1 N/A split N/A 2 N/A N/A self train_X train_X N/A N/A self train_y train_y N/A N/A self dev_X dev_X N/A N/A self dev_y dev_y N/A N/A self test_X test_X N/A N/A self test_y test_y N/A get_name N/A N/A self N/A N/A N/A N/A Simple Data Set -- Mean1= (%.2f,%.2f) Var1 = %.2f Mean2= (%.2f,%.2f) Var2= %.2f 
Nr. Points=%.2f, Balance=%.2f Train-Dev-Test (%.2f,.%.2f,%.2f) N/A N/A N/A self mean1 N/A 0 N/A N/A self mean1 N/A 1 N/A self variance1 N/A N/A self mean2 N/A 0 N/A N/A self mean2 N/A 1 N/A self variance2 N/A self nr_points N/A self balance N/A N/A self split N/A 0 N/A N/A self split N/A 1 N/A N/A self split N/A 2 N/A get_bayes_optimal N/A N/A self N/A N/A N/A params N/A N/A np zeros N/A 3 2 N/A p1 N/A self balance N/A p2 N/A 1.0 N/A self balance N/A N/A params N/A N/A 0 0 N/A N/A N/A -1.0 N/A 2.0 N/A self variance1 N/A N/A np dot N/A self mean1 N/A self mean1 N/A N/A np log p1 N/A N/A params N/A N/A 0 1 N/A N/A N/A -1.0 N/A 2.0 N/A self variance2 N/A N/A np dot N/A self mean2 N/A self mean2 N/A N/A np log p2 N/A N/A params N/A N/A 1 0 N/A N/A 1.0 N/A self variance1 N/A N/A self mean1 N/A 0 N/A N/A params N/A N/A 2 0 N/A N/A 1.0 N/A self variance1 N/A N/A self mean1 N/A 1 N/A N/A params N/A N/A 1 1 N/A N/A 1.0 N/A self variance2 N/A N/A self mean2 N/A 0 N/A N/A params N/A N/A 2 1 N/A N/A 1.0 N/A self variance2 N/A N/A self mean2 N/A 1 N/A params N/A plot_data N/A N/A self params name print_bayes_opt N/A N/A N/A np array N/A Naive Bayes True N/A N/A matplotlib.pyplot plt N/A fig N/A N/A plt figure N/A N/A N/A fig suptitle N/A N/A self get_name N/A axis N/A N/A fig add_subplot 1 1 1 N/A N/A idx _ N/A N/A np nonzero N/A N/A self train_y 0 N/A N/A idx2 _ N/A N/A np nonzero N/A N/A self train_y 1 N/A N/A idx3 _ N/A N/A np nonzero N/A N/A self test_y 0 N/A N/A idx4 _ N/A N/A np nonzero N/A N/A self test_y 1 N/A N/A N/A axis scatter N/A N/A self train_X N/A N/A idx 0 N/A N/A self train_X N/A N/A idx 1 s 30 c red marker s N/A N/A N/A axis scatter N/A N/A self train_X N/A N/A idx2 0 N/A N/A self train_X N/A N/A idx2 1 s 30 c blue marker s N/A N/A N/A N/A idx3 shape N/A 0 0 N/A N/A N/A N/A axis scatter N/A N/A self test_X N/A N/A idx3 0 N/A N/A self test_X N/A N/A idx3 1 s 30 c red marker o N/A N/A N/A N/A idx4 shape N/A 0 0 N/A N/A N/A N/A axis scatter N/A N/A self test_X N/A N/A idx4 0 N/A N/A self test_X N/A N/A idx4 1 s 30 c blue marker o N/A print_bayes_opt N/A N/A bayes_opt_params N/A N/A self get_bayes_optimal N/A N/A N/A self add_line fig axis bayes_opt_params Bayes Optimal black N/A N/A N/A axis legend N/A N/A fig axis N/A add_line N/A N/A self fig axis params name colour N/A N/A N/A x_max N/A N/A np max N/A self train_X N/A x_min N/A N/A np min N/A self train_X N/A x N/A N/A np arange x_min x_max 0.1 dtype float N/A y_star N/A N/A N/A N/A N/A params N/A N/A 1 1 N/A params N/A N/A 1 0 x N/A N/A params N/A N/A 0 1 N/A params N/A N/A 0 0 N/A N/A params N/A N/A 2 0 N/A params N/A N/A 2 1 N/A N/A N/A axis plot x y_star g-- c colour label name linewidth 2 N/A N/A N/A axis legend N/A N/A fig axis N/A N/A split_train_dev_test N/A N/A X y train_per dev_per test_per N/A N/A N/A N/A N/A N/A train_per dev_per test_per 1 N/A N/A Train Dev Test split should sum to one N/A N/A dim N/A N/A y shape N/A 0 N/A split1 N/A int N/A dim train_per N/A N/A dev_per 0 N/A N/A N/A train_y test_y N/A N/A np vsplit y N/A split1 N/A dev_y N/A N/A np array N/A N/A train_X N/A X N/A N/A 0 split1 N/A N/A dev_X N/A N/A np array N/A N/A test_X N/A X N/A N/A split1 N/A N/A N/A split2 N/A int N/A dim N/A train_per dev_per N/A split2 N/A N/A train_y dev_y test_y N/A N/A np vsplit y N/A split1 split2 N/A train_X N/A X N/A N/A 0 split1 N/A N/A dev_X N/A X N/A N/A split1 split2 N/A N/A test_X N/A X N/A N/A split2 N/A N/A N/A train_y dev_y test_y train_X dev_X test_X N/A