Module ImportFrom alias Import alias identifier Import alias ImportFrom alias ImportFrom alias alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Num Assign NameStore Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr ListLoad Num Num Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num ListLoad Num Num Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num Num ListLoad Num Num Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad ListLoad Num ListLoad Num ListLoad Num Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword Str Assert CompareEq Call NameLoad Call AttributeLoad NameLoad attr NameLoad Num Num Assert Call AttributeLoad NameLoad attr NameLoad ListLoad Num Num Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad ListLoad Num ListLoad Num ListLoad Num Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword Str Assert Call AttributeLoad NameLoad attr NameLoad ListLoad Num Num Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad ListLoad Num ListLoad Num ListLoad Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assert Call AttributeLoad NameLoad attr NameLoad ListLoad Num Num Num Assert Call AttributeLoad NameLoad attr NameLoad ListLoad ListLoad Num Num ListLoad Num Num ListLoad Num Num decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr ListLoad Num Num Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num ListLoad Num Num Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num Num ListLoad Num Num Num decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameLoad body Assign AttributeStore AttributeLoad NameLoad attr attr ListLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr With Call AttributeLoad NameLoad attr NameLoad body Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr TupleLoad BinOpSub AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr keyword TupleLoad NameLoad Num Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assert CompareEq AttributeLoad NameLoad attr TupleLoad NameLoad AttributeLoad NameLoad attr Assert Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword Num Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assert CompareEq AttributeLoad NameLoad attr Num Assert CompareEqEq Call NameLoad NameLoad Call NameLoad NameLoad NameLoad Assert CompareEq Call NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str Num body Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpMult ListLoad Num Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Num Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Num Assert Call NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str Num body Assign NameStore BinOpMult ListLoad Num Num Assign TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assert Call NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assert Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad ListLoad Num Num Num Num Num Num Num Assert UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad ListLoad Num Num Num Num Num Assert UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad ListLoad Num Assert UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad ListLoad Num Num Num Num Assert UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad ListLoad Num Num Num Num Num Num Num decorator_list decorator_list
N/A __future__ absolute_import N/A numpy np N/A pytest hmmlearn hmm N/A log_likelihood_increasing normalized TestMultinomialAgainstWikipedia N/A object N/A N/A Using examples from Wikipedia

    - http://en.wikipedia.org/wiki/Hidden_Markov_model
    - http://en.wikipedia.org/wiki/Viterbi_algorithm
     setup_method N/A N/A self method N/A N/A N/A n_components 2 N/A n_features 3 N/A N/A self h N/A N/A hmm MultinomialHMM n_components N/A N/A N/A self h n_features n_features N/A N/A N/A self h startprob_ N/A N/A np array N/A 0.6 0.4 N/A N/A N/A self h transmat_ N/A N/A np array N/A N/A 0.7 0.3 N/A 0.4 0.6 N/A N/A N/A self h emissionprob_ N/A N/A np array N/A N/A 0.1 0.4 0.5 N/A 0.6 0.3 0.1 N/A test_decode_viterbi N/A N/A self N/A N/A N/A X N/A N/A 0 N/A 1 N/A 2 N/A N/A logprob state_sequence N/A N/A N/A self h decode X algorithm viterbi N/A N/A N/A round N/A N/A np exp logprob 5 0.01344 N/A N/A N/A np allclose state_sequence N/A 1 0 0 N/A test_decode_map N/A N/A self N/A N/A N/A X N/A N/A 0 N/A 1 N/A 2 N/A N/A _logprob state_sequence N/A N/A N/A self h decode X algorithm map N/A N/A N/A np allclose state_sequence N/A 1 0 0 N/A test_predict N/A N/A self N/A N/A N/A X N/A N/A 0 N/A 1 N/A 2 N/A state_sequence N/A N/A N/A self h predict X N/A posteriors N/A N/A N/A self h predict_proba X N/A N/A N/A np allclose state_sequence N/A 1 0 0 N/A N/A N/A np allclose posteriors N/A N/A 0.23170303 0.76829697 N/A 0.62406281 0.37593719 N/A 0.86397706 0.13602294 N/A N/A TestMultinomailHMM N/A object N/A setup_method N/A N/A self method N/A N/A N/A N/A self n_components 2 N/A N/A self n_features 3 N/A N/A self h N/A N/A hmm MultinomialHMM N/A self n_components N/A N/A N/A self h startprob_ N/A N/A np array N/A 0.6 0.4 N/A N/A N/A self h transmat_ N/A N/A np array N/A N/A 0.7 0.3 N/A 0.4 0.6 N/A N/A N/A self h emissionprob_ N/A N/A np array N/A N/A 0.1 0.4 0.5 N/A 0.6 0.3 0.1 N/A test_attributes N/A N/A self N/A N/A N/A N/A N/A pytest raises ValueError N/A N/A N/A N/A self h emissionprob_ N/A N/A N/A N/A N/A self h _check N/A N/A N/A pytest raises ValueError N/A N/A N/A N/A self h emissionprob_ N/A N/A np zeros N/A N/A N/A self n_components 2 N/A self n_features N/A N/A N/A N/A self h _check N/A test_score_samples N/A N/A self N/A N/A N/A idx N/A N/A np repeat N/A N/A np arange N/A self n_components 10 N/A n_samples N/A len idx N/A X N/A N/A N/A np random randint N/A self n_features size N/A n_samples 1 N/A N/A ll posteriors N/A N/A N/A self h score_samples X N/A N/A N/A posteriors shape N/A n_samples N/A self n_components N/A N/A N/A np allclose N/A N/A posteriors sum axis 1 N/A N/A np ones n_samples N/A test_sample N/A N/A self n_samples N/A 1000 N/A N/A N/A X state_sequence N/A N/A N/A self h sample n_samples N/A N/A N/A X ndim 2 N/A N/A N/A len X N/A len state_sequence n_samples N/A N/A N/A len N/A N/A np unique X N/A self n_features N/A test_fit N/A N/A self params n_iter N/A ste 5 N/A N/A h N/A self h N/A N/A h params params N/A lengths N/A N/A np array N/A N/A 10 10 N/A N/A X _state_sequence N/A N/A h sample N/A N/A lengths sum N/A N/A h startprob_ N/A normalized N/A N/A N/A np random random N/A self n_components N/A N/A h transmat_ N/A normalized N/A N/A N/A np random random N/A N/A self n_components N/A self n_components axis 1 N/A N/A h emissionprob_ N/A normalized N/A N/A N/A np random random N/A N/A self n_components N/A self n_features axis 1 N/A N/A log_likelihood_increasing h X lengths n_iter N/A test_fit_emissionprob N/A N/A self N/A N/A N/A N/A N/A self test_fit e N/A test_fit_with_init N/A N/A self params n_iter N/A ste 5 N/A N/A lengths N/A N/A 10 10 N/A N/A X _state_sequence N/A N/A N/A self h sample N/A sum lengths N/A h N/A N/A hmm MultinomialHMM N/A self n_components params params init_params params N/A N/A N/A h _init X lengths lengths N/A N/A log_likelihood_increasing h X lengths n_iter N/A test__check_input_symbols N/A N/A self N/A N/A N/A N/A N/A N/A self h _check_input_symbols N/A N/A 0 0 2 1 3 1 1 N/A N/A N/A N/A N/A self h _check_input_symbols N/A N/A 0 0 3 5 10 N/A N/A N/A N/A N/A self h _check_input_symbols N/A N/A 0 N/A N/A N/A N/A N/A self h _check_input_symbols N/A N/A 0.0 2.0 1.0 3.0 N/A N/A N/A N/A N/A self h _check_input_symbols N/A N/A 0 0 -2 1 3 1 1 N/A N/A