@Override public void getDescription(StringBuilder sb, int indent) { sb.append("SimpleCSVStream: "); sb.append(csvFileOption.getFile().getName()); sb.append("\t NumInstancesRead: "); sb.append(this.numInstancesRead); sb.append("\t HitEndOfFile: "); sb.append(this.hitEndOfFile); }
public ArffFileStream(String arffFileName, int classIndex) { this.arffFileOption.setValue(arffFileName); this.classIndexOption.setValue(classIndex); this.hasStarted = false; restart(); }
public void browseForFile() { JFileChooser fileChooser = new JFileChooser(); fileChooser.setAcceptAllFileFilterUsed(true); String extension = this.editedOption.getDefaultFileExtension(); if (extension != null) { fileChooser.addChoosableFileFilter(new FileExtensionFilter( extension)); } fileChooser.setSelectedFile(new File(this.textField.getText())); if (this.editedOption.isOutputFile()) { if (fileChooser.showSaveDialog(this.browseButton) == JFileChooser.APPROVE_OPTION) { File chosenFile = fileChooser.getSelectedFile(); String fileName = chosenFile.getPath(); if (!chosenFile.exists()) { if ((extension != null) && !fileName.endsWith(extension)) { fileName = fileName + "." + extension; } } this.textField.setText(fileName); } } else { if (fileChooser.showOpenDialog(this.browseButton) == JFileChooser.APPROVE_OPTION) { this.textField.setText(fileChooser.getSelectedFile().getPath()); } } } }
String fileCLI = this.arffFileOption.getValueAsCLIString(); stream = (InstanceStream) getPreparedClassOption(this.streamOption); this.arffFileOption.setValueViaCLIString(s); File destFile = this.arffFileOption.getFile(); System.out.println("Writing stream to ARFF: "+this.streamOption.getValueAsCLIString()+" to "+this.arffFileOption.getValueAsCLIString()); monitor.setCurrentActivityDescription("Writing stream to ARFF: "+this.streamOption.getValueAsCLIString()+" to "+this.arffFileOption.getValueAsCLIString()); if (!this.suppressHeaderOption.isSet())
File ownTaskResultFile = this.outputFileOption.getFile(); this.outputFileOption.setValue( this.insertFileNameExtension( ownTaskResultFile.getAbsolutePath(), File baseDumpFile = evalTask.dumpFileOption.getFile(); String baseDumpFileName = baseDumpFile != null ? baseDumpFile.getAbsolutePath() : null; File baseTaskResultFile = evalTask.outputFileOption.getFile(); String baseTaskResultName = baseTaskResultFile != null ? baseTaskResultFile.getAbsolutePath() : null; paramValueTask.dumpFileOption.setValue( this.insertFileNameExtension( baseDumpFileName, outputFileExtension)); paramValueTask.outputFileOption.setValue( this.insertFileNameExtension( baseTaskResultName, outputFileExtension));
arffFile = fStream.arffFileOption.getValueAsCLIString(); arffFile = arffFile.substring(0, arffFile.length()-6).concat(i+".arff"); fStream.arffFileOption.setValueViaCLIString(arffFile); this.task.streamOption.setValueViaCLIString(fStream.getCLICreationString(fStream.getClass())); outputFile = this.dumpFileOption.getValueAsCLIString(); if(outputFile.substring(outputFile.length()-4, outputFile.length()).equals(".csv")) this.task.dumpFileOption.setValueViaCLIString(outputFile);
@Override public void applyState() { this.editedOption.setValueViaCLIString(this.textField.getText().length() > 0 ? this.textField.getText() : null); }
public FileOptionEditComponent(Option opt) { FileOption option = (FileOption) opt; this.editedOption = option; setLayout(new BorderLayout()); add(this.textField, BorderLayout.CENTER); add(this.browseButton, BorderLayout.EAST); this.browseButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { browseForFile(); } }); setEditState(this.editedOption.getValueAsCLIString()); }
public void init() { FileInputStream fstream = null; try { fstream = new FileInputStream(this.fileOption.getFile()); DataInputStream in = new DataInputStream(fstream); br = new BufferedReader(new InputStreamReader(in)); } catch (FileNotFoundException ex) { Logger.getLogger(MovielensDataset.class.getName()).log(Level.SEVERE, null, ex); } }
public MultilabelArffFileStream(String arffFileName, int numLabels) { this.arffFileOption.setValue(arffFileName); this.numLabelsOption.setValue(numLabels); restart(); }
public void init() { FileInputStream fstream = null; try { fstream = new FileInputStream(this.fileOption.getFile()); DataInputStream in = new DataInputStream(fstream); br = new BufferedReader(new InputStreamReader(in)); } catch (FileNotFoundException ex) { Logger.getLogger(MovielensDataset.class.getName()).log(Level.SEVERE, null, ex); } }
@Override public void setFactory(ComponentFactory factory) { // TODO unify this code with init() for now, it's used by S4 App // dynamic binding theoretically will solve this problem builder = new TopologyBuilder(factory); logger.debug("Successfully instantiated TopologyBuilder"); builder.initTopology(arffFileOption.getValue()); logger.debug("Successfully initialized SAMOA topology with name {}", arffFileOption.getValue()); }
public MultiTargetArffFileStream(String arffFileName, String classIndices) { this.arffFileOption.setValue(arffFileName); this.outputAttributesOption.setValue(classIndices); restart(); }
public void init() { FileInputStream fstream = null; try { //fstream = new FileInputStream("/Users/abifet/Downloads/ml-1M/ratings.dat"); fstream = new FileInputStream(this.fileOption.getFile()); DataInputStream in = new DataInputStream(fstream); br = new BufferedReader(new InputStreamReader(in)); } catch (FileNotFoundException ex) { Logger.getLogger(MovielensDataset.class.getName()).log(Level.SEVERE, null, ex); } }
@Override public void setFactory(ComponentFactory factory) { // TODO unify this code with init() for now, it's used by S4 App // dynamic binding theoretically will solve this problem builder = new TopologyBuilder(factory); logger.debug("Successfully instantiated TopologyBuilder"); builder.initTopology(arffFileOption.getValue()); logger.debug("Successfully initialized SAMOA topology with name {}", arffFileOption.getValue()); }
public ArffFileStream(String arffFileName, int classIndex) { this.arffFileOption.setValue(arffFileName); this.classIndexOption.setValue(classIndex); this.hasStarted = false; restart(); }