|Think about Loose Coupling
PROBLEM AT HAND: every row in my csv file has the same value. I am trying to implement a term document matrix and store it in a CSV file.In my program I store the features and the value within a hash for a document. Each hash is stored in an array. The array then is stored within another array to seperate the document classes. I get the hash function by going through an array and adding the terms to the hash as follows (hash %termFreq is specific for the document and hash %docTerms is the features of all documents):
Then add the hash into an array of documents as follows:
Finally pass the array into an array to seperate the classes of the documents:
took the advice from another thread to iterate through the arrays to get a hash value and print the doc matrix to a csv file:
My problem is that I get rows of the same value since it is accessing the same hash per iteration. Help is much appreciated. Thanks!