Skip to content

Instantly share code, notes, and snippets.

@jkleckner
Created April 30, 2018 20:36
Show Gist options
  • Save jkleckner/bb116786eb692937cc015030a76eff5f to your computer and use it in GitHub Desktop.
Save jkleckner/bb116786eb692937cc015030a76eff5f to your computer and use it in GitHub Desktop.
Pomegranate 0.9.0 ipython notebook errors
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()
------------------

AttributeErrorTraceback (most recent call last)
<ipython-input-9-9830b7bec95c> in <module>()
----> 1 network.bake()

pomegranate/BayesianNetwork.pyx in pomegranate.BayesianNetwork.BayesianNetwork.bake()
AttributeError: '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()
------------------

AttributeErrorTraceback (most recent call last)
<ipython-input-11-9830b7bec95c> in <module>()
----> 1 network.bake()

pomegranate/BayesianNetwork.pyx in pomegranate.BayesianNetwork.BayesianNetwork.bake()
AttributeError: '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()
------------------

AttributeErrorTraceback (most recent call last)
<ipython-input-7-9830b7bec95c> in <module>()
----> 1 network.bake()

pomegranate/BayesianNetwork.pyx in pomegranate.BayesianNetwork.BayesianNetwork.bake()
AttributeError: '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()
------------------

AttributeErrorTraceback (most recent call last)
<ipython-input-7-9830b7bec95c> in <module>()
----> 1 network.bake()

pomegranate/BayesianNetwork.pyx in pomegranate.BayesianNetwork.BayesianNetwork.bake()
AttributeError: '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()
------------------

AttributeErrorTraceback (most recent call last)
<ipython-input-7-cac6a8d0d4df> in <module>()
----> 1 model.bake()

pomegranate/BayesianNetwork.pyx in pomegranate.BayesianNetwork.BayesianNetwork.bake()
AttributeError: '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()
------------------

AttributeErrorTraceback (most recent call last)
<ipython-input-6-a03e3e953f15> in <module>()
----> 1 print model.is_infinite()

AttributeError: '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()
------------------

AttributeErrorTraceback (most recent call last)
<ipython-input-7-3c71c5503016> in <module>()
----> 1 arid.bake()

pomegranate/BayesianNetwork.pyx in pomegranate.BayesianNetwork.BayesianNetwork.bake()
AttributeError: '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()
------------------

ValueErrorTraceback (most recent call last)
<ipython-input-11-e0ebc1e73762> in <module>()
 1 plt.title("smart cheater hmm")
----> 2 smart_cheater.draw()
 3 
 4 plt.title("dumb cheater hmm")
 5 dumb_cheater.draw()
pomegranate/hmm.pyx in pomegranate.hmm.HiddenMarkovModel.draw()
ValueError: 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 )
------------------

TypeErrorTraceback (most recent call last)
<ipython-input-2-444463433f16> in <module>()
----> 1 model = NaiveBayes( MultivariateGaussianDistribution, n_components=2 )

pomegranate/NaiveBayes.pyx in pomegranate.NaiveBayes.NaiveBayes.__init__()
TypeError: __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()
------------------

AttributeErrorTraceback (most recent call last)
<ipython-input-7-7daa8e30eaa8> in <module>()
----> 1 rain2fog.bake()

pomegranate/BayesianNetwork.pyx in pomegranate.BayesianNetwork.BayesianNetwork.bake()
AttributeError: '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])
------------------

ValueErrorTraceback (most recent call last)
<ipython-input-5-922063a123f3> in <module>()
 1 data = np.array([ 5.0, 6.0, 4.92, 5.5 ])
 2 
----> 3 for sample, probability in zip( data, clf.predict_proba(data) ):
 4 print "Height {:5.3}, {:5.3}% chance male and {:5.3}% chance female".format( sample, 100*probability[0], 100*probability[1])
pomegranate/bayes.pyx in pomegranate.bayes.BayesModel.predict_proba()
pomegranate/bayes.pyx in pomegranate.bayes.BayesModel.predict_log_proba()
ValueError: 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 )
------------------

TypeErrorTraceback (most recent call last)
<ipython-input-69-1225edac175c> in <module>()
----> 1 d = model.predict_proba()
 2 print "\t".join( "{:7}".format(state.name) for state in model.states )
 3 print "\t".join( "{:4.2}".format(model.parameters[0][1]) for model in d )
pomegranate/BayesianNetwork.pyx in pomegranate.BayesianNetwork.BayesianNetwork.predict_proba()
TypeError: 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
------------------

AttributeErrorTraceback (most recent call last)
<ipython-input-29-7fba55225dcf> in <module>()
 6 ['C', 'C', 'A']]
 7 
----> 8 a.fit(data)
 9 print a
pomegranate/distributions.pyx in pomegranate.distributions.JointProbabilityTable.fit()
pomegranate/distributions.pyx in pomegranate.distributions.JointProbabilityTable.summarize()
AttributeError: '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()
------------------

ImportErrorTraceback (most recent call last)
<ipython-input-1-5df0d5e5583b> in <module>()
 1 get_ipython().magic(u'pylab inline')
----> 2 get_ipython().magic(u'load_ext memory_profiler')
 3 from pomegranate import BayesianNetwork
 4 import seaborn, time
 5 seaborn.set_style('whitegrid')
/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
 2158 magic_name, _, magic_arg_s = arg_s.partition(' ')
 2159 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2160 return self.run_line_magic(magic_name, magic_arg_s)
 2161 
 2162 #-------------------------------------------------------------------------
/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
 2079 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
 2080 with self.builtin_trap:
-> 2081 result = fn(*args,**kwargs)
 2082 return result
 2083 
<decorator-gen-63> in load_ext(self, module_str)
/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
 186 # but it's overkill for just that one bit of state.
 187 def magic_deco(arg):
--> 188 call = lambda f, *a, **k: f(*a, **k)
 189 
 190 if callable(arg):
/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/magics/extension.pyc in load_ext(self, module_str)
 35 if not module_str:
 36 raise UsageError('Missing module name.')
---> 37 res = self.shell.extension_manager.load_extension(module_str)
 38 
 39 if res == 'already loaded':
/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/extensions.pyc in load_extension(self, module_str)
 81 if module_str not in sys.modules:
 82 with prepended_to_syspath(self.ipython_extension_dir):
---> 83 __import__(module_str)
 84 mod = sys.modules[module_str]
 85 if self._call_load_ipython_extension(mod):
ImportError: 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)
------------------

TypeErrorTraceback (most recent call last)
<ipython-input-10-bd6165085a36> in <module>()
 34 X_train, y_train = create_signal(1000)
 35 X_test, y_test = create_signal(250)
---> 36 plot_signal(X_train, 20)

<ipython-input-10-bd6165085a36> in plot_signal(X, n)
 4 for i in range(n):
 5 mu, std, t = X[i]
----> 6 chunk = numpy.random.normal(mu, std, t)
 7 plt.plot(numpy.arange(t_current, t_current+t), chunk, c='cm'[i % 2])
 8 t_current += t
mtrand.pyx in mtrand.RandomState.normal()
mtrand.pyx in mtrand.cont2_array_sc()
TypeError: '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
print "pomegranate GMM"
%timeit fit(GeneralMixtureModel(MultivariateGaussianDistribution, n_components=k), X, max_iterations=15, stop_threshold=1e-10)
print
print "pomegranate GMM (4 jobs)"
%timeit fit(GeneralMixtureModel(MultivariateGaussianDistribution, n_components=k), X, n_jobs=4, max_iterations=15, stop_threshold=1e-10)
------------------

TypeErrorTraceback (most recent call last)
<ipython-input-3-0b1670fc3cc7> in <module>()
 6 print
 7 print "pomegranate GMM"
----> 8 get_ipython().magic(u'timeit fit(GeneralMixtureModel(MultivariateGaussianDistribution, n_components=k), X, max_iterations=15, stop_threshold=1e-10)')
 9 print
 10 print "pomegranate GMM (4 jobs)"
/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
 2158 magic_name, _, magic_arg_s = arg_s.partition(' ')
 2159 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2160 return self.run_line_magic(magic_name, magic_arg_s)
 2161 
 2162 #-------------------------------------------------------------------------
/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
 2079 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
 2080 with self.builtin_trap:
-> 2081 result = fn(*args,**kwargs)
 2082 return result
 2083 
<decorator-gen-59> in timeit(self, line, cell)
/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
 186 # but it's overkill for just that one bit of state.
 187 def magic_deco(arg):
--> 188 call = lambda f, *a, **k: f(*a, **k)
 189 
 190 if callable(arg):
/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in timeit(self, line, cell)
 1055 number = 1
 1056 for _ in range(1, 10):
-> 1057 time_number = timer.timeit(number)
 1058 worst_tuning = max(worst_tuning, time_number / number)
 1059 if time_number >= 0.2:
/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/IPython/core/magics/execution.pyc in timeit(self, number)
 137 gc.disable()
 138 try:
--> 139 timing = self.inner(it, self.timer)
 140 finally:
 141 if gcold:
<magic-timeit> in inner(_it, _timer)
pomegranate/gmm.pyx in pomegranate.gmm.GeneralMixtureModel.__init__()
TypeError: __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())
------------------

LinAlgErrorTraceback (most recent call last)
<ipython-input-8-33671617aae8> in <module>()
 5 print "Supervised Learning Accuracy: {}".format((model_a.predict(X_test) == y_test).mean())
 6 
----> 7 d1 = GeneralMixtureModel.from_samples(MultivariateGaussianDistribution, 2, X_train[y_train == 0])
 8 d2 = GeneralMixtureModel.from_samples(MultivariateGaussianDistribution, 2, X_train[y_train == 1])
 9 d3 = GeneralMixtureModel.from_samples(MultivariateGaussianDistribution, 2, X_train[y_train == 2])
pomegranate/gmm.pyx in pomegranate.gmm.GeneralMixtureModel.from_samples()
pomegranate/distributions.pyx in pomegranate.distributions.MultivariateGaussianDistribution.from_samples()
pomegranate/distributions.pyx in pomegranate.distributions.Distribution.fit()
pomegranate/distributions.pyx in pomegranate.distributions.MultivariateGaussianDistribution.from_summaries()
/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/scipy/linalg/decomp_cholesky.pyc in cholesky(a, lower, overwrite_a, check_finite)
 89 """
 90 c, lower = _cholesky(a, lower=lower, overwrite_a=overwrite_a, clean=True,
---> 91 check_finite=check_finite)
 92 return c
 93 
/Users/jim/miniconda2/envs/py2.7/lib/python2.7/site-packages/scipy/linalg/decomp_cholesky.pyc in _cholesky(a, lower, overwrite_a, clean, check_finite)
 38 if info > 0:
 39 raise LinAlgError("%d-th leading minor of the array is not positive "
---> 40 "definite" % info)
 41 if info < 0:
 42 raise ValueError('LAPACK reported an illegal value in {}-th argument'
LinAlgError: 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)
------------------

TypeErrorTraceback (most recent call last)
<ipython-input-11-7e1585bf4e91> in <module>()
----> 1 evaluate_models(50)

<ipython-input-10-8154a1388174> in evaluate_models(n_seqs)
 75 
 76 model = pomegranate_model(transmat, start_probs, dists)
---> 77 seqs = [[dna[i] for i in seq] for seq in seqs]
 78 
 79 tic = time.time()
TypeError: 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)
------------------

ImportErrorTraceback (most recent call last)
<ipython-input-2-522316cfa9ec> in <module>()
 1 from pomegranate import BayesianNetwork
----> 2 from libpgm.pgmlearner import PGMLearner
 3 
 4 libpgm_time = []
 5 pomegranate_time = []
ImportError: 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()
------------------

TypeErrorTraceback (most recent call last)
<ipython-input-4-db9eeb0880c0> in <module>()
 43 plot(fit, predict, skl_error, pom_error, sizes, "samples per component")
 44 
---> 45 evaluate_models()

<ipython-input-4-db9eeb0880c0> in evaluate_models()
 11 X, y = create_dataset( size, 1, 2 )
 12 
---> 13 pom = GeneralMixtureModel( NormalDistribution, n_components=2 )
 14 skl = GMM( n_components=3, n_iter=1 )
 15 
pomegranate/gmm.pyx in pomegranate.gmm.GeneralMixtureModel.__init__()
TypeError: __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 )
------------------

TypeErrorTraceback (most recent call last)
<ipython-input-3-1574004ef5d7> in <module>()
 1 skl = GaussianNB()
----> 2 pom = NaiveBayes( NormalDistribution )
 3 evaluate_models( skl, pom )
pomegranate/NaiveBayes.pyx in pomegranate.NaiveBayes.NaiveBayes.__init__()
pomegranate/bayes.pyx in pomegranate.bayes.BayesModel.__init__()
TypeError: 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
@jkleckner
Copy link
Author

@jmschrei This was created with make py27nbtest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment