How to read a text file with mixed encodings in Scala or Java?

This is how I managed to do it with java: FileInputStream input; String result = null; try { input = new FileInputStream(new File(“invalid.txt”)); CharsetDecoder decoder = Charset.forName(“UTF-8”).newDecoder(); decoder.onMalformedInput(CodingErrorAction.IGNORE); InputStreamReader reader = new InputStreamReader(input, decoder); BufferedReader bufferedReader = new BufferedReader( reader ); StringBuilder sb = new StringBuilder(); String line = bufferedReader.readLine(); while( line != null ) … Read more

How to interpret weka classification?

Below is some sample output for a naive Bayes classifier, using 10-fold cross-validation. There’s a lot of information there, and what you should focus on depends on your application. I’ll explain some of the results below, to get you started. === Stratified cross-validation === === Summary === Correctly Classified Instances 71 71 % Incorrectly Classified … Read more