Package org.encog.app.analyst

Examples of org.encog.app.analyst.EncogAnalyst


    System.out.println("Starting Iris dataset example.");
    URL url = new URL(IRIS_SOURCE);
    File analystFile = new File(dir,"iris.ega");
    File rawFile = new File(dir,"iris_raw.csv");
   
    EncogAnalyst encog = new EncogAnalyst();
    encog.addAnalystListener(new ConsoleAnalystListener());
    AnalystWizard wiz = new AnalystWizard(encog);
   
    wiz.wizard(url, analystFile, rawFile, false, AnalystFileFormat.DECPNT_COMMA);

    encog.executeTask("task-full");
   
    encog.save(analystFile);
   
    AnalystReport report = new AnalystReport(encog);
    report.produceReport(new File(dir,"report.html"));
  }
View Full Code Here


    System.out.println("Starting forest cover dataset example.");
    URL url = new URL(FOREST_SOURCE);
    File analystFile = new File(dir,"forest.ega");
    File rawFile = new File(dir,"forest_raw.csv");
   
    EncogAnalyst encog = new EncogAnalyst();
    encog.addAnalystListener(new ConsoleAnalystListener());
    AnalystWizard wiz = new AnalystWizard(encog);
    wiz.setTaskBalance(true);
   
    wiz.wizard(url, analystFile, rawFile, false, AnalystFileFormat.DECPNT_COMMA);
   
    encog.executeTask("task-full");
   
    encog.save(analystFile);
   
    AnalystReport report = new AnalystReport(encog);
    report.produceReport(new File(dir,"report.html"));
  }
View Full Code Here

    if (csvFile != null) {
      dialog.getRawFile().setValue(csvFile.toString());
    }

    if (dialog.process()) {
      EncogAnalyst analyst = null;
      File projectFolder = EncogWorkBench.getInstance()
          .getProjectDirectory();
      File egaFile = null;
     
      if( dialog.getMethodType()==WizardMethodType.SOM && dialog.getGoal()==AnalystGoal.Regression ) {
        EncogWorkBench.displayError("Error", "Can't use a SOM with regression.");
        return;
      }

      try {
        EncogWorkBench.getInstance().getMainWindow().beginWait();
        File sourceCSVFile = new File(dialog.getRawFile().getValue());
        File targetCSVFile = new File(projectFolder,
            sourceCSVFile.getName());

        if (!sourceCSVFile.toString().equals(targetCSVFile.toString())) {
          org.encog.util.file.FileUtil.copy(sourceCSVFile,
              targetCSVFile);
        }

        egaFile = new File(FileUtil.forceExtension(
            targetCSVFile.toString(), "ega"));

        if (!EncogWorkBench.getInstance().getMainWindow()
            .getTabManager().queryViews(egaFile))
          return;

        File egFile = new File(FileUtil.forceExtension(
            targetCSVFile.toString(), "eg"));

        analyst = new EncogAnalyst();
        AnalystWizard wizard = new AnalystWizard(analyst);
        boolean headers = dialog.getHeaders().getValue();
        AnalystFileFormat format = dialog.getFormat();

        wizard.setMethodType(dialog.getMethodType());
        wizard.setTargetField(dialog.getTargetField());
       
        String m = (String)dialog.getMissing().getSelectedValue();
        if( m.equals("DiscardMissing") ) {
          wizard.setMissing(new DiscardMissing())
        } else if( m.equals("MeanAndModeMissing") ) {
          wizard.setMissing(new MeanAndModeMissing())
        } else if( m.equals("NegateMissing") ) {
          wizard.setMissing(new NegateMissing())
        } else {
          wizard.setMissing(new DiscardMissing());
        }
       
        wizard.setGoal(dialog.getGoal());
        wizard.setLagWindowSize(dialog.getLagCount().getValue());
        wizard.setLeadWindowSize(dialog.getLeadCount().getValue());
        wizard.setIncludeTargetField(dialog.getIncludeTarget()
            .getValue());
        wizard.setRange(dialog.getRange());
        wizard.setTaskNormalize(dialog.getNormalize().getValue());
        wizard.setTaskRandomize(dialog.getRandomize().getValue());
        wizard.setTaskSegregate(dialog.getSegregate().getValue());
        wizard.setTaskBalance(dialog.getBalance().getValue());
        wizard.setTaskCluster(dialog.getCluster().getValue());

        wizard.wizard(targetCSVFile, headers, format);

      } catch (EncogError e) {
        EncogWorkBench.displayError("Error Generating Analyst Script",
            e);
      } finally {
        EncogWorkBench.getInstance().getMainWindow().endWait();
        if (analyst != null)
          analyst.save(egaFile);
        EncogWorkBench.getInstance().getMainWindow().getTree()
            .refresh();
      }
    }
  }
View Full Code Here

  private final JComboBox tasks;
  private final TasksModel model;

  public EncogAnalystTab(ProjectFile file) {
    super(file);
    this.analyst = new EncogAnalyst();

    loadFromFile();

    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
View Full Code Here

    line.append(");");
    addLine(line.toString());
  }

  private void processMainBlock() {
    final EncogAnalyst analyst = getAnalyst();

    final String processID = analyst.getScript().getProperties()
        .getPropertyString(ScriptProperties.PROCESS_CONFIG_SOURCE_FILE);

    final String methodID = analyst
        .getScript()
        .getProperties()
        .getPropertyString(
            ScriptProperties.ML_CONFIG_MACHINE_LEARNING_FILE);

    final File methodFile = analyst.getScript().resolveFilename(methodID);

    final File processFile = analyst.getScript().resolveFilename(processID);

    MLMethod method = null;
    int[] contextTargetOffset = null;
    int[] contextTargetSize = null;
    boolean hasContext = false;
View Full Code Here

    line.append("};");
    addLine(line.toString());
  }

  private void processMainBlock() {
    EncogAnalyst analyst = getAnalyst();

    final String processID = analyst.getScript().getProperties()
        .getPropertyString(ScriptProperties.PROCESS_CONFIG_SOURCE_FILE);

    final String methodID = analyst
        .getScript()
        .getProperties()
        .getPropertyString(
            ScriptProperties.ML_CONFIG_MACHINE_LEARNING_FILE);

    final File methodFile = analyst.getScript().resolveFilename(methodID);

    final File processFile = analyst.getScript().resolveFilename(processID);

    MLMethod method = null;
    int[] contextTargetOffset = null;
    int[] contextTargetSize = null;
    boolean hasContext = false;
View Full Code Here

TOP

Related Classes of org.encog.app.analyst.EncogAnalyst

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.