Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^4: Some Basic Help.

by invaderzard (Acolyte)
on Sep 25, 2012 at 08:35 UTC ( #995511=note: print w/ replies, xml ) Need Help??

in reply to Re^3: Some Basic Help.
in thread Some Basic Help.

How do I then, get the data i want into the array?

use Modern::Perl open trained , 'D://ARP//libsvm-3.12//families//antioxidant//independe +nt.scale'; open predict , 'D://ARP//libsvm-3.12//families//antioxidant//testing.s +cale'; my $counter = 0; my $lol = 0; select trained; my @train = $_; while (<predict>) { #print $_; my $predict = $_; if (exists $train{$predict} { print $predict; $counter = $counter + 1 } } print $counter;

like this?

Comment on Re^4: Some Basic Help.
Download Code
Re^5: Some Basic Help.
by Jenda (Abbot) on Sep 25, 2012 at 13:12 UTC

    First by reading some docs. Random typing will not work!

    What's the $lol variable for? Why do you select() a filehandle opened for reading? What do you think will be in $_ on line 7? You declare array @train, but later on attempt to use hash %train!

    Enoch was right!
    Enjoy the last years of Rome.

      Ah. Got it. Thanks :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://995511]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2015-03-31 00:54 GMT
Find Nodes?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:

    Results (660 votes), past polls