-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnboundLocalError: local variable 'mutation' referenced before assignment #44
Comments
Same here. |
The ReadOneTrees branch seems working. |
Hi, Thanks for trying it out and raising an issue :) I'd pretty strongly recommend working off the |
Same problem here ! The ReadOneTrees branch seems working. Thank you! |
como se una la rama ReadOneTrees alguien me ayuda porfavor, tengo el mismo problema de: "local variable 'mutation' referenced before assignment" |
### ESTO ME SALTA AL EJECUTARLO File "", line 1, in File "/home/antony/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 827, in runfile File "/home/antony/anaconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 110, in execfile File "/home/antony/Python/Datos Panel Solar Validado/Bart_3.py", line 23, in File "/home/antony/anaconda3/lib/python3.7/site-packages/bartpy/sklearnmodel.py", line 134, in fit File "/home/antony/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 934, in call File "/home/antony/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 833, in retrieve File "/home/antony/anaconda3/lib/python3.7/site-packages/joblib/_parallel_backends.py", line 521, in wrap_future_result File "/home/antony/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 432, in result File "/home/antony/anaconda3/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result |
Hi, I got the same problem, have you solved it? |
Si amigo lo resolvi. La solucion esta en que deberas instalar la libreria
desde la rama que te indica el autor de la libreria
El jue., 28 de nov. de 2019 7:16 AM, b5ck1n <[email protected]>
escribió:
… Hi, I got the same problem, have you solved it?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#44?email_source=notifications&email_token=ANLKCFX3M3TMGU5O4TP7OWTQV6ZAPA5CNFSM4ICOR22KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFMN4HI#issuecomment-559472157>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANLKCFQEPK7IEFRYI65TU73QV6ZAPANCNFSM4ICOR22A>
.
|
Hi Jake,
When running example code as beflow:
`import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from bartpy.sklearnmodel import SklearnModel
x = np.random.normal(0, 0.5, size=1000)
X = pd.DataFrame({"x": x})
y = 2 * x + 4 * np.power(x, 3)
plt.scatter(x, y)
model = SklearnModel(n_jobs=1)
model.fit(X, y)
plt.scatter(x, model.predict())
plt.scatter(x, y)`
I got the following error:
0%| | 0/200 [00:00<?, ?it/s]Starting burn
Traceback (most recent call last):
File "", line 15, in
model.fit(X, y)
File ".../BART/bartpy-master/bartpy-master/bartpy/sklearnmodel.py", line 134, in fit
self.extract = Parallel(n_jobs=self.n_jobs)(self.f_delayed_chains(X, y))
File ".../anaconda3/lib/python3.6/site-packages/joblib/parallel.py", line 921, in call
if self.dispatch_one_batch(iterator):
File ".../anaconda3/lib/python3.6/site-packages/joblib/parallel.py", line 759, in dispatch_one_batch
self._dispatch(tasks)
File ".../anaconda3/lib/python3.6/site-packages/joblib/parallel.py", line 716, in _dispatch
job = self._backend.apply_async(batch, callback=cb)
File ".../anaconda3/lib/python3.6/site-packages/joblib/_parallel_backends.py", line 182, in apply_async
result = ImmediateResult(func)
File ".../anaconda3/lib/python3.6/site-packages/joblib/_parallel_backends.py", line 549, in init
self.results = batch()
File ".../anaconda3/lib/python3.6/site-packages/joblib/parallel.py", line 225, in call
for func, args, kwargs in self.items]
File ".../anaconda3/lib/python3.6/site-packages/joblib/parallel.py", line 225, in
for func, args, kwargs in self.items]
File ".../BART/bartpy-master/bartpy-master/bartpy/sklearnmodel.py", line 31, in run_chain
model.store_acceptance_trace)
File ".../BART/bartpy-master/bartpy-master/bartpy/samplers/modelsampler.py", line 43, in samples
self.step(model, trace_logger)
File ".../BART/bartpy-master/bartpy-master/bartpy/samplers/modelsampler.py", line 26, in step
result = step()
File ".../BART/bartpy-master/bartpy-master/bartpy/samplers/schedule.py", line 48, in
yield "Tree", lambda: self.tree_sampler.step(model, tree)
File ".../BART/bartpy-master/bartpy-master/bartpy/samplers/unconstrainedtree/treemutation.py", line 47, in step
mutation = self.sample(model, tree)
File ".../BART/bartpy-master/bartpy-master/bartpy/samplers/unconstrainedtree/treemutation.py", line 40, in sample
ratio = self.likihood_ratio.log_probability_ratio(model, tree, proposal)
File ".../BART/bartpy-master/bartpy-master/bartpy/samplers/treemutation.py", line 80, in log_probability_ratio
return self.log_transition_ratio(tree, mutation) + self.log_likihood_ratio(model, tree, mutation) + self.log_tree_ratio(model, tree, mutation)
File ".../BART/bartpy-master/bartpy-master/bartpy/samplers/unconstrainedtree/likihoodratio.py", line 69, in log_likihood_ratio
#mutation: GrowMutation = mutation
UnboundLocalError: local variable 'mutation' referenced before assignment
Do you know where the problem is? Thank you.
xiangwei
The text was updated successfully, but these errors were encountered: