Module Import alias identifier Import alias identifier ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam NameParam defaults Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Index Num If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad orelse If CompareEq AttributeLoad NameLoad attr Str body Print Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad orelse Print Str Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareEq NameLoad SubscriptLoad NameLoad Index NameLoad Assign SubscriptStore NameLoad Index NameLoad BinOpDiv BinOpMult Num Call NameLoad NameLoad Call NameLoad NameLoad For NameStore Call NameLoad NameLoad body Assign NameStore Call NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad BinOpAdd NameLoad Num NameLoad For NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index TupleLoad Num NameLoad BinOpAdd BinOpMult BinOpDiv Num BinOpMult Num SubscriptLoad NameLoad Index NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Index NameLoad Slice SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Num Index NameLoad Call AttributeLoad BinOpMult BinOpDiv Num SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Dict Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore Call NameLoad NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareEq NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad Num For NameStore Call NameLoad NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr CompareEq NameLoad SubscriptLoad NameLoad Index NameLoad Assign SubscriptStore NameLoad Index NameLoad BinOpDiv BinOpMult Num Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore Call AttributeLoad SubscriptLoad NameLoad ExtSlice Index NameLoad Slice attr Num AugAssignAdd SubscriptStore NameLoad ExtSlice Slice Index Num NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index NameLoad NameLoad For NameStore Call NameLoad NameLoad body For NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpDiv SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad BinOpAdd NameLoad Num NameLoad For NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index TupleLoad Num NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Num Index NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Return NameLoad decorator_list decorator_list
N/A N/A numpy np N/A linear_classifier lc gaussian * NaiveBayes N/A N/A lc LinearClassifier N/A __init__ N/A N/A self xtype N/A gaussian N/A N/A N/A N/A N/A lc LinearClassifier __init__ self N/A N/A self trained False N/A N/A self xtype xtype N/A train N/A N/A self x y N/A N/A N/A N/A nr_x nr_f N/A x shape N/A nr_c N/A N/A N/A N/A np unique y shape N/A 0 N/A N/A N/A self xtype gaussian N/A N/A params N/A N/A self train_gaussian x y nr_x nr_f nr_c N/A N/A N/A N/A self xtype Multinomial N/A N/A Training a multinomial N/A params N/A N/A self train_multinomial x y nr_x nr_f nr_c N/A N/A Naive Bayes not implemented for this type of model of P(X|Y) N/A N/A self trained True N/A params N/A train_gaussian N/A N/A self x y nr_x nr_f nr_c N/A N/A N/A prior N/A N/A np zeros nr_c N/A likelihood N/A N/A np zeros N/A nr_f nr_c N/A classes N/A N/A np unique y N/A means N/A N/A np zeros N/A nr_c nr_f N/A variances N/A N/A np zeros N/A nr_c nr_f N/A i N/A xrange nr_c N/A N/A N/A idx _ N/A N/A np nonzero N/A y N/A classes N/A i N/A N/A prior N/A i N/A N/A 1.0 N/A len idx N/A len y N/A f N/A xrange nr_f N/A N/A g N/A estimate_gaussian N/A x N/A N/A idx f N/A N/A means N/A N/A i f N/A g mean N/A N/A variances N/A N/A i f N/A g variance N/A variances N/A N/A np mean variances 1 N/A params N/A N/A np zeros N/A N/A nr_f 1 nr_c N/A i N/A xrange nr_c N/A N/A N/A params N/A N/A 0 i N/A N/A N/A -1 N/A 2 N/A variances N/A i N/A N/A np dot N/A means N/A N/A i N/A N/A means N/A N/A i N/A N/A N/A np log N/A prior N/A i N/A N/A params N/A N/A 1 N/A i N/A N/A N/A N/A 1 N/A variances N/A i N/A means N/A i transpose N/A params N/A train_multinomial N/A N/A self x y nr_x nr_f nr_c N/A N/A N/A prior N/A N/A np zeros nr_c N/A ind_per_class N/A N/A classes N/A N/A np unique y N/A i N/A xrange nr_c N/A N/A N/A idx _ N/A N/A np nonzero N/A y N/A classes N/A i N/A ind_per_class idx N/A likelihood N/A N/A np zeros N/A nr_f nr_c N/A sums N/A N/A np zeros N/A nr_f 1 N/A i N/A xrange nr_c N/A N/A N/A idx _ N/A N/A np nonzero N/A y N/A classes N/A i N/A N/A prior N/A i N/A N/A 1.0 N/A len idx N/A len y N/A value N/A N/A N/A x N/A N/A idx N/A sum 0 N/A N/A sums N/A N/A N/A 0 value N/A N/A likelihood N/A N/A N/A i value N/A f N/A xrange nr_f N/A N/A i N/A xrange nr_c N/A N/A N/A likelihood N/A N/A f i N/A N/A likelihood N/A N/A f i N/A sums N/A N/A f 0 N/A params N/A N/A np zeros N/A N/A nr_f 1 nr_c N/A i N/A xrange nr_c N/A N/A N/A params N/A N/A 0 i N/A N/A np log N/A prior N/A i N/A N/A params N/A N/A 1 N/A i N/A N/A np nan_to_num N/A N/A np log N/A likelihood N/A N/A N/A i N/A params N/A N/A