Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Using Word Tokens as Features

by bioinformatics (Friar)
on Apr 11, 2013 at 22:56 UTC ( [id://1028244]=note: print w/replies, xml ) Need Help??


in reply to Using Word Tokens as Features

The faster way to do this is to store the word as a key in a hash, with a hash linked to an array that you can append a value to as you go along. This saves you the time of building a 2D matrix. If you parse each line by a delimiter, then you have a collection of tokens (strings) that you can easily add to the hash of arrays. The catch is you have to keep a counter to make sure that you correctly initialize the new arrays to the appropriate length.
Bioinformatics

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-25 10:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found