Test cases for Python implementation of Loo

29 views
Skip to first unread message

Devin Etcitty

unread,
Jun 14, 2016, 9:09:43 AM6/14/16
to stan development mailing list
I'm making the Python implementation of the Loo, R package. However, I'm looking for test cases that ensure the python implementation runs without errors.

https://github.com/avehtari/PSIS

My working Python notebook can be found at: https://github.com/detcitty/loo/blob/master/tests/loo_notebook.ipynb

Once I was able to compile the loo example from Andrew et al.'s R vignette of the loo package, I was getting a runtime error:

"
/Users/detcitty/Documents/Stan/loo/loo/loo.py:230: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
elif sort == 'in-place':
/Users/detcitty/Documents/Stan/loo/loo/loo.py:248: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
bs /= 3 * x[sort[np.floor(n/4 + 0.5) - 1]]
"

Line 246 in the loo.py module is the point at which the program throws the warning.

I've tested the code on Python 2.7 and 3.5. I was given the warning both times. I'm using a Mac OS X 10.10

-Devin

Daniel Lee

unread,
Jun 14, 2016, 9:15:23 AM6/14/16
to stan-dev mailing list
Hi Devin,

What's the runtime error? You didn't post one. There's a warning in your message, but no error. (What you call these things matter... error and warning are not the same.)

Regarding the warning, it's time to start learning how to use google. Search for "VisibleDeprecationWarning: using a non-integer number" and you'll start getting hits on what's going on.



Daniel





-Devin

--
You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aki Vehtari

unread,
Jun 15, 2016, 11:03:29 AM6/15/16
to stan development mailing list
Hi Devin,

The small data examples in the paper http://arxiv.org/abs/1507.04544 would be good as they are fast to run, and you can also test that you get similar khat values (as these examples are known to produce also large khat values).

Aki

Reply all
Reply to author
Forward
0 new messages