I test the approximative algorithm (FastDTW) against the optimal solution, calculating the relative error and comparing this with the errors given in [1].
The problem is that errors can be much larger than those indicated in the document, and without establishing a tolerance for “accepting all,” that all tests fail.
Is there any way to say QuickCheckthat I expect to pass only ntests? I see that there is a function cover. But just packing the dough in this does not work properly.
Alternatively, I could run the test several times manually and pass if the test passes at least n, but I hope this can be achieved with QuickCheck.
Edit in response to Carsten
I wrapped like this:
actualTest :: [Double] -> [Double] -> Bool
actualTest = ... -- runs dtw and fastDtw, compares errors against goal
coverTest :: Property
coverTest = cover True percentage label actualTest
But I'm not sure about the first parameter classor the label. Thinking about it more ... I think it is coverused to ensure that at least a certain percentage of tests meet a certain condition.
[1] http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.432.4253&rep=rep1&type=pdf#page=64
source
share