|
1 |
| -/******************************************************************************* |
| 1 | +/* ***************************************************************************** |
2 | 2 | * Copyright (c) 2015-2019 Skymind, Inc.
|
3 | 3 | *
|
4 | 4 | * This program and the accompanying materials are made available under the
|
|
22 | 22 | import org.datavec.api.records.reader.impl.csv.CSVSequenceRecordReader;
|
23 | 23 | import org.datavec.api.split.NumberedFileInputSplit;
|
24 | 24 | import org.deeplearning4j.datasets.datavec.SequenceRecordReaderDataSetIterator;
|
25 |
| -import org.deeplearning4j.eval.Evaluation; |
26 | 25 | import org.deeplearning4j.nn.conf.GradientNormalization;
|
27 | 26 | import org.deeplearning4j.nn.conf.MultiLayerConfiguration;
|
28 | 27 | import org.deeplearning4j.nn.conf.NeuralNetConfiguration;
|
|
33 | 32 | import org.deeplearning4j.optimize.api.InvocationType;
|
34 | 33 | import org.deeplearning4j.optimize.listeners.EvaluativeListener;
|
35 | 34 | import org.deeplearning4j.optimize.listeners.ScoreIterationListener;
|
| 35 | +import org.nd4j.evaluation.classification.Evaluation; |
36 | 36 | import org.nd4j.linalg.activations.Activation;
|
37 | 37 | import org.nd4j.linalg.dataset.api.iterator.DataSetIterator;
|
38 | 38 | import org.nd4j.linalg.dataset.api.preprocessor.DataNormalization;
|
|
45 | 45 |
|
46 | 46 | import java.io.File;
|
47 | 47 | import java.net.URL;
|
| 48 | +import java.nio.charset.Charset; |
48 | 49 | import java.util.ArrayList;
|
49 | 50 | import java.util.Collections;
|
50 | 51 | import java.util.List;
|
|
88 | 89 | *
|
89 | 90 | * @author Alex Black
|
90 | 91 | */
|
| 92 | +@SuppressWarnings("ResultOfMethodCallIgnored") |
91 | 93 | public class UCISequenceClassificationExample {
|
92 | 94 | private static final Logger log = LoggerFactory.getLogger(UCISequenceClassificationExample.class);
|
93 | 95 |
|
@@ -173,7 +175,7 @@ private static void downloadUCIData() throws Exception {
|
173 | 175 | if (baseDir.exists()) return; //Data already exists, don't download it again
|
174 | 176 |
|
175 | 177 | String url = "https://archive.ics.uci.edu/ml/machine-learning-databases/synthetic_control-mld/synthetic_control.data";
|
176 |
| - String data = IOUtils.toString(new URL(url)); |
| 178 | + String data = IOUtils.toString(new URL(url), (Charset) null); |
177 | 179 |
|
178 | 180 | String[] lines = data.split("\n");
|
179 | 181 |
|
@@ -215,8 +217,8 @@ private static void downloadUCIData() throws Exception {
|
215 | 217 | testCount++;
|
216 | 218 | }
|
217 | 219 |
|
218 |
| - FileUtils.writeStringToFile(outPathFeatures, p.getFirst()); |
219 |
| - FileUtils.writeStringToFile(outPathLabels, p.getSecond().toString()); |
| 220 | + FileUtils.writeStringToFile(outPathFeatures, p.getFirst(), (Charset) null); |
| 221 | + FileUtils.writeStringToFile(outPathLabels, p.getSecond().toString(), (Charset) null); |
220 | 222 | }
|
221 | 223 | }
|
222 | 224 | }
|
0 commit comments