ocelma/python-recsys — Issue #1: Problem in load() method
Author: matiasherranz
Created: 2012-02-28 19:30:30+00:00
State: open

If you do this:

> rmse = RMSE()
> rmse.load(x, y)

with x and y being numpy uni-dimensional arrays, you get this:

> in compute(self)
> 98 Computes the evaluation using the loaded ground truth and test lists
> 99 """
> --> 100 if not self._ground_truth:
> 101 raise ValueError('Ground Truth dataset is empty!')
> 102 if not self._test:
>
> ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

I fixed it this way:

if self._ground_truth is None:
raise ValueError('Ground Truth dataset is empty!')
if self._test is None:
raise ValueError('Test dataset is empty!')