# It seems that BART's predict method always return same results

**URL:** <https://discourse.pymc.io/t/it-seems-that-barts-predict-method-always-return-same-results/10605>\
**Category:** version agnostic\
**Created:** [October 13, 2022, 1:24pm UTC](https://discourse.pymc.io/t/it-seems-that-barts-predict-method-always-return-same-results/10605 "2022-10-13T13:24:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![y\_m](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/y_m/32/5709_2.png) [@y\_m](https://discourse.pymc.io/u/y_m)\
**Post date:** [October 13, 2022, 1:24pm UTC](https://discourse.pymc.io/t/it-seems-that-barts-predict-method-always-return-same-results/10605/1 "2022-10-13T13:24:17Z")

</div>

Sorry for my posting constantly.

I’m using BART recently and I wondered this is a correct behavior.  
I percept pmb.predict returns generated samples from the BART-posterior but I always get same results.

I tried BART’s introduction notebook from [here](https://www.pymc.io/projects/examples/en/latest/case_studies/BART_introduction.html) and this is a capture of my result of the notebook.

 ![bart_introduction.ipynb](https://canada1.discourse-cdn.com/flex036/uploads/pymc3/original/2X/3/39c1f81c07f9f07aff0bd1090145c4badb58a1dc.png)

You can see the predict method always returns same samples on this code’s result block.  
 ![bart_introduction_plot_predict](https://canada1.discourse-cdn.com/flex036/uploads/pymc3/original/2X/1/11fa5cd4822787a0336a1f1dfe938f40a011bfa7.png)

I set 4 to size argument but results are same.  
(I think there should be 4 lines. Also I set 99 to size but results are same too.)

And the code’s block in the original notebook gets different samples.

 ![pymc_predict](https://canada1.discourse-cdn.com/flex036/uploads/pymc3/original/2X/d/d68d9b5f91d1f05a28a7a25a088cdbe4254f461e.jpeg)

**Environment:**  
PyMC: v4.1.2  
pymc\_bart: v0.0.3

Thanks.

---

<div class="post-metadata">

**Author:** ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)\
**Post date:** [October 13, 2022, 3:37pm UTC](https://discourse.pymc.io/t/it-seems-that-barts-predict-method-always-return-same-results/10605/2 "2022-10-13T15:37:53Z")

</div>

@aloctavodia

---

<div class="post-metadata">

**Author:** ![y\_m](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/y_m/32/5709_2.png) [@y\_m](https://discourse.pymc.io/u/y_m)\
**Post date:** [October 18, 2022, 12:18pm UTC](https://discourse.pymc.io/t/it-seems-that-barts-predict-method-always-return-same-results/10605/3 "2022-10-18T12:18:23Z")

</div>

I have some additional information to share.

I try to find a workaround lately, but I still can’t find any.

My enviroment is on M1 mac and I wonder this is a cause.  
But I still can’t specify which package occurs this issue.

There are list of what I did. All of them are not working.

- Use this docker image but results are same. (Downgrade pymc to 4.1.2 for pymc-bart.)  
[Docker Hub](https://hub.docker.com/u/pymc)

- Also use this docker image but results are same. (Downgrade pymc to 4.1.2 for pymc-bart.)  
[GitHub - danhphan/pymc-docker: Docker for PyMC version 4 run on CPU and GPU](https://github.com/danhphan/pymc-docker)

- Try to install with this instruction but conda stops to resolve packages and don’t work.  
[Installation — PyMC 0+untagged.345.g2bd0611.dirty documentation](https://www.pymc.io/projects/docs/en/stable/installation.html)  
(I think this is another issue should be reported.)

- Use the conda’s official docker image and install pymc & pymc-bart via pip but results are same.

And I have another environment on GoogleColab (forcely install python3.9) and this works fine.  
So I guess the current version(0.0.3) of BART may doesn’t work on M1 Mac

Thanks.

---

<div class="post-metadata">

**Author:** ![cluhmann](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/cluhmann/32/3083_2.png) [@cluhmann](https://discourse.pymc.io/u/cluhmann)\
**Post date:** [October 18, 2022, 2:44pm UTC](https://discourse.pymc.io/t/it-seems-that-barts-predict-method-always-return-same-results/10605/4 "2022-10-18T14:44:14Z")

</div>

> [@y\_m](#):
>
> Try to install with this instruction but conda stops to resolve packages and don’t work.

This is strongly recommended as the way to install. The fact that it is not working is definitely something to be resolved, regardless of the BART issues. If you can, please [open an issue](https://github.com/pymc-devs/pymc/issues) with further details and we can figure out what’s going on.

---

<div class="post-metadata">

**Author:** ![y\_m](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/y_m/32/5709_2.png) [@y\_m](https://discourse.pymc.io/u/y_m)\
**Post date:** [October 18, 2022, 3:35pm UTC](https://discourse.pymc.io/t/it-seems-that-barts-predict-method-always-return-same-results/10605/5 "2022-10-18T15:35:24Z")

</div>

Here I opened.

> <https://github.com/pymc-devs/pymc/issues/6228>
>
> \## Installation with conda not working.
> 
> \`\`\`Dockerfile
> FROM continuumio/anaco…nda3
> 
> RUN conda update conda
> RUN conda create -c conda-forge -n pymc\_env "pymc\>=4"
> \`\`\`
> \`\`\`docker-compose.yml
> services:
> conda\_py39:
> build:
> context: ./conda\_py39
> dockerfile: Dockerfile
> restart: always
> \`\`\`
> 
> \<details\>\<summary\>Complete error traceback\</summary\>
> 
> \[+\] Building 73.8s (7/7) FINISHED                                                                                                                                                                           
> =\> \[internal\] load build definition from Dockerfile 0.1s
> =\> =\> transferring dockerfile: 1.67kB 0.0s
> =\> \[internal\] load .dockerignore 0.0s
> =\> =\> transferring context: 2B 0.0s
> =\> \[internal\] load metadata for docker.io/continuumio/anaconda3:latest 2.3s
> =\> \[auth\] continuumio/anaconda3:pull token for registry-1.docker.io 0.0s
> =\> \[1/3\] FROM docker.io/continuumio/anaconda3@sha256:08693c4464a4d9e3b5db504b79fda74130b9715ba9fc3978476179599043fda1 0.0s
> =\> CACHED \[2/3\] RUN conda update conda 0.0s
> =\> ERROR \[3/3\] RUN conda create -c conda-forge -n pymc\_env "pymc\>=4" 71.2s                                                                                                                                                                                        
> \[3/3\] RUN conda create -c conda-forge -n pymc\_env "pymc\>=4":                                                                                                                                             
> \#0 3.977 Collecting package metadata (current\_repodata.json): ...working... done                                                                                                                            
> \#0 14.51 Solving environment: ...working... failed with repodata from current\_repodata.json, will retry with next repodata source.                                                                          
> \#0 15.50 Collecting package metadata (repodata.json): ...working... done
> \#0 68.11 UnsatisfiableError: 
> \#0 68.11 
> \#0 68.11 
> \#0 68.11 Found conflicts! Looking for incompatible packages.
> \#0 68.11 This can take several minutes. Press CTRL-C to abort.
> \#0 68.11 failed
> failed to solve: executor failed running \[/bin/sh -c conda create -c conda-forge -n pymc\_env "pymc\>=4"\]: exit code: 1
> \</details\>
> 
> \## Versions and main components
> 
> \* PyMC/PyMC3 Version: None
> \* Aesara/Theano Version: None
> \* Python Version: None
> \* Operating system: Monterey/MacBook Air(M1)
> \* How did you install PyMC/PyMC3: conda
> \* Docker Desktop: 4.12.0

Thanks.
