You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by sm...@apache.org on 2013/12/21 18:29:52 UTC
svn commit: r1552927 -
/mahout/trunk/core/src/test/java/org/apache/mahout/classifier/mlp/TestNeuralNetwork.java
Author: smarthi
Date: Sat Dec 21 17:29:52 2013
New Revision: 1552927
URL: http://svn.apache.org/r1552927
Log:
Replaced String.split() with CSVUtils.parseline()
Modified:
mahout/trunk/core/src/test/java/org/apache/mahout/classifier/mlp/TestNeuralNetwork.java
Modified: mahout/trunk/core/src/test/java/org/apache/mahout/classifier/mlp/TestNeuralNetwork.java
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/test/java/org/apache/mahout/classifier/mlp/TestNeuralNetwork.java?rev=1552927&r1=1552926&r2=1552927&view=diff
==============================================================================
--- mahout/trunk/core/src/test/java/org/apache/mahout/classifier/mlp/TestNeuralNetwork.java (original)
+++ mahout/trunk/core/src/test/java/org/apache/mahout/classifier/mlp/TestNeuralNetwork.java Sat Dec 21 17:29:52 2013
@@ -22,6 +22,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+import org.apache.commons.csv.CSVUtils;
import org.apache.mahout.classifier.mlp.NeuralNetwork.TrainingMethod;
import org.apache.mahout.common.MahoutTestCase;
import org.apache.mahout.math.DenseMatrix;
@@ -220,7 +221,7 @@ public class TestNeuralNetwork extends M
// skip the header line, hence remove the first element in the list
cancerDataSetList.remove(0);
for (String line : cancerDataSetList) {
- String[] tokens = line.split(",");
+ String[] tokens = CSVUtils.parseLine(line);
double[] values = new double[tokens.length];
for (int i = 0; i < tokens.length; ++i) {
values[i] = Double.parseDouble(tokens[i]);
@@ -272,7 +273,7 @@ public class TestNeuralNetwork extends M
irisDataSetList.remove(0);
for (String line : irisDataSetList) {
- String[] tokens = line.split(",");
+ String[] tokens = CSVUtils.parseLine(line);
// last three dimensions represent the labels
double[] values = new double[tokens.length + numOfClasses - 1];
Arrays.fill(values, 0.0);