Module Import alias identifier ImportFrom alias ImportFrom alias alias ImportFrom alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore Call NameLoad keyword Num Assign NameStore Call NameLoad Assign NameStore Call NameLoad keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore Call NameLoad keyword Num keyword Num keyword Num Assign NameStore Call NameLoad keyword SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call NameLoad keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr ListComp ListLoad NameLoad NameLoad Num comprehension NameStore TupleLoad Num Num comprehension NameStore TupleLoad Num Num keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad Num Num Num Num Assign NameStore ListLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num Call AttributeLoad NameLoad attr ListLoad Num Num Num Num Call AttributeLoad NameLoad attr ListLoad Num Num Num Num Call AttributeLoad NameLoad attr ListLoad Num Num Num Num Assign NameStore Call NameLoad keyword Call NameLoad keyword Num keyword Num For TupleStore NameStore TupleStore NameStore NameStore Call NameLoad NameLoad Call NameLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr ListComp ListLoad NameLoad NameLoad Num comprehension NameStore TupleLoad Num Num comprehension NameStore TupleLoad Num Num keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad Num Num Num Num Assign NameStore Call NameLoad keyword Call NameLoad keyword Num keyword Num keyword Num keyword Num Assign NameStore Dict For NameStore TupleLoad Num Num Num Num body Expr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad AttributeLoad NameLoad attr Expr Call NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Expr Call NameLoad SubscriptLoad NameLoad Index Num ListLoad Num Num Num Expr Call NameLoad SubscriptLoad NameLoad Index Num ListLoad Num Num Num Expr Call NameLoad SubscriptLoad NameLoad Index Num ListLoad Num Num Num decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr ListComp ListLoad NameLoad NameLoad Num comprehension NameStore TupleLoad Num Num comprehension NameStore TupleLoad Num Num keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad Num Num Num Num Assign NameStore Call NameLoad keyword Call NameLoad keyword Num keyword Num keyword Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call NameLoad AttributeLoad NameLoad attr ListLoad Num Num Num Expr Call AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call NameLoad AttributeLoad NameLoad attr ListLoad Num Num Num decorator_list FunctionDef arguments args defaults body Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad AttributeLoad Call AttributeLoad NameLoad attr Str attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad Num Assign NameStore Call NameLoad keyword Call NameLoad keyword Num keyword Num keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num decorator_list FunctionDef arguments args defaults body Assign TupleStore NameStore NameStore Call NameLoad keyword Num keyword Num keyword Num Assign TupleStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Slice Num SubscriptLoad NameLoad Slice Num Assign TupleStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Slice Num SubscriptLoad NameLoad Slice Num Assign NameStore Call NameLoad Assign NameStore Call NameLoad keyword NameLoad keyword Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad decorator_list
N/A N/A numpy np itertools product numpy.testing assert_array_equal assert_array_almost_equal nose.tools assert_greater assert_true pystruct.models GridCRF BinaryClf pystruct.learners StructuredPerceptron pystruct.datasets generate_blocks generate_blocks_multinomial test_binary_blocks N/A N/A N/A N/A N/A N/A X Y N/A generate_blocks n_samples 10 N/A crf N/A GridCRF N/A clf N/A StructuredPerceptron model crf max_iter 40 N/A N/A N/A clf fit X Y N/A Y_pred N/A N/A clf predict X N/A N/A assert_array_equal Y Y_pred N/A test_multinomial_blocks N/A N/A N/A N/A N/A N/A X Y N/A generate_blocks_multinomial n_samples 10 noise 0.3 seed 0 N/A crf N/A GridCRF n_states N/A N/A X shape N/A -1 N/A clf N/A StructuredPerceptron model crf max_iter 10 N/A N/A N/A clf fit X Y N/A Y_pred N/A N/A clf predict X N/A N/A assert_array_equal Y Y_pred N/A test_xor N/A N/A N/A N/A N/A Test perceptron behaviour against hand-computed values for XOR N/A X N/A N/A np array N/A N/A a b 1 N/A a N/A -1 1 N/A b N/A -1 1 dtype N/A np float N/A Y N/A N/A np array N/A -1 1 1 -1 N/A expected_predictions N/A N/A N/A np array N/A 1 1 1 1 N/A N/A np array N/A -1 1 -1 1 N/A N/A np array N/A 1 1 1 1 N/A N/A np array N/A -1 -1 -1 -1 N/A pcp N/A StructuredPerceptron model N/A BinaryClf n_features 3 max_iter 2 N/A N/A pred N/A batch average N/A zip expected_predictions N/A product N/A False True N/A False True N/A N/A N/A N/A pcp set_params batch batch average average N/A N/A N/A pcp fit X Y N/A N/A assert_array_equal N/A N/A pcp predict X pred N/A test_partial_averaging N/A N/A N/A N/A N/A Use XOR weight cycling to test partial averaging N/A X N/A N/A np array N/A N/A a b 1 N/A a N/A -1 1 N/A b N/A -1 1 dtype N/A np float N/A Y N/A N/A np array N/A -1 1 1 -1 N/A pcp N/A StructuredPerceptron model N/A BinaryClf n_features 3 max_iter 5 decay_exponent 1 decay_t0 1 N/A weight N/A N/A average N/A 0 1 4 -1 N/A N/A N/A N/A pcp set_params average average N/A N/A N/A pcp fit X Y N/A N/A weight N/A average N/A pcp w N/A N/A assert_array_equal N/A weight N/A 4 N/A weight N/A -1 N/A N/A assert_array_almost_equal N/A weight N/A 0 N/A 1.5 3 0 N/A N/A assert_array_almost_equal N/A weight N/A 1 N/A 1.75 3.5 0 N/A N/A assert_array_almost_equal N/A weight N/A 4 N/A 2.5 5 0 N/A test_averaging_early_stopping N/A N/A N/A N/A N/A Test averaging over final epoch when early stopping N/A X N/A N/A np array N/A N/A a b 1 N/A a N/A -1 1 N/A b N/A -1 1 dtype N/A np float N/A Y N/A N/A np array N/A -1 1 1 1 N/A pcp N/A StructuredPerceptron model N/A BinaryClf n_features 3 max_iter 3 average -1 N/A N/A N/A pcp fit X Y N/A N/A assert_array_equal N/A pcp w N/A 1 1 1 N/A N/A N/A pcp set_params average 2 N/A N/A N/A pcp fit X Y N/A N/A assert_array_equal N/A pcp w N/A 0 0 0 N/A test_overflow_averaged N/A N/A N/A N/A N/A X N/A N/A np array N/A N/A N/A N/A N/A np finfo d max N/A Y N/A N/A np array N/A -1 N/A pcp N/A StructuredPerceptron model N/A BinaryClf n_features 1 max_iter 2 average True N/A N/A N/A pcp fit X Y N/A N/A assert_true N/A N/A np isfinite N/A N/A pcp w N/A 0 N/A test_averaged N/A N/A N/A N/A N/A N/A X Y N/A generate_blocks_multinomial n_samples 15 noise 3 seed 0 N/A N/A X_train Y_train N/A N/A X N/A 10 N/A Y N/A 10 N/A N/A X_test Y_test N/A N/A X N/A 10 N/A Y N/A 10 N/A crf N/A GridCRF N/A clf N/A StructuredPerceptron model crf max_iter 3 N/A N/A N/A clf fit X_train Y_train N/A no_avg_test N/A N/A clf score X_test Y_test N/A N/A N/A clf set_params average True N/A N/A N/A clf fit X_train Y_train N/A avg_test N/A N/A clf score X_test Y_test N/A N/A assert_greater avg_test no_avg_test N/A