Hi all

I'm doing Data Minning and I would like to know if I may use PDL for my
offline tests on Perl.

Consider that I'm dealing with a friends table and I want to recommend
other friends jut based on this table.

To recommend friends to a user A,
 - I would select (from a DB) the friends of the user A and add them to a
Hash table having as keys the user ids and as value 1 ( %score = map { $_
=> 1 } @friend )
 - in cycle (n times) I would select the user with the highest rank ( my
$id = reduce { $score{ $a } > $score{ $b} ? $a : $b } keys %score), chose
his friends and add them to the hash ( $score{ $_ } += 1 foreach @friend )
 - The recommendations would be achieved after sorting the keys by the
values on %score ( sort { $score{$b} <=> $score{$a} } keys %score ) and
picking the first n.

The algorithm may be simplified to something like the one that I explained,
and clearly there is allots of work done on the %score variable. On my
machine, I have a SSD disk and the performance problem is the CPU, I would
like to know if and how can I use PDL to speedup this calculations on the
hash %scores.

Thanks for the help

Best Regards
Marcos Rebelo


-- 
Marcos Rebelo
http://www.oleber.com/
Webmaster of http://perl5notebook.oleber.com
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to