public static Dataset<? extends Instance> irisDataset() { if (irisData == null) { CommonFixture tf = new CommonFixture(); irisData = new SampleDataset(); ARFFHandler arff = new ARFFHandler(); try { arff.load(tf.irisArff(), irisData, 4); } catch (FileNotFoundException | ParserError ex) { Exceptions.printStackTrace(ex); } catch (IOException ex) { Exceptions.printStackTrace(ex); } } return irisData; }
public static Dataset<? extends Instance> schoolData() { if (school == null) { CsvLoader loader = new CsvLoader(); school = new ArrayDataset(17, 4); school.setName("school data"); loader.setClassIndex(4); loader.setSeparator(' '); try { loader.load(fixture.schoolData(), school); } catch (IOException ex) { Exceptions.printStackTrace(ex); } } return school; }