Code Monkey home page Code Monkey logo

Comments (8)

sharpclarke avatar sharpclarke commented on September 25, 2024 1

from bap3.

aloctavodia avatar aloctavodia commented on September 25, 2024

pz stands for preliz. Usually all imports are in the first cell of each notebook. You will see the line "import preliz as pz".

What error are you getting?

from bap3.

sharpclarke avatar sharpclarke commented on September 25, 2024

Thank you very much for your quick reply. I didn't see the import code in the book itself, but now that I go to the code in the github I can see it. That addresses my main error - now I just need to figure out how to use the bap3 environment in a Jupyter notebook but I can figure that out! Thanks again.

from bap3.

aloctavodia avatar aloctavodia commented on September 25, 2024

On Linux or Mac you run "conda activate bap3" from a terminal and then run "jupyter notebook". Not sure on Windows, but I think you can run the same commands if you first find and run the "Anaconda prompt" from the start menu.

Some IDES support notebooks. For instance VsCode supports notebooks (after installing a python plugin).

from bap3.

sharpclarke avatar sharpclarke commented on September 25, 2024

Thank you so much. That worked. I am self-taught and have previously only used terminal to run my python programs (not Jupyter) so just learning something new. Thanks for all your hard work on this.

from bap3.

sharpclarke avatar sharpclarke commented on September 25, 2024

Hi Osvaldo, sorry to bother you again. I am on Chapter 2 and tried to create my first model using the code:

with pm.Model() as our_first_model:
theta = pm.Beta('theta', alpha=1., beta=1.) # Specifies the prior
y = pm.Bernoulli('y', p=theta, observed=data) # Specifies the likelihood
idata = pm.sample(1000)

I have the right imports. I am getting a litany of errors (pages of messages) starting with this:

WARNING (pytensor.tensor.blas): Using NumPy C-API based implementation for BLAS functions.

You can find the C code in this temporary file: /var/folders/mf/bvt1s84s18b36l4wbn86s2lc0000gn/T/pytensor_compilation_error_fosqurhy
ERROR (pytensor.graph.rewriting.basic): Rewrite failure due to: constant_folding
ERROR (pytensor.graph.rewriting.basic): node: DropDims{axis=0}([4])
ERROR (pytensor.graph.rewriting.basic): TRACEBACK:
ERROR (pytensor.graph.rewriting.basic): Traceback (most recent call last):
File "/opt/anaconda3/envs/bap3/lib/python3.11/site-packages/pytensor/graph/rewriting/basic.py", line 1922, in process_node
replacements = node_rewriter.transform(fgraph, node)

There are pages and pages of error notices with "7 errors generated" at the bottom. I'm really stuck after doing some more Googling and can't seem to figure out why I can't run the code. I have activated the bap3 environment in conda.

Is it possible I made errors while installing packages (using pip initially then moving to conda install)? And if so, how do I fix this?

Again, appreciate your time if you have a moment to help.

from bap3.

aloctavodia avatar aloctavodia commented on September 25, 2024

yeah, it seems you made a mistake while installing packages. You can try deleting the env and starting fresh. Or uninstalling pymc and pytensor, and installing them again. Just to be sure attempt to uninstall the packages using both pip and conda.

from bap3.

sharpclarke avatar sharpclarke commented on September 25, 2024

from bap3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.