-
Notifications
You must be signed in to change notification settings - Fork 60
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
AB Testing with elfi, bernoulli+lognorm #255
Comments
Hi, Without complete code I'm unable to reproduce this. Most crucially your handling of However, based on the error message the problem is that the Also, if you intend to use That said, all this assumes that you make use of ELFI's internal batching. It is certainly possible to circumvent this (by essentially forcing |
Thx for the help, I got the simulator node working but ran to a trouble with the distance node. |
ELFI always uses batches, and The summaries are typically 1d arrays of length |
I'll propably just refurbish the whole model to a more usable and robust syntax, I'll be in touch once I get something worthwhile going :D |
Summary:
I'm trying to replicate a STAN model I've been using with elfi. I've run into some trouble with Elfi and propably Python.
Description:
The lognorm and bernoulli distances (using scipy stats functions) are implemented in Python, prior is defined (using one lognorm 2,10), a Simulator object is defined (the function is tested and it ouputs similar data as in elfi examples), ABC rejection sampler defined, but sampling from the rejection sampler throws an error.
Reproducible Steps:
I have defined the simulator like this:
Current Output:
Simulator function outputs the data in the same format as in the elfi example, but when I try to generate data with simulator node I get the following error from within the loop.
`TypeError Traceback (most recent call last)
C:\Anaconda\envs\DataScienceEnv\lib\site-packages\elfi\executor.py in execute(cls, G)
69 try:
---> 70 G.node[node] = cls._run(op, node, G)
71 except Exception as exc:
C:\Anaconda\envs\DataScienceEnv\lib\site-packages\elfi\executor.py in _run(fn, node, G)
153
--> 154 output_dict = {'output': fn(*args, **kwargs)}
155 return output_dict
in legacy_updated(data, batch_size, random_state)
9 rows = len(data)
---> 10 cols = len(data[0])
11 result_array = np.array([])
TypeError: object of type 'numpy.float64' has no len()`
Expected Output:
I didn't expect the error since my function is outputting a numpy array, my python skills propably come in play also this really doesn't seem like a big error
ELFI Version:
0.3.1
Python Version:
3.6.5
Operating System:
windows 10
The text was updated successfully, but these errors were encountered: