Created
April 30, 2018 20:36
-
-
Save jkleckner/bb116786eb692937cc015030a76eff5f to your computer and use it in GitHub Desktop.
Pomegranate 0.9.0 ipython notebook errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for nb in examples/*.ipynb tutorials/*.ipynb benchmarks/*.ipynb ; do time jupyter nbconvert $nb --execute --ExecutePreprocessor.timeout=600 --to html ; done | |
[NbConvertApp] Converting notebook examples/bayesnet_asia.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'examples/bayesnet_asia.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
network.bake() | |
------------------ | |
[0;31m[0m | |
[0;31mAttributeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-9-9830b7bec95c>[0m in [0;36m<module>[0;34m()[0m | |
[0;32m----> 1[0;31m [0mnetwork[0m[0;34m.[0m[0mbake[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0m | |
[0m | |
[0;32mpomegranate/BayesianNetwork.pyx[0m in [0;36mpomegranate.BayesianNetwork.BayesianNetwork.bake[0;34m()[0m | |
[0;31mAttributeError[0m: 'list' object has no attribute 'distribution' | |
AttributeError: 'list' object has no attribute 'distribution' | |
real 0m3.003s | |
user 0m1.900s | |
sys 0m0.556s | |
[NbConvertApp] Converting notebook examples/bayesnet_huge_monty_hall.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'examples/bayesnet_huge_monty_hall.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
network.bake() | |
------------------ | |
[0;31m[0m | |
[0;31mAttributeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-11-9830b7bec95c>[0m in [0;36m<module>[0;34m()[0m | |
[0;32m----> 1[0;31m [0mnetwork[0m[0;34m.[0m[0mbake[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0m | |
[0m | |
[0;32mpomegranate/BayesianNetwork.pyx[0m in [0;36mpomegranate.BayesianNetwork.BayesianNetwork.bake[0;34m()[0m | |
[0;31mAttributeError[0m: 'list' object has no attribute 'distribution' | |
AttributeError: 'list' object has no attribute 'distribution' | |
real 0m3.050s | |
user 0m1.953s | |
sys 0m0.588s | |
[NbConvertApp] Converting notebook examples/bayesnet_monty_hall_classic.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'examples/bayesnet_monty_hall_classic.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
network.bake() | |
------------------ | |
[0;31m[0m | |
[0;31mAttributeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-7-9830b7bec95c>[0m in [0;36m<module>[0;34m()[0m | |
[0;32m----> 1[0;31m [0mnetwork[0m[0;34m.[0m[0mbake[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0m | |
[0m | |
[0;32mpomegranate/BayesianNetwork.pyx[0m in [0;36mpomegranate.BayesianNetwork.BayesianNetwork.bake[0;34m()[0m | |
[0;31mAttributeError[0m: 'list' object has no attribute 'distribution' | |
AttributeError: 'list' object has no attribute 'distribution' | |
real 0m2.987s | |
user 0m1.869s | |
sys 0m0.545s | |
[NbConvertApp] Converting notebook examples/bayesnet_monty_hall_train.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'examples/bayesnet_monty_hall_train.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
network.bake() | |
------------------ | |
[0;31m[0m | |
[0;31mAttributeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-7-9830b7bec95c>[0m in [0;36m<module>[0;34m()[0m | |
[0;32m----> 1[0;31m [0mnetwork[0m[0;34m.[0m[0mbake[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0m | |
[0m | |
[0;32mpomegranate/BayesianNetwork.pyx[0m in [0;36mpomegranate.BayesianNetwork.BayesianNetwork.bake[0;34m()[0m | |
[0;31mAttributeError[0m: 'list' object has no attribute 'distribution' | |
AttributeError: 'list' object has no attribute 'distribution' | |
real 0m2.981s | |
user 0m1.870s | |
sys 0m0.535s | |
[NbConvertApp] Converting notebook examples/distributions_conditionalupdate.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] Writing 265631 bytes to examples/distributions_conditionalupdate.html | |
real 0m3.137s | |
user 0m1.914s | |
sys 0m0.506s | |
[NbConvertApp] Converting notebook examples/distributions_test_table.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'examples/distributions_test_table.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
model.bake() | |
------------------ | |
[0;31m[0m | |
[0;31mAttributeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-7-cac6a8d0d4df>[0m in [0;36m<module>[0;34m()[0m | |
[0;32m----> 1[0;31m [0mmodel[0m[0;34m.[0m[0mbake[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0m | |
[0m | |
[0;32mpomegranate/BayesianNetwork.pyx[0m in [0;36mpomegranate.BayesianNetwork.BayesianNetwork.bake[0;34m()[0m | |
[0;31mAttributeError[0m: 'list' object has no attribute 'distribution' | |
AttributeError: 'list' object has no attribute 'distribution' | |
real 0m2.953s | |
user 0m1.841s | |
sys 0m0.542s | |
[NbConvertApp] Converting notebook examples/hmm_example.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] Writing 266845 bytes to examples/hmm_example.html | |
real 0m3.221s | |
user 0m2.062s | |
sys 0m0.522s | |
[NbConvertApp] Converting notebook examples/hmm_infinite.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'examples/hmm_infinite.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
print model.is_infinite() | |
------------------ | |
[0;31m[0m | |
[0;31mAttributeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-6-a03e3e953f15>[0m in [0;36m<module>[0;34m()[0m | |
[0;32m----> 1[0;31m [0;32mprint[0m [0mmodel[0m[0;34m.[0m[0mis_infinite[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0m | |
[0m | |
[0;31mAttributeError[0m: 'pomegranate.hmm.HiddenMarkovModel' object has no attribute 'is_infinite' | |
AttributeError: 'pomegranate.hmm.HiddenMarkovModel' object has no attribute 'is_infinite' | |
real 0m2.991s | |
user 0m1.858s | |
sys 0m0.533s | |
[NbConvertApp] Converting notebook examples/hmm_rainy_sunny.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] Writing 265172 bytes to examples/hmm_rainy_sunny.html | |
real 0m3.203s | |
user 0m1.976s | |
sys 0m0.513s | |
[NbConvertApp] Converting notebook examples/hmm_tied_states.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] Writing 287243 bytes to examples/hmm_tied_states.html | |
real 0m3.313s | |
user 0m2.201s | |
sys 0m0.521s | |
[NbConvertApp] Converting notebook examples/naivebayes_bayes_net.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'examples/naivebayes_bayes_net.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
arid.bake() | |
------------------ | |
[0;31m[0m | |
[0;31mAttributeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-7-3c71c5503016>[0m in [0;36m<module>[0;34m()[0m | |
[0;32m----> 1[0;31m [0marid[0m[0;34m.[0m[0mbake[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0m | |
[0m | |
[0;32mpomegranate/BayesianNetwork.pyx[0m in [0;36mpomegranate.BayesianNetwork.BayesianNetwork.bake[0;34m()[0m | |
[0;31mAttributeError[0m: 'list' object has no attribute 'distribution' | |
AttributeError: 'list' object has no attribute 'distribution' | |
real 0m2.996s | |
user 0m1.876s | |
sys 0m0.534s | |
[NbConvertApp] Converting notebook examples/naivebayes_hmm_cheating_coin_toss.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'examples/naivebayes_hmm_cheating_coin_toss.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
plt.title("smart cheater hmm") | |
smart_cheater.draw() | |
plt.title("dumb cheater hmm") | |
dumb_cheater.draw() | |
plt.title("non-cheater hmm") | |
non_cheater.draw() | |
------------------ | |
[0;31m[0m | |
[0;31mValueError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-11-e0ebc1e73762>[0m in [0;36m<module>[0;34m()[0m | |
[1;32m 1[0m [0mplt[0m[0;34m.[0m[0mtitle[0m[0;34m([0m[0;34m"smart cheater hmm"[0m[0;34m)[0m[0;34m[0m[0m | |
[0;32m----> 2[0;31m [0msmart_cheater[0m[0;34m.[0m[0mdraw[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 3[0m [0;34m[0m[0m | |
[1;32m 4[0m [0mplt[0m[0;34m.[0m[0mtitle[0m[0;34m([0m[0;34m"dumb cheater hmm"[0m[0;34m)[0m[0;34m[0m[0m | |
[1;32m 5[0m [0mdumb_cheater[0m[0;34m.[0m[0mdraw[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0m | |
[0;32mpomegranate/hmm.pyx[0m in [0;36mpomegranate.hmm.HiddenMarkovModel.draw[0;34m()[0m | |
[0;31mValueError[0m: depricated. Please use .plot | |
ValueError: depricated. Please use .plot | |
real 0m3.003s | |
user 0m2.360s | |
sys 0m0.636s | |
[NbConvertApp] Converting notebook examples/naivebayes_multivariate_male_female.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'examples/naivebayes_multivariate_male_female.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
model = NaiveBayes( MultivariateGaussianDistribution, n_components=2 ) | |
------------------ | |
[0;31m[0m | |
[0;31mTypeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-2-444463433f16>[0m in [0;36m<module>[0;34m()[0m | |
[0;32m----> 1[0;31m [0mmodel[0m [0;34m=[0m [0mNaiveBayes[0m[0;34m([0m [0mMultivariateGaussianDistribution[0m[0;34m,[0m [0mn_components[0m[0;34m=[0m[0;36m2[0m [0;34m)[0m[0;34m[0m[0m | |
[0m | |
[0;32mpomegranate/NaiveBayes.pyx[0m in [0;36mpomegranate.NaiveBayes.NaiveBayes.__init__[0;34m()[0m | |
[0;31mTypeError[0m: __init__() got an unexpected keyword argument 'n_components' | |
TypeError: __init__() got an unexpected keyword argument 'n_components' | |
real 0m2.995s | |
user 0m1.801s | |
sys 0m0.526s | |
[NbConvertApp] Converting notebook examples/naivebayes_rain_fog.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'examples/naivebayes_rain_fog.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
rain2fog.bake() | |
------------------ | |
[0;31m[0m | |
[0;31mAttributeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-7-7daa8e30eaa8>[0m in [0;36m<module>[0;34m()[0m | |
[0;32m----> 1[0;31m [0mrain2fog[0m[0;34m.[0m[0mbake[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0m | |
[0m | |
[0;32mpomegranate/BayesianNetwork.pyx[0m in [0;36mpomegranate.BayesianNetwork.BayesianNetwork.bake[0;34m()[0m | |
[0;31mAttributeError[0m: 'list' object has no attribute 'distribution' | |
AttributeError: 'list' object has no attribute 'distribution' | |
real 0m3.025s | |
user 0m1.937s | |
sys 0m0.552s | |
[NbConvertApp] Converting notebook examples/naivebayes_simple_male_female.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'examples/naivebayes_simple_male_female.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
data = np.array([ 5.0, 6.0, 4.92, 5.5 ]) | |
for sample, probability in zip( data, clf.predict_proba(data) ): | |
print "Height {:5.3}, {:5.3}% chance male and {:5.3}% chance female".format( sample, 100*probability[0], 100*probability[1]) | |
------------------ | |
[0;31m[0m | |
[0;31mValueError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-5-922063a123f3>[0m in [0;36m<module>[0;34m()[0m | |
[1;32m 1[0m [0mdata[0m [0;34m=[0m [0mnp[0m[0;34m.[0m[0marray[0m[0;34m([0m[0;34m[[0m [0;36m5.0[0m[0;34m,[0m [0;36m6.0[0m[0;34m,[0m [0;36m4.92[0m[0;34m,[0m [0;36m5.5[0m [0;34m][0m[0;34m)[0m[0;34m[0m[0m | |
[1;32m 2[0m [0;34m[0m[0m | |
[0;32m----> 3[0;31m [0;32mfor[0m [0msample[0m[0;34m,[0m [0mprobability[0m [0;32min[0m [0mzip[0m[0;34m([0m [0mdata[0m[0;34m,[0m [0mclf[0m[0;34m.[0m[0mpredict_proba[0m[0;34m([0m[0mdata[0m[0;34m)[0m [0;34m)[0m[0;34m:[0m[0;34m[0m[0m | |
[0m[1;32m 4[0m [0;32mprint[0m [0;34m"Height {:5.3}, {:5.3}% chance male and {:5.3}% chance female"[0m[0;34m.[0m[0mformat[0m[0;34m([0m [0msample[0m[0;34m,[0m [0;36m100[0m[0;34m*[0m[0mprobability[0m[0;34m[[0m[0;36m0[0m[0;34m][0m[0;34m,[0m [0;36m100[0m[0;34m*[0m[0mprobability[0m[0;34m[[0m[0;36m1[0m[0;34m][0m[0;34m)[0m[0;34m[0m[0m | |
[0;32mpomegranate/bayes.pyx[0m in [0;36mpomegranate.bayes.BayesModel.predict_proba[0;34m()[0m | |
[0;32mpomegranate/bayes.pyx[0m in [0;36mpomegranate.bayes.BayesModel.predict_log_proba[0;34m()[0m | |
[0;31mValueError[0m: sample only has 4 dimensions but should have 1 dimensions | |
ValueError: sample only has 4 dimensions but should have 1 dimensions | |
real 0m4.115s | |
user 0m2.952s | |
sys 0m0.759s | |
[NbConvertApp] Converting notebook tutorials/Tutorial_0_pomegranate_overview.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'tutorials/Tutorial_0_pomegranate_overview.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
d = model.predict_proba() | |
print "\t".join( "{:7}".format(state.name) for state in model.states ) | |
print "\t".join( "{:4.2}".format(model.parameters[0][1]) for model in d ) | |
------------------ | |
[0;31m[0m | |
[0;31mTypeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-69-1225edac175c>[0m in [0;36m<module>[0;34m()[0m | |
[0;32m----> 1[0;31m [0md[0m [0;34m=[0m [0mmodel[0m[0;34m.[0m[0mpredict_proba[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 2[0m [0;32mprint[0m [0;34m"\t"[0m[0;34m.[0m[0mjoin[0m[0;34m([0m [0;34m"{:7}"[0m[0;34m.[0m[0mformat[0m[0;34m([0m[0mstate[0m[0;34m.[0m[0mname[0m[0;34m)[0m [0;32mfor[0m [0mstate[0m [0;32min[0m [0mmodel[0m[0;34m.[0m[0mstates[0m [0;34m)[0m[0;34m[0m[0m | |
[1;32m 3[0m [0;32mprint[0m [0;34m"\t"[0m[0;34m.[0m[0mjoin[0m[0;34m([0m [0;34m"{:4.2}"[0m[0;34m.[0m[0mformat[0m[0;34m([0m[0mmodel[0m[0;34m.[0m[0mparameters[0m[0;34m[[0m[0;36m0[0m[0;34m][0m[0;34m[[0m[0;36m1[0m[0;34m][0m[0;34m)[0m [0;32mfor[0m [0mmodel[0m [0;32min[0m [0md[0m [0;34m)[0m[0;34m[0m[0m | |
[0;32mpomegranate/BayesianNetwork.pyx[0m in [0;36mpomegranate.BayesianNetwork.BayesianNetwork.predict_proba[0;34m()[0m | |
[0;31mTypeError[0m: predict_proba() takes at least 1 positional argument (0 given) | |
TypeError: predict_proba() takes at least 1 positional argument (0 given) | |
real 5m17.572s | |
user 7m58.086s | |
sys 1m40.904s | |
[NbConvertApp] Converting notebook tutorials/Tutorial_1_Distributions.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'tutorials/Tutorial_1_Distributions.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
data = [['A', 'B', 'C'], | |
['B', 'B', 'A'], | |
['A', 'B', 'A'], | |
['C', 'C', 'B'], | |
['C', 'C', 'A'], | |
['C', 'C', 'A']] | |
a.fit(data) | |
print a | |
------------------ | |
[0;31m[0m | |
[0;31mAttributeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-29-7fba55225dcf>[0m in [0;36m<module>[0;34m()[0m | |
[1;32m 6[0m ['C', 'C', 'A']] | |
[1;32m 7[0m [0;34m[0m[0m | |
[0;32m----> 8[0;31m [0ma[0m[0;34m.[0m[0mfit[0m[0;34m([0m[0mdata[0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 9[0m [0;32mprint[0m [0ma[0m[0;34m[0m[0m | |
[0;32mpomegranate/distributions.pyx[0m in [0;36mpomegranate.distributions.JointProbabilityTable.fit[0;34m()[0m | |
[0;32mpomegranate/distributions.pyx[0m in [0;36mpomegranate.distributions.JointProbabilityTable.summarize[0;34m()[0m | |
[0;31mAttributeError[0m: 'pomegranate.distributions.JointProbabilityTable' object has no attribute '_table_summarize' | |
AttributeError: 'pomegranate.distributions.JointProbabilityTable' object has no attribute '_table_summarize' | |
real 0m7.285s | |
user 0m8.403s | |
sys 0m1.492s | |
[NbConvertApp] Converting notebook tutorials/Tutorial_2_General_Mixture_Models.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] Writing 298254 bytes to tutorials/Tutorial_2_General_Mixture_Models.html | |
real 0m3.347s | |
user 0m3.261s | |
sys 0m0.776s | |
[NbConvertApp] Converting notebook tutorials/Tutorial_3_Hidden_Markov_Models.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] Writing 381711 bytes to tutorials/Tutorial_3_Hidden_Markov_Models.html | |
real 0m4.543s | |
user 0m3.298s | |
sys 0m0.737s | |
[NbConvertApp] Converting notebook tutorials/Tutorial_4_Bayesian_Networks.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] Writing 371203 bytes to tutorials/Tutorial_4_Bayesian_Networks.html | |
real 9m58.416s | |
user 9m54.265s | |
sys 0m3.104s | |
[NbConvertApp] Converting notebook tutorials/Tutorial_4b_Bayesian_Network_Structure_Learning.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'tutorials/Tutorial_4b_Bayesian_Network_Structure_Learning.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
%pylab inline | |
%load_ext memory_profiler | |
from pomegranate import BayesianNetwork | |
import seaborn, time | |
seaborn.set_style('whitegrid') | |
X = numpy.random.randint(2, size=(2000, 7)) | |
X[:,3] = X[:,1] | |
X[:,6] = X[:,1] | |
X[:,0] = X[:,2] | |
X[:,4] = X[:,5] | |
model = BayesianNetwork.from_samples(X, algorithm='exact') | |
print model.structure | |
model.plot() | |
------------------ | |
[0;31m[0m | |
[0;31mImportError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-1-5df0d5e5583b>[0m in [0;36m<module>[0;34m()[0m | |
[1;32m 1[0m [0mget_ipython[0m[0;34m([0m[0;34m)[0m[0;34m.[0m[0mmagic[0m[0;34m([0m[0;34mu'pylab inline'[0m[0;34m)[0m[0;34m[0m[0m | |
[0;32m----> 2[0;31m [0mget_ipython[0m[0;34m([0m[0;34m)[0m[0;34m.[0m[0mmagic[0m[0;34m([0m[0;34mu'load_ext memory_profiler'[0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 3[0m [0;32mfrom[0m [0mpomegranate[0m [0;32mimport[0m [0mBayesianNetwork[0m[0;34m[0m[0m | |
[1;32m 4[0m [0;32mimport[0m [0mseaborn[0m[0;34m,[0m [0mtime[0m[0;34m[0m[0m | |
[1;32m 5[0m [0mseaborn[0m[0;34m.[0m[0mset_style[0m[0;34m([0m[0;34m'whitegrid'[0m[0;34m)[0m[0;34m[0m[0m | |
[0;32m/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc[0m in [0;36mmagic[0;34m(self, arg_s)[0m | |
[1;32m 2158[0m [0mmagic_name[0m[0;34m,[0m [0m_[0m[0;34m,[0m [0mmagic_arg_s[0m [0;34m=[0m [0marg_s[0m[0;34m.[0m[0mpartition[0m[0;34m([0m[0;34m' '[0m[0;34m)[0m[0;34m[0m[0m | |
[1;32m 2159[0m [0mmagic_name[0m [0;34m=[0m [0mmagic_name[0m[0;34m.[0m[0mlstrip[0m[0;34m([0m[0mprefilter[0m[0;34m.[0m[0mESC_MAGIC[0m[0;34m)[0m[0;34m[0m[0m | |
[0;32m-> 2160[0;31m [0;32mreturn[0m [0mself[0m[0;34m.[0m[0mrun_line_magic[0m[0;34m([0m[0mmagic_name[0m[0;34m,[0m [0mmagic_arg_s[0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 2161[0m [0;34m[0m[0m | |
[1;32m 2162[0m [0;31m#-------------------------------------------------------------------------[0m[0;34m[0m[0;34m[0m[0m | |
[0;32m/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc[0m in [0;36mrun_line_magic[0;34m(self, magic_name, line)[0m | |
[1;32m 2079[0m [0mkwargs[0m[0;34m[[0m[0;34m'local_ns'[0m[0;34m][0m [0;34m=[0m [0msys[0m[0;34m.[0m[0m_getframe[0m[0;34m([0m[0mstack_depth[0m[0;34m)[0m[0;34m.[0m[0mf_locals[0m[0;34m[0m[0m | |
[1;32m 2080[0m [0;32mwith[0m [0mself[0m[0;34m.[0m[0mbuiltin_trap[0m[0;34m:[0m[0;34m[0m[0m | |
[0;32m-> 2081[0;31m [0mresult[0m [0;34m=[0m [0mfn[0m[0;34m([0m[0;34m*[0m[0margs[0m[0;34m,[0m[0;34m**[0m[0mkwargs[0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 2082[0m [0;32mreturn[0m [0mresult[0m[0;34m[0m[0m | |
[1;32m 2083[0m [0;34m[0m[0m | |
[0;32m<decorator-gen-63>[0m in [0;36mload_ext[0;34m(self, module_str)[0m | |
[0;32m/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/magic.pyc[0m in [0;36m<lambda>[0;34m(f, *a, **k)[0m | |
[1;32m 186[0m [0;31m# but it's overkill for just that one bit of state.[0m[0;34m[0m[0;34m[0m[0m | |
[1;32m 187[0m [0;32mdef[0m [0mmagic_deco[0m[0;34m([0m[0marg[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0m | |
[0;32m--> 188[0;31m [0mcall[0m [0;34m=[0m [0;32mlambda[0m [0mf[0m[0;34m,[0m [0;34m*[0m[0ma[0m[0;34m,[0m [0;34m**[0m[0mk[0m[0;34m:[0m [0mf[0m[0;34m([0m[0;34m*[0m[0ma[0m[0;34m,[0m [0;34m**[0m[0mk[0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 189[0m [0;34m[0m[0m | |
[1;32m 190[0m [0;32mif[0m [0mcallable[0m[0;34m([0m[0marg[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0m | |
[0;32m/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/magics/extension.pyc[0m in [0;36mload_ext[0;34m(self, module_str)[0m | |
[1;32m 35[0m [0;32mif[0m [0;32mnot[0m [0mmodule_str[0m[0;34m:[0m[0;34m[0m[0m | |
[1;32m 36[0m [0;32mraise[0m [0mUsageError[0m[0;34m([0m[0;34m'Missing module name.'[0m[0;34m)[0m[0;34m[0m[0m | |
[0;32m---> 37[0;31m [0mres[0m [0;34m=[0m [0mself[0m[0;34m.[0m[0mshell[0m[0;34m.[0m[0mextension_manager[0m[0;34m.[0m[0mload_extension[0m[0;34m([0m[0mmodule_str[0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 38[0m [0;34m[0m[0m | |
[1;32m 39[0m [0;32mif[0m [0mres[0m [0;34m==[0m [0;34m'already loaded'[0m[0;34m:[0m[0;34m[0m[0m | |
[0;32m/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/extensions.pyc[0m in [0;36mload_extension[0;34m(self, module_str)[0m | |
[1;32m 81[0m [0;32mif[0m [0mmodule_str[0m [0;32mnot[0m [0;32min[0m [0msys[0m[0;34m.[0m[0mmodules[0m[0;34m:[0m[0;34m[0m[0m | |
[1;32m 82[0m [0;32mwith[0m [0mprepended_to_syspath[0m[0;34m([0m[0mself[0m[0;34m.[0m[0mipython_extension_dir[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0m | |
[0;32m---> 83[0;31m [0m__import__[0m[0;34m([0m[0mmodule_str[0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 84[0m [0mmod[0m [0;34m=[0m [0msys[0m[0;34m.[0m[0mmodules[0m[0;34m[[0m[0mmodule_str[0m[0;34m][0m[0;34m[0m[0m | |
[1;32m 85[0m [0;32mif[0m [0mself[0m[0;34m.[0m[0m_call_load_ipython_extension[0m[0;34m([0m[0mmod[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0m | |
[0;31mImportError[0m: No module named memory_profiler | |
ImportError: No module named memory_profiler | |
real 0m3.040s | |
user 0m1.703s | |
sys 0m0.481s | |
[NbConvertApp] Converting notebook tutorials/Tutorial_5_Bayes_Classifiers.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'tutorials/Tutorial_5_Bayes_Classifiers.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
def plot_signal(X, n): | |
plt.figure(figsize=(16, 6)) | |
t_current = 0 | |
for i in range(n): | |
mu, std, t = X[i] | |
chunk = numpy.random.normal(mu, std, t) | |
plt.plot(numpy.arange(t_current, t_current+t), chunk, c='cm'[i % 2]) | |
t_current += t | |
plt.xticks(fontsize=14) | |
plt.yticks(fontsize=14) | |
plt.xlabel("Time (s)", fontsize=14) | |
plt.ylabel("Signal", fontsize=14) | |
plt.ylim(20, 40) | |
plt.show() | |
def create_signal(n): | |
X, y = [], [] | |
for i in range(n): | |
mu = numpy.random.normal(30.0, 0.4) | |
std = numpy.random.lognormal(-0.1, 0.4) | |
t = int(numpy.random.exponential(50)) + 1 | |
X.append([mu, std, t]) | |
y.append(0) | |
mu = numpy.random.normal(30.5, 0.8) | |
std = numpy.random.lognormal(-0.3, 0.6) | |
t = int(numpy.random.exponential(200)) + 1 | |
X.append([mu, std, t]) | |
y.append(1) | |
return numpy.array(X), numpy.array(y) | |
X_train, y_train = create_signal(1000) | |
X_test, y_test = create_signal(250) | |
plot_signal(X_train, 20) | |
------------------ | |
[0;31m[0m | |
[0;31mTypeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-10-bd6165085a36>[0m in [0;36m<module>[0;34m()[0m | |
[1;32m 34[0m [0mX_train[0m[0;34m,[0m [0my_train[0m [0;34m=[0m [0mcreate_signal[0m[0;34m([0m[0;36m1000[0m[0;34m)[0m[0;34m[0m[0m | |
[1;32m 35[0m [0mX_test[0m[0;34m,[0m [0my_test[0m [0;34m=[0m [0mcreate_signal[0m[0;34m([0m[0;36m250[0m[0;34m)[0m[0;34m[0m[0m | |
[0;32m---> 36[0;31m [0mplot_signal[0m[0;34m([0m[0mX_train[0m[0;34m,[0m [0;36m20[0m[0;34m)[0m[0;34m[0m[0m | |
[0m | |
[0;32m<ipython-input-10-bd6165085a36>[0m in [0;36mplot_signal[0;34m(X, n)[0m | |
[1;32m 4[0m [0;32mfor[0m [0mi[0m [0;32min[0m [0mrange[0m[0;34m([0m[0mn[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0m | |
[1;32m 5[0m [0mmu[0m[0;34m,[0m [0mstd[0m[0;34m,[0m [0mt[0m [0;34m=[0m [0mX[0m[0;34m[[0m[0mi[0m[0;34m][0m[0;34m[0m[0m | |
[0;32m----> 6[0;31m [0mchunk[0m [0;34m=[0m [0mnumpy[0m[0;34m.[0m[0mrandom[0m[0;34m.[0m[0mnormal[0m[0;34m([0m[0mmu[0m[0;34m,[0m [0mstd[0m[0;34m,[0m [0mt[0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 7[0m [0mplt[0m[0;34m.[0m[0mplot[0m[0;34m([0m[0mnumpy[0m[0;34m.[0m[0marange[0m[0;34m([0m[0mt_current[0m[0;34m,[0m [0mt_current[0m[0;34m+[0m[0mt[0m[0;34m)[0m[0;34m,[0m [0mchunk[0m[0;34m,[0m [0mc[0m[0;34m=[0m[0;34m'cm'[0m[0;34m[[0m[0mi[0m [0;34m%[0m [0;36m2[0m[0;34m][0m[0;34m)[0m[0;34m[0m[0m | |
[1;32m 8[0m [0mt_current[0m [0;34m+=[0m [0mt[0m[0;34m[0m[0m | |
[0;32mmtrand.pyx[0m in [0;36mmtrand.RandomState.normal[0;34m()[0m | |
[0;32mmtrand.pyx[0m in [0;36mmtrand.cont2_array_sc[0;34m()[0m | |
[0;31mTypeError[0m: 'numpy.float64' object cannot be interpreted as an index | |
TypeError: 'numpy.float64' object cannot be interpreted as an index | |
real 0m6.162s | |
user 0m7.670s | |
sys 0m1.594s | |
[NbConvertApp] Converting notebook tutorials/Tutorial_6_Markov_Chain.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] Writing 263439 bytes to tutorials/Tutorial_6_Markov_Chain.html | |
real 0m3.240s | |
user 0m1.939s | |
sys 0m0.597s | |
[NbConvertApp] Converting notebook tutorials/Tutorial_7_Parallelization.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'tutorials/Tutorial_7_Parallelization.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
n, d, k = 1000000, 5, 3 | |
X, y = create_dataset(n, d, k) | |
print "sklearn GMM" | |
%timeit GMM(n_components=k, covariance_type='full', n_iter=15, tol=1e-10).fit(X) | |
print "pomegranate GMM" | |
%timeit fit(GeneralMixtureModel(MultivariateGaussianDistribution, n_components=k), X, max_iterations=15, stop_threshold=1e-10) | |
print "pomegranate GMM (4 jobs)" | |
%timeit fit(GeneralMixtureModel(MultivariateGaussianDistribution, n_components=k), X, n_jobs=4, max_iterations=15, stop_threshold=1e-10) | |
------------------ | |
[0;31m[0m | |
[0;31mTypeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-3-0b1670fc3cc7>[0m in [0;36m<module>[0;34m()[0m | |
[1;32m 6[0m [0;32mprint[0m[0;34m[0m[0m | |
[1;32m 7[0m [0;32mprint[0m [0;34m"pomegranate GMM"[0m[0;34m[0m[0m | |
[0;32m----> 8[0;31m [0mget_ipython[0m[0;34m([0m[0;34m)[0m[0;34m.[0m[0mmagic[0m[0;34m([0m[0;34mu'timeit fit(GeneralMixtureModel(MultivariateGaussianDistribution, n_components=k), X, max_iterations=15, stop_threshold=1e-10)'[0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 9[0m [0;32mprint[0m[0;34m[0m[0m | |
[1;32m 10[0m [0;32mprint[0m [0;34m"pomegranate GMM (4 jobs)"[0m[0;34m[0m[0m | |
[0;32m/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc[0m in [0;36mmagic[0;34m(self, arg_s)[0m | |
[1;32m 2158[0m [0mmagic_name[0m[0;34m,[0m [0m_[0m[0;34m,[0m [0mmagic_arg_s[0m [0;34m=[0m [0marg_s[0m[0;34m.[0m[0mpartition[0m[0;34m([0m[0;34m' '[0m[0;34m)[0m[0;34m[0m[0m | |
[1;32m 2159[0m [0mmagic_name[0m [0;34m=[0m [0mmagic_name[0m[0;34m.[0m[0mlstrip[0m[0;34m([0m[0mprefilter[0m[0;34m.[0m[0mESC_MAGIC[0m[0;34m)[0m[0;34m[0m[0m | |
[0;32m-> 2160[0;31m [0;32mreturn[0m [0mself[0m[0;34m.[0m[0mrun_line_magic[0m[0;34m([0m[0mmagic_name[0m[0;34m,[0m [0mmagic_arg_s[0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 2161[0m [0;34m[0m[0m | |
[1;32m 2162[0m [0;31m#-------------------------------------------------------------------------[0m[0;34m[0m[0;34m[0m[0m | |
[0;32m/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc[0m in [0;36mrun_line_magic[0;34m(self, magic_name, line)[0m | |
[1;32m 2079[0m [0mkwargs[0m[0;34m[[0m[0;34m'local_ns'[0m[0;34m][0m [0;34m=[0m [0msys[0m[0;34m.[0m[0m_getframe[0m[0;34m([0m[0mstack_depth[0m[0;34m)[0m[0;34m.[0m[0mf_locals[0m[0;34m[0m[0m | |
[1;32m 2080[0m [0;32mwith[0m [0mself[0m[0;34m.[0m[0mbuiltin_trap[0m[0;34m:[0m[0;34m[0m[0m | |
[0;32m-> 2081[0;31m [0mresult[0m [0;34m=[0m [0mfn[0m[0;34m([0m[0;34m*[0m[0margs[0m[0;34m,[0m[0;34m**[0m[0mkwargs[0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 2082[0m [0;32mreturn[0m [0mresult[0m[0;34m[0m[0m | |
[1;32m 2083[0m [0;34m[0m[0m | |
[0;32m<decorator-gen-59>[0m in [0;36mtimeit[0;34m(self, line, cell)[0m | |
[0;32m/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/magic.pyc[0m in [0;36m<lambda>[0;34m(f, *a, **k)[0m | |
[1;32m 186[0m [0;31m# but it's overkill for just that one bit of state.[0m[0;34m[0m[0;34m[0m[0m | |
[1;32m 187[0m [0;32mdef[0m [0mmagic_deco[0m[0;34m([0m[0marg[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0m | |
[0;32m--> 188[0;31m [0mcall[0m [0;34m=[0m [0;32mlambda[0m [0mf[0m[0;34m,[0m [0;34m*[0m[0ma[0m[0;34m,[0m [0;34m**[0m[0mk[0m[0;34m:[0m [0mf[0m[0;34m([0m[0;34m*[0m[0ma[0m[0;34m,[0m [0;34m**[0m[0mk[0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 189[0m [0;34m[0m[0m | |
[1;32m 190[0m [0;32mif[0m [0mcallable[0m[0;34m([0m[0marg[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0m | |
[0;32m/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/magics/execution.pyc[0m in [0;36mtimeit[0;34m(self, line, cell)[0m | |
[1;32m 1055[0m [0mnumber[0m [0;34m=[0m [0;36m1[0m[0;34m[0m[0m | |
[1;32m 1056[0m [0;32mfor[0m [0m_[0m [0;32min[0m [0mrange[0m[0;34m([0m[0;36m1[0m[0;34m,[0m [0;36m10[0m[0;34m)[0m[0;34m:[0m[0;34m[0m[0m | |
[0;32m-> 1057[0;31m [0mtime_number[0m [0;34m=[0m [0mtimer[0m[0;34m.[0m[0mtimeit[0m[0;34m([0m[0mnumber[0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 1058[0m [0mworst_tuning[0m [0;34m=[0m [0mmax[0m[0;34m([0m[0mworst_tuning[0m[0;34m,[0m [0mtime_number[0m [0;34m/[0m [0mnumber[0m[0;34m)[0m[0;34m[0m[0m | |
[1;32m 1059[0m [0;32mif[0m [0mtime_number[0m [0;34m>=[0m [0;36m0.2[0m[0;34m:[0m[0;34m[0m[0m | |
[0;32m/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/magics/execution.pyc[0m in [0;36mtimeit[0;34m(self, number)[0m | |
[1;32m 137[0m [0mgc[0m[0;34m.[0m[0mdisable[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0m | |
[1;32m 138[0m [0;32mtry[0m[0;34m:[0m[0;34m[0m[0m | |
[0;32m--> 139[0;31m [0mtiming[0m [0;34m=[0m [0mself[0m[0;34m.[0m[0minner[0m[0;34m([0m[0mit[0m[0;34m,[0m [0mself[0m[0;34m.[0m[0mtimer[0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 140[0m [0;32mfinally[0m[0;34m:[0m[0;34m[0m[0m | |
[1;32m 141[0m [0;32mif[0m [0mgcold[0m[0;34m:[0m[0;34m[0m[0m | |
[0;32m<magic-timeit>[0m in [0;36minner[0;34m(_it, _timer)[0m | |
[0;32mpomegranate/gmm.pyx[0m in [0;36mpomegranate.gmm.GeneralMixtureModel.__init__[0;34m()[0m | |
[0;31mTypeError[0m: __init__() got an unexpected keyword argument 'n_components' | |
TypeError: __init__() got an unexpected keyword argument 'n_components' | |
real 4m46.111s | |
user 3m57.157s | |
sys 1m2.638s | |
[NbConvertApp] Converting notebook tutorials/Tutorial_8_Semisupervised_Learning.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'tutorials/Tutorial_8_Semisupervised_Learning.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
d1 = GeneralMixtureModel.from_samples(MultivariateGaussianDistribution, 2, X_train[y_train == 0]) | |
d2 = GeneralMixtureModel.from_samples(MultivariateGaussianDistribution, 2, X_train[y_train == 1]) | |
d3 = GeneralMixtureModel.from_samples(MultivariateGaussianDistribution, 2, X_train[y_train == 2]) | |
model_a = BayesClassifier([d1, d2, d3]).fit(X_train[y_train != -1], y_train[y_train != -1]) | |
print "Supervised Learning Accuracy: {}".format((model_a.predict(X_test) == y_test).mean()) | |
d1 = GeneralMixtureModel.from_samples(MultivariateGaussianDistribution, 2, X_train[y_train == 0]) | |
d2 = GeneralMixtureModel.from_samples(MultivariateGaussianDistribution, 2, X_train[y_train == 1]) | |
d3 = GeneralMixtureModel.from_samples(MultivariateGaussianDistribution, 2, X_train[y_train == 2]) | |
model_b = BayesClassifier([d1, d2, d3]) | |
model_b.fit(X_train, y_train) | |
print "Semisupervised Learning Accuracy: {}".format((model_b.predict(X_test) == y_test).mean()) | |
------------------ | |
[0;31m[0m | |
[0;31mLinAlgError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-8-33671617aae8>[0m in [0;36m<module>[0;34m()[0m | |
[1;32m 5[0m [0;32mprint[0m [0;34m"Supervised Learning Accuracy: {}"[0m[0;34m.[0m[0mformat[0m[0;34m([0m[0;34m([0m[0mmodel_a[0m[0;34m.[0m[0mpredict[0m[0;34m([0m[0mX_test[0m[0;34m)[0m [0;34m==[0m [0my_test[0m[0;34m)[0m[0;34m.[0m[0mmean[0m[0;34m([0m[0;34m)[0m[0;34m)[0m[0;34m[0m[0m | |
[1;32m 6[0m [0;34m[0m[0m | |
[0;32m----> 7[0;31m [0md1[0m [0;34m=[0m [0mGeneralMixtureModel[0m[0;34m.[0m[0mfrom_samples[0m[0;34m([0m[0mMultivariateGaussianDistribution[0m[0;34m,[0m [0;36m2[0m[0;34m,[0m [0mX_train[0m[0;34m[[0m[0my_train[0m [0;34m==[0m [0;36m0[0m[0;34m][0m[0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 8[0m [0md2[0m [0;34m=[0m [0mGeneralMixtureModel[0m[0;34m.[0m[0mfrom_samples[0m[0;34m([0m[0mMultivariateGaussianDistribution[0m[0;34m,[0m [0;36m2[0m[0;34m,[0m [0mX_train[0m[0;34m[[0m[0my_train[0m [0;34m==[0m [0;36m1[0m[0;34m][0m[0;34m)[0m[0;34m[0m[0m | |
[1;32m 9[0m [0md3[0m [0;34m=[0m [0mGeneralMixtureModel[0m[0;34m.[0m[0mfrom_samples[0m[0;34m([0m[0mMultivariateGaussianDistribution[0m[0;34m,[0m [0;36m2[0m[0;34m,[0m [0mX_train[0m[0;34m[[0m[0my_train[0m [0;34m==[0m [0;36m2[0m[0;34m][0m[0;34m)[0m[0;34m[0m[0m | |
[0;32mpomegranate/gmm.pyx[0m in [0;36mpomegranate.gmm.GeneralMixtureModel.from_samples[0;34m()[0m | |
[0;32mpomegranate/distributions.pyx[0m in [0;36mpomegranate.distributions.MultivariateGaussianDistribution.from_samples[0;34m()[0m | |
[0;32mpomegranate/distributions.pyx[0m in [0;36mpomegranate.distributions.Distribution.fit[0;34m()[0m | |
[0;32mpomegranate/distributions.pyx[0m in [0;36mpomegranate.distributions.MultivariateGaussianDistribution.from_summaries[0;34m()[0m | |
[0;32m/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/scipy/linalg/decomp_cholesky.pyc[0m in [0;36mcholesky[0;34m(a, lower, overwrite_a, check_finite)[0m | |
[1;32m 89[0m """ | |
[1;32m 90[0m c, lower = _cholesky(a, lower=lower, overwrite_a=overwrite_a, clean=True, | |
[0;32m---> 91[0;31m check_finite=check_finite) | |
[0m[1;32m 92[0m [0;32mreturn[0m [0mc[0m[0;34m[0m[0m | |
[1;32m 93[0m [0;34m[0m[0m | |
[0;32m/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/scipy/linalg/decomp_cholesky.pyc[0m in [0;36m_cholesky[0;34m(a, lower, overwrite_a, clean, check_finite)[0m | |
[1;32m 38[0m [0;32mif[0m [0minfo[0m [0;34m>[0m [0;36m0[0m[0;34m:[0m[0;34m[0m[0m | |
[1;32m 39[0m raise LinAlgError("%d-th leading minor of the array is not positive " | |
[0;32m---> 40[0;31m "definite" % info) | |
[0m[1;32m 41[0m [0;32mif[0m [0minfo[0m [0;34m<[0m [0;36m0[0m[0;34m:[0m[0;34m[0m[0m | |
[1;32m 42[0m raise ValueError('LAPACK reported an illegal value in {}-th argument' | |
[0;31mLinAlgError[0m: 2-th leading minor of the array is not positive definite | |
LinAlgError: 2-th leading minor of the array is not positive definite | |
real 3m21.820s | |
user 3m23.079s | |
sys 0m2.092s | |
[NbConvertApp] Converting notebook tutorials/Tutorial_9_Missing_Values.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] Writing 476779 bytes to tutorials/Tutorial_9_Missing_Values.html | |
real 1m56.035s | |
user 2m46.766s | |
sys 0m18.981s | |
[NbConvertApp] Converting notebook benchmarks/pomegranate_vs_hmmlearn.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'benchmarks/pomegranate_vs_hmmlearn.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
evaluate_models(50) | |
------------------ | |
[0;31m[0m | |
[0;31mTypeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-11-7e1585bf4e91>[0m in [0;36m<module>[0;34m()[0m | |
[0;32m----> 1[0;31m [0mevaluate_models[0m[0;34m([0m[0;36m50[0m[0;34m)[0m[0;34m[0m[0m | |
[0m | |
[0;32m<ipython-input-10-8154a1388174>[0m in [0;36mevaluate_models[0;34m(n_seqs)[0m | |
[1;32m 75[0m [0;34m[0m[0m | |
[1;32m 76[0m [0mmodel[0m [0;34m=[0m [0mpomegranate_model[0m[0;34m([0m[0mtransmat[0m[0;34m,[0m [0mstart_probs[0m[0;34m,[0m [0mdists[0m[0;34m)[0m[0;34m[0m[0m | |
[0;32m---> 77[0;31m [0mseqs[0m [0;34m=[0m [0;34m[[0m[0;34m[[0m[0mdna[0m[0;34m[[0m[0mi[0m[0;34m][0m [0;32mfor[0m [0mi[0m [0;32min[0m [0mseq[0m[0;34m][0m [0;32mfor[0m [0mseq[0m [0;32min[0m [0mseqs[0m[0;34m][0m[0;34m[0m[0m | |
[0m[1;32m 78[0m [0;34m[0m[0m | |
[1;32m 79[0m [0mtic[0m [0;34m=[0m [0mtime[0m[0;34m.[0m[0mtime[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0m | |
[0;31mTypeError[0m: only integer scalar arrays can be converted to a scalar index | |
TypeError: only integer scalar arrays can be converted to a scalar index | |
real 4m30.937s | |
user 5m31.890s | |
sys 0m21.710s | |
[NbConvertApp] Converting notebook benchmarks/pomegranate_vs_libpgm.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'benchmarks/pomegranate_vs_libpgm.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
from pomegranate import BayesianNetwork | |
from libpgm.pgmlearner import PGMLearner | |
libpgm_time = [] | |
pomegranate_time = [] | |
pomegranate_cl_time = [] | |
for i in range(2, 15): | |
tic = time.time() | |
X = numpy.random.randint(2, size=(10000, i)) | |
model = BayesianNetwork.from_samples(X, algorithm='exact') | |
pomegranate_time.append(time.time() - tic) | |
tic = time.time() | |
model = BayesianNetwork.from_samples(X, algorithm='chow-liu') | |
pomegranate_cl_time.append(time.time() - tic) | |
X = [{j : X[i, j] for j in range(X.shape[1])} for i in range(X.shape[0])] | |
learner = PGMLearner() | |
tic = time.time() | |
model = learner.discrete_constraint_estimatestruct(X) | |
libpgm_time.append(time.time() - tic) | |
------------------ | |
[0;31m[0m | |
[0;31mImportError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-2-522316cfa9ec>[0m in [0;36m<module>[0;34m()[0m | |
[1;32m 1[0m [0;32mfrom[0m [0mpomegranate[0m [0;32mimport[0m [0mBayesianNetwork[0m[0;34m[0m[0m | |
[0;32m----> 2[0;31m [0;32mfrom[0m [0mlibpgm[0m[0;34m.[0m[0mpgmlearner[0m [0;32mimport[0m [0mPGMLearner[0m[0;34m[0m[0m | |
[0m[1;32m 3[0m [0;34m[0m[0m | |
[1;32m 4[0m [0mlibpgm_time[0m [0;34m=[0m [0;34m[[0m[0;34m][0m[0;34m[0m[0m | |
[1;32m 5[0m [0mpomegranate_time[0m [0;34m=[0m [0;34m[[0m[0;34m][0m[0;34m[0m[0m | |
[0;31mImportError[0m: No module named libpgm.pgmlearner | |
ImportError: No module named libpgm.pgmlearner | |
real 0m3.068s | |
user 0m2.054s | |
sys 0m0.638s | |
[NbConvertApp] Converting notebook benchmarks/pomegranate_vs_sklearn_gmm.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'benchmarks/pomegranate_vs_sklearn_gmm.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
def evaluate_models(): | |
sizes = numpy.around( numpy.exp( numpy.arange(8, 16) ) ).astype('int') | |
n, m = sizes.shape[0], 20 | |
skl_predict, pom_predict = numpy.zeros((m, n)), numpy.zeros((m, n)) | |
skl_fit, pom_fit = numpy.zeros((m, n)), numpy.zeros((m, n)) | |
skl_error, pom_error = numpy.zeros((m, n)), numpy.zeros((m, n)) | |
for i in range(m): | |
for j, size in enumerate(sizes): | |
X, y = create_dataset( size, 1, 2 ) | |
pom = GeneralMixtureModel( NormalDistribution, n_components=2 ) | |
skl = GMM( n_components=3, n_iter=1 ) | |
# bench fit times | |
tic = time.time() | |
skl.fit( X ) | |
skl_fit[i, j] = time.time() - tic | |
tic = time.time() | |
pom.fit( X, max_iterations=1 ) | |
pom_fit[i, j] = time.time() - tic | |
# bench predict times | |
tic = time.time() | |
skl_predictions = skl.predict( X ) | |
skl_predict[i, j] = time.time() - tic | |
tic = time.time() | |
pom_predictions = pom.predict( X ) | |
pom_predict[i, j] = time.time() - tic | |
# check number wrong | |
skl_e = (y != skl_predictions).mean() | |
pom_e = (y != pom_predictions).mean() | |
skl_error[i, j] = min(skl_e, 1-skl_e) | |
pom_error[i, j] = min(pom_e, 1-pom_e) | |
fit = skl_fit / pom_fit | |
predict = skl_predict / pom_predict | |
plot(fit, predict, skl_error, pom_error, sizes, "samples per component") | |
evaluate_models() | |
------------------ | |
[0;31m[0m | |
[0;31mTypeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-4-db9eeb0880c0>[0m in [0;36m<module>[0;34m()[0m | |
[1;32m 43[0m [0mplot[0m[0;34m([0m[0mfit[0m[0;34m,[0m [0mpredict[0m[0;34m,[0m [0mskl_error[0m[0;34m,[0m [0mpom_error[0m[0;34m,[0m [0msizes[0m[0;34m,[0m [0;34m"samples per component"[0m[0;34m)[0m[0;34m[0m[0m | |
[1;32m 44[0m [0;34m[0m[0m | |
[0;32m---> 45[0;31m [0mevaluate_models[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0m | |
[0m | |
[0;32m<ipython-input-4-db9eeb0880c0>[0m in [0;36mevaluate_models[0;34m()[0m | |
[1;32m 11[0m [0mX[0m[0;34m,[0m [0my[0m [0;34m=[0m [0mcreate_dataset[0m[0;34m([0m [0msize[0m[0;34m,[0m [0;36m1[0m[0;34m,[0m [0;36m2[0m [0;34m)[0m[0;34m[0m[0m | |
[1;32m 12[0m [0;34m[0m[0m | |
[0;32m---> 13[0;31m [0mpom[0m [0;34m=[0m [0mGeneralMixtureModel[0m[0;34m([0m [0mNormalDistribution[0m[0;34m,[0m [0mn_components[0m[0;34m=[0m[0;36m2[0m [0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 14[0m [0mskl[0m [0;34m=[0m [0mGMM[0m[0;34m([0m [0mn_components[0m[0;34m=[0m[0;36m3[0m[0;34m,[0m [0mn_iter[0m[0;34m=[0m[0;36m1[0m [0;34m)[0m[0;34m[0m[0m | |
[1;32m 15[0m [0;34m[0m[0m | |
[0;32mpomegranate/gmm.pyx[0m in [0;36mpomegranate.gmm.GeneralMixtureModel.__init__[0;34m()[0m | |
[0;31mTypeError[0m: __init__() got an unexpected keyword argument 'n_components' | |
TypeError: __init__() got an unexpected keyword argument 'n_components' | |
real 5m58.163s | |
user 4m47.430s | |
sys 1m10.739s | |
[NbConvertApp] Converting notebook benchmarks/pomegranate_vs_sklearn_naive_bayes.ipynb to html | |
[NbConvertApp] Executing notebook with kernel: python2 | |
[NbConvertApp] ERROR | Error while converting 'benchmarks/pomegranate_vs_sklearn_naive_bayes.ipynb' | |
Traceback (most recent call last): | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook | |
output, resources = self.exporter.from_filename(notebook_filename, resources=resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename | |
return self.from_file(f, resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file | |
return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/html.py", line 85, in from_notebook_node | |
return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/templateexporter.py", line 280, in from_notebook_node | |
nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node | |
nb_copy, resources = self._preprocess(nb_copy, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess | |
nbc, resc = preprocessor(nbc, resc) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__ | |
return self.preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 262, in preprocess | |
nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/base.py", line 69, in preprocess | |
nb.cells[index], resources = self.preprocess_cell(cell, resources, index) | |
File "/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/nbconvert/preprocessors/execute.py", line 286, in preprocess_cell | |
raise CellExecutionError.from_cell_and_msg(cell, out) | |
CellExecutionError: An error occurred while executing the following cell: | |
------------------ | |
skl = GaussianNB() | |
pom = NaiveBayes( NormalDistribution ) | |
evaluate_models( skl, pom ) | |
------------------ | |
[0;31m[0m | |
[0;31mTypeError[0mTraceback (most recent call last) | |
[0;32m<ipython-input-3-1574004ef5d7>[0m in [0;36m<module>[0;34m()[0m | |
[1;32m 1[0m [0mskl[0m [0;34m=[0m [0mGaussianNB[0m[0;34m([0m[0;34m)[0m[0;34m[0m[0m | |
[0;32m----> 2[0;31m [0mpom[0m [0;34m=[0m [0mNaiveBayes[0m[0;34m([0m [0mNormalDistribution[0m [0;34m)[0m[0;34m[0m[0m | |
[0m[1;32m 3[0m [0mevaluate_models[0m[0;34m([0m [0mskl[0m[0;34m,[0m [0mpom[0m [0;34m)[0m[0;34m[0m[0m | |
[0;32mpomegranate/NaiveBayes.pyx[0m in [0;36mpomegranate.NaiveBayes.NaiveBayes.__init__[0;34m()[0m | |
[0;32mpomegranate/bayes.pyx[0m in [0;36mpomegranate.bayes.BayesModel.__init__[0;34m()[0m | |
[0;31mTypeError[0m: object of type 'type' has no len() | |
TypeError: object of type 'type' has no len() | |
real 0m3.081s | |
user 0m2.228s | |
sys 0m0.590s | |
make: *** [nbtest] Error 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jmschrei This was created with
make py27nbtest