I have a Map.Entry<File, int[]> of the form:
/data/train/politics/p_0.txt, [0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0]
/data/train/science/s_0.txt, [1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0]
/data/train/atheism/a_0.txt, [0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
/data/train/sports/s_1.txt, [0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1]
I want to put this data to a 2D array of the form:
double[][] features = new double[ GLOBO_DICT.size() ][ perceptron_input.size() ];
But I don't want that file name (label) to be included in the 2D array.
I was thinking something like the following would do the trick but now I'm not so certain.
//number of features, number of x, y, z
int size_of_globo_dict = GLOBO_DICT.size();
//number of instances
int NUM_INSTANCES = perceptron_input.size();
double[][] features = new double[ perceptron_input.size() ][ GLOBO_DICT.size() ];
for(int i = 0; i <= size_of_globo_dict; i++)
{
for(int j = 0; j <= NUM_INSTANCES; j++)
{
features[j][i] =
}
}
I need to be able to access the internal int array by it's index, how to do that?
something like 'internatl_int_array.get( instance i)'
Map.values()? You should bear in mind that the order of entries in a map may well be unstable.featuresis defined asnew double[ GLOBO_DICT.size() ][ perceptron_input.size() ]in the second code block but asnew double[ perceptron_input.size() ][ GLOBO_DICT.size() ]in the third code block?