Vectorizing text file in java for kmeans clustering java encog

I am using the java encog machine learning library to run kmeans clustering. The problem is that this is only possible with numerical data. Is there a way to vectorize a text file (data) so that I can feed into the kmeans clustering algorithm directly.

I am new to this space. Any help is appreciated.

+3


source to share


1 answer


try to use Object Out put Stream as follows



ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject("YOUR_TEXT");
oos.close();

      

+1


source







All Articles