On Dec 22, 2011, at 9:29 PM, Maggie X wrote:
> Thank you for trying it out. Glad it worked! But I'm not sure why just
> printing out the numbers would make it work. Was there anything else that
> you have tried to make it work?
>
No... just added the `print` statements. That was it. Maybe the `print` output
resolved to `true` and that was it. You might want to alter that test to
account for such things.
Many thanks for your help. Now I can have a lot of fun wasting time trying to
redo stuff in PDL::Stats that I can already do in Postgres/R ;-)
On a tangential note -- seriously, it would be a great boon if PDL could ingest
results of DBI queries as piddles, kinda like (theoretical code ahead)
$sth->execute;
my $piddle = $sth->fetchrow_arrayref;
my $result = $piddle->do_magic;
return $result->to_json;
piano, piano...
> Best,
> Maggie
>
> On Thu, Dec 22, 2011 at 10:13 PM, Puneet Kishor <[email protected]> wrote:
>
>> Here ya go... I did as you said, and now it says all tests passed. My
>> guess is that the darn thing would work well if I just installed it without
>> testing it, but `cpanm` stops as soon as the first test croaks.
>>
>> punkish@mumbai ~/Projects/PDL-Stats-0.5.5$make test
>> PERL_DL_NONLAZY=1 /opt/local/bin/perl "-MExtUtils::Command::MM"
>> "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
>> t/stats_basic.t ..... ok
>> t/stats_glm.t ....... ok
>> t/stats_kmeans.t .... 1/18 R2 0.786191536748329
>> centroid
>> [
>> [ 1.5 5.5]
>> [ 8.5 12]
>> [15.5 19]
>> ]
>>
>> cluster
>> [
>> [1 1 1 1 0 0 0]
>> [0 0 0 0 1 1 1]
>> ]
>>
>> ms
>> [
>> [ 1.25 0.25]
>> [ 1.25 0.66666667]
>> [ 1.25 0.66666667]
>> ]
>>
>> n [4 3]
>> -6.66666570836583e-08R2 0.786191536748329
>> centroid
>> [
>> [ 1.5 5.5]
>> [ 8.5 12]
>> [15.5 19]
>> ]
>>
>> cluster
>> [
>> [1 1 1 1 0 0 0]
>> [0 0 0 0 1 1 1]
>> ]
>>
>> ms
>> [
>> [ 1.25 0.25]
>> [ 1.25 0.66666667]
>> [ 1.25 0.66666667]
>> ]
>>
>> n [4 3]
>> t/stats_kmeans.t .... ok
>> t/stats_ols_rptd.t .. ok
>> t/stats_ts.t ........ ok
>> All tests successful.
>> Files=5, Tests=147, 1 wallclock secs ( 0.03 usr 0.01 sys + 0.93
>> cusr 0.03 csys = 1.00 CPU)
>> Result: PASS
>> No tests defined for PDL::Stats::Basic extension.
>> PERL_DL_NONLAZY=1 /opt/local/bin/perl "-MExtUtils::Command::MM"
>> "-e" "test_harness(0, '../blib/lib', '../blib/arch')" t/*.t
>> t/stats_distr.t .. ok
>> All tests successful.
>> Files=1, Tests=43, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.13
>> cusr 0.00 csys = 0.15 CPU)
>> Result: PASS
>> No tests defined for PDL::Stats::GLM extension.
>> No tests defined for PDL::Stats::Kmeans extension.
>> PERL_DL_NONLAZY=1 /opt/local/bin/perl "-MExtUtils::Command::MM"
>> "-e" "test_harness(0, '../blib/lib', '../blib/arch')" t/*.t
>> t/cdf.t .. ok
>> All tests successful.
>> Files=1, Tests=4, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.06
>> cusr 0.00 csys = 0.08 CPU)
>> Result: PASS
>> No tests defined for PDL::Stats::TS extension.
>> punkish@mumbai ~/Projects/PDL-Stats-0.5.5$
>>
>> On Dec 22, 2011, at 9:08 PM, Maggie X wrote:
>>
>>> I've seen cases where the test fails simply because of the precision
>> differ
>>> on different platforms. That's why I wanted to see what you get when you
>> do
>>> print $m{ms}->sumover(). But I guess make test doesn't actually print out
>>> the values to stdout... How about this?
>>>
>>> Add
>>>
>>> print STDERR t_kmeans_bad();
>>>
>>> 168> is(tapprox( t_kmeans_bad(), 0 ), 1);
>>> 169> sub t_kmeans_bad {
>>> 170> my $data = sequence 7, 3;
>>> 171> $data = $data->setbadat(4,0);
>>> 172> my %m = $data->kmeans({NCLUS=>2, NTRY=>10, V=>0});
>>>
>>> print STDERR "$_\t$m{$_}\n" for (sort keys %m);
>>>
>>> 173> return sum( $m{ms}->sumover - pdl qw( 1.5 1.9166667 1.9166667
>> ) );
>>> 174> }
>>>
>>>
>>> Best,
>>> Maggie
>>>
>>>
>>> On Thu, Dec 22, 2011 at 9:06 PM, Puneet Kishor <[email protected]>
>> wrote:
>>>
>>>> I should have added my congratulations and gratitude for taking 2.4.9
>> to a
>>>> point that it builds and installs beautifully, without any heartburn.
>>>> Perhaps because most of the dependencies got installed when I installed
>>>> 2.4.6 via MacPorts.
>>>>
>>>>
>>>> I am doing a lot of stuff using R, so am curious to try out PDL::Stats.
>>>> For now, I am using R compiled inside Postgres using PL/R... what a
>>>> wonderful experience to get my data out of Postgres and analyze it right
>>>> within the database.
>>>>
>>>> Wrt PDL::Stats, my guess is the test failure has nothing to do with it
>>>> being on a Mac/10.7. Perl 5.14.1 should be Perl 5.14.1 no matter what
>>>> platform, no?
>>>>
>>>> On Dec 22, 2011, at 7:50 PM, chm wrote:
>>>>
>>>>> On 12/22/2011 7:48 PM, Puneet Kishor wrote:
>>>>>> Inspired by the lovely blurb below, I tried to install PDL::Stats but
>>>> failed. Here is the relevant bit from the log of my failed attempt --
>>>>>>
>>>>>> ----
>>>>>> PERL_DL_NONLAZY=1 /opt/local/bin/perl "-MExtUtils::Command::MM" "-e"
>>>> "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
>>>>>> t/stats_basic.t ..... ok
>>>>>> t/stats_glm.t ....... ok
>>>>>>
>>>>>> # Failed test at t/stats_kmeans.t line 168.
>>>>>> # got: ''
>>>>>> # expected: '1'
>>>>>> # Looks like you failed 1 test of 18.
>>>>>> t/stats_kmeans.t ....
>>>>>> Dubious, test returned 1 (wstat 256, 0x100)
>>>>>> Failed 1/18 subtests
>>>>>> t/stats_ols_rptd.t .. ok
>>>>>> t/stats_ts.t ........ ok
>>>>>>
>>>>>> Test Summary Report
>>>>>> -------------------
>>>>>> t/stats_kmeans.t (Wstat: 256 Tests: 18 Failed: 1)
>>>>>> Failed test: 13
>>>>>> Non-zero exit status: 1
>>>>>> Files=5, Tests=147, 1 wallclock secs ( 0.03 usr 0.01 sys + 0.91
>> cusr
>>>> 0.04 csys = 0.99 CPU)
>>>>>> Result: FAIL
>>>>>> Failed 1/5 test programs. 1/147 subtests failed.
>>>>>> make: *** [test_dynamic] Error 255
>>>>>> -> FAIL Installing PDL::Stats failed. See
>>>> /Volumes/roller/Users/punkish/.cpanm/build.log for details.
>>>>>> ----
>>>>>>
>>>>>>
>>>>>> Here is line 168 (test #13) from t/stats_kmeans.t
>>>>>>
>>>>>> 168> is(tapprox( t_kmeans_bad(), 0 ), 1);
>>>>>> 169> sub t_kmeans_bad {
>>>>>> 170> my $data = sequence 7, 3;
>>>>>> 171> $data = $data->setbadat(4,0);
>>>>>> 172> my %m = $data->kmeans({NCLUS=>2, NTRY=>10, V=>0});
>>>>>> 173> return sum( $m{ms}->sumover - pdl qw( 1.5 1.9166667
>> 1.9166667
>>>> ) );
>>>>>> 174> }
>>>>>>
>>>>>>
>>>>>> I am on Mac OS X Lion with Perl 5.14.1 and PDL 2.4.6 installed via
>>>> MacPorts
>>>>> ^^^^^
>>>>> |||||
>>>>>
>>>>> My guess it the problem is you are using PDL-2.4.6 and not
>>>>> the current PDL-2.4.9 (or even better the current CPAN
>>>>> Developers release version).
>>>>>
>>>>> I know there were some fixes the are in PDL-2.4.9 that
>>>>> helped Maggie X's stuff work. Maybe she can recall any
>>>>> tricks to build her modules with a fairly old PDL (i.e.,
>>>>> one not having the many fixes and features added in the
>>>>> past couple of years).
>>>>>
>>>>> --Chris
>>>>>
>>>>>> On Dec 22, 2011, at 3:26 PM, Maggie X wrote:
>>>>>>
>>>>>>> Hi Chris,
>>>>>>>
>>>>>>> Thanks for including the info! Here's the blurb for PDL::Stats.
>>>>>>>
>>>>>>> --------------
>>>>>>> This is a collection of statistics modules in Perl Data Language,
>> with
>>>> a
>>>>>>
>>>>>>> quick-start guide for non-PDL people.
>>>>>>>
>>>>>>> They make perldl--the simple shell for PDL--work like a teenie weenie
>>>> R,
>>>>>>
>>>>>>> but with PDL threading--"the fast (and automagic) vectorised
>> iteration
>>>> of
>>>>>>> 'elementary operations' over arbitrary slices of multidimensional
>>>> data"--of
>>>>>>> procedures including t-test, ordinary least squares regression, and
>>>> k-means
>>>>>>> clustering.
>>>>>>> ---------------
>>>>>>>
>>>>>>> Best,
>>>>>>> Maggie
>>>>>>>
>>>>>>> ..
>>>>>>
>>>>
>>>>
>>
>>
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl