Package org.encog.util

Examples of org.encog.util.HTMLReport


  /**
   * Produce the report.
   * @return The report.
   */
  public final String produceReport() {
    final HTMLReport report = new HTMLReport();

    analyzeFile();
    report.beginHTML();
    report.title("Encog Analyst Report");
    report.beginBody();
   
    report.h1("General Statistics");
    report.beginTable();
    report.tablePair("Total row count", Format.formatInteger(this.rowCount));
    report.tablePair("Missing row count", Format.formatInteger(this.missingCount));
    report.endTable();

    report.h1("Field Ranges");
    report.beginTable();
    report.beginRow();
    report.header("Name");
    report.header("Class?");
    report.header("Complete?");
    report.header("Int?");
    report.header("Real?");
    report.header("Max");
    report.header("Min");
    report.header("Mean");
    report.header("Standard Deviation");
    report.endRow();

    for (final DataField df : this.analyst.getScript().getFields()) {
      report.beginRow();
      report.cell(df.getName());
      report.cell(Format.formatYesNo(df.isClass()));
      report.cell(Format.formatYesNo(df.isComplete()));
      report.cell(Format.formatYesNo(df.isInteger()));
      report.cell(Format.formatYesNo(df.isReal()));
      report.cell(Format.formatDouble(df.getMax(), FIVE_SPAN));
      report.cell(Format.formatDouble(df.getMin(), FIVE_SPAN));
      report.cell(Format.formatDouble(df.getMean(), FIVE_SPAN));
      report.cell(Format.formatDouble(df.getStandardDeviation(),
          FIVE_SPAN));
      report.endRow();

      if (df.getClassMembers().size() > 0) {
        report.beginRow();
        report.cell(" ");
        report.beginTableInCell(EIGHT_SPAN);
        report.beginRow();
        report.header("Code");
        report.header("Name");
        report.header("Count");
        report.endRow();
        for (final AnalystClassItem item : df.getClassMembers()) {
          report.beginRow();
          report.cell(item.getCode());
          report.cell(item.getName());
          report.cell(Format.formatInteger(item.getCount()));
          report.endRow();
        }
        report.endTableInCell();
        report.endRow();

      }

    }

    report.endTable();

    report.h1("Normalization");
    report.beginTable();
    report.beginRow();
    report.header("Name");
    report.header("Action");
    report.header("High");
    report.header("Low");
    report.endRow();

    for (final AnalystField item : this.analyst.getScript().getNormalize()
        .getNormalizedFields()) {
      report.beginRow();
      report.cell(item.getName());
      report.cell(item.getAction().toString());
      report.cell(Format.formatDouble(item.getNormalizedHigh(),
          FIVE_SPAN));
      report.cell(Format.formatDouble(item.getNormalizedLow(),
          FIVE_SPAN));
      report.endRow();
    }

    report.endTable();
   
    report.h1("Machine Learning");
    report.beginTable();
    report.beginRow();
    report.header("Name");
    report.header("Value");
    report.endRow();

    final String t = this.analyst.getScript().getProperties()
        .getPropertyString(ScriptProperties.ML_CONFIG_TYPE);
    final String a = this.analyst.getScript().getProperties()
        .getPropertyString(ScriptProperties.ML_CONFIG_ARCHITECTURE);
    final String rf = this.analyst
        .getScript()
        .getProperties()
        .getPropertyString(
            ScriptProperties.ML_CONFIG_MACHINE_LEARNING_FILE);

    report.tablePair("Type", t);
    report.tablePair("Architecture", a);
    report.tablePair("Machine Learning File", rf);
    report.endTable();

    report.h1("Files");
    report.beginTable();
    report.beginRow();
    report.header("Name");
    report.header("Filename");
    report.endRow();
    for (final String key : this.analyst.getScript().getProperties()
        .getFilenames()) {
      final String value = this.analyst.getScript().getProperties()
          .getFilename(key);
      report.beginRow();
      report.cell(key);
      report.cell(value);
      report.endRow();
    }
    report.endTable();

    report.endBody();
    report.endHTML();

    return report.toString();
  }
View Full Code Here


    add(this.scroll, BorderLayout.CENTER);
    init();
  }
 
  public void init() {
    HTMLReport report = new HTMLReport();
    report.beginHTML();
    String title = "Unknown File Type";
    report.title(title);
    report.beginBody();
    report.h1(title);
    report.para("Unknown file type.  Do not know how to display.");
   
    report.beginTable();
    report.tablePair("File Size", Format.formatMemory(this.getEncogObject().getFile().length()));
    report.tablePair("Last Modified", new Date(this.getEncogObject().getFile().lastModified()).toString());
   
    report.endTable();

    report.endBody();
    report.endHTML();
    this.display(report.toString());

  }
View Full Code Here

    this.analyst = analyst;
    generate();
  }
 
  public void generate() {
    HTMLReport report = new HTMLReport();
   
    AnalystReport analystReport = new AnalystReport(this.analyst);
    String str = analystReport.produceReport();
    this.display(str);
  }
View Full Code Here

   
    generate();
  }
 
  public void generate() {
    HTMLReport report = new HTMLReport();
    report.beginHTML();
    String title = "Encog Workbench v" + EncogWorkBench.VERSION;
    report.title(title);
    report.beginBody();
    report.h1(title);
    report.para("Encog Workbench is released under the Apache License.  For more information see the license file released with the Encog Workbench.");
    report.h3(EncogWorkBench.COPYRIGHT);
   
    report.beginTable();
    report.tablePair("Java Version", System.getProperty("java.version"));
    report.tablePair("Java 64/32-Bit", System.getProperty("sun.arch.data.model"));
    report.tablePair("Processor Count", ""+Runtime.getRuntime().availableProcessors());
    report.tablePair("OS Name/Version", ""+ByteOrder.nativeOrder().toString());
    report.tablePair("Encog Core Version", ""+Encog.VERSION)
    report.endTable();

    report.h3("Active JAR Files");
    report.beginList();
    for (final String file : this.jars) {
      report.listItem(file);
    }   
    report.endList();
    report.endBody();
    report.endHTML();
   
   
    this.display(report.toString());
  }
View Full Code Here

    EncogWorkBench.getInstance().getMainWindow().getTabManager()
        .openModalTab(tab, "Analyze Weights");
  }

  public void produceReport() {
    HTMLReport report = new HTMLReport();
    report.beginHTML();
    report.title("MLMethod");
    report.beginBody();
    report.h1(this.method.getClass().getSimpleName());

    report.beginTable();

    if (method instanceof MLInput) {
      MLInput reg = (MLInput) method;
      report.tablePair("Input Count",
          Format.formatInteger(reg.getInputCount()));
    }

    if (method instanceof MLOutput) {
      MLOutput reg = (MLOutput) method;
      report.tablePair("Output Count",
          Format.formatInteger(reg.getOutputCount()));
    }

    if (method instanceof MLEncodable) {
      MLEncodable encode = (MLEncodable)method;
      report.tablePair("Encoded Length",
          Format.formatInteger(encode.encodedArrayLength()));
    }

    report.tablePair("Resettable",
        (method instanceof MLResettable) ? "true" : "false");
   
    report.tablePair("Context",
        (method instanceof MLContext) ? "true" : "false");
   
   
    if( method instanceof NEATNetwork ) {
      NEATNetwork neat = (NEATNetwork)method;
      report.tablePair("Output Activation Function", neat.getOutputActivationFunction().getClass().getSimpleName());
      report.tablePair("NEAT Activation Function", neat.getActivationFunction().getClass().getSimpleName());
    }
   
    if( method instanceof CPN ) {
      CPN cpn = (CPN)method;
      report.tablePair("Instar Count", Format.formatInteger(cpn.getInstarCount()));
      report.tablePair("Outstar Count", Format.formatInteger(cpn.getOutstarCount()));     
    }
   
    report.endTable();
   
    if (this.method instanceof RBFNetwork) {
      RBFNetwork rbfNetwork = (RBFNetwork)this.method;
     
      report.h3("RBF Centers");
      report.beginTable();
      report.beginRow();
      report.header("RBF");
      report.header("Peak");
      report.header("Width");
      for(int i=1;i<=rbfNetwork.getInputCount();i++) {
        report.header("Center " + i);
      }
      report.endRow();
     
     
      for( RadialBasisFunction rbf : rbfNetwork.getRBF() ) {
        report.beginRow();
        report.cell(rbf.getClass().getSimpleName());
        report.cell(Format.formatDouble(rbf.getPeak(), 5));
        report.cell(Format.formatDouble(rbf.getWidth(), 5));
        for(int i=0;i<rbfNetwork.getInputCount();i++) {
          report.cell(Format.formatDouble(rbf.getCenter(i), 5));
        }
        report.endRow();
      }
    }

    if (this.method instanceof BasicNetwork) {
      report.h3("Layers");
      report.beginTable();
      report.beginRow();
      report.header("Layer #");
      report.header("Total Count");
      report.header("Neuron Count");
      report.header("Activation Function");
      report.header("Bias");
      report.header("Context Target Size");
      report.header("Context Target Offset");
      report.header("Context Count");
      report.endRow();

      BasicNetwork network = (BasicNetwork) method;
      FlatNetwork flat = network.getStructure().getFlat();
      int layerCount = network.getLayerCount();

      for (int l = 0; l < layerCount; l++) {
        report.beginRow();
        StringBuilder str = new StringBuilder();
        str.append(Format.formatInteger(l + 1));
        if (l == 0) {
          str.append(" (Output)");
        } else if (l == network.getLayerCount() - 1) {
          str.append(" (Input)");
        }
        report.cell(str.toString());
        report.cell(Format.formatInteger(flat.getLayerCounts()[l]));
        report.cell(Format.formatInteger(flat.getLayerFeedCounts()[l]));
        report.cell(flat.getActivationFunctions()[l].getClass()
            .getSimpleName());
        report.cell(Format.formatDouble(flat.getBiasActivation()[l], 4));
        report.cell(Format.formatInteger(flat.getContextTargetSize()[l]));
        report.cell(Format.formatInteger(flat.getContextTargetOffset()[l]));
        report.cell(Format.formatInteger(flat.getLayerContextCount()[l]));
        report.endRow();
      }
      report.endTable();
    }
   


    report.endBody();
    report.endHTML();
    this.editor.setText(report.toString());
  }
View Full Code Here

public class TrainingContTab extends HTMLTab {

  public TrainingContTab(ProjectEGFile encogObject) {
    super(encogObject);
    HTMLReport report = new HTMLReport();
    report.beginHTML();
    String title = "Encog Training Continuation";
    report.title(title);
    report.beginBody();
    report.h1(title);
    report.para("This is an Encog training continuation object.  It allows training to begin exactly where it left off.  When a neural network, or other machine learning method, is trained certian data must be kept to track the training progress.  Think of this as the notes you take in a class.  Without this training data Encog will lose some ground when training is continued. This file will be used automatically if training can be continued. ");
    report.para("However, the neural network does not need this data to function.  Once training is done, this file can be deleted.");
    report.para("Data designed for: " + ((TrainingContinuation)encogObject.getObject()).getTrainingType() );
    report.endBody();
    report.endHTML();
    this.display(report.toString());
   
  }
View Full Code Here

public class UnknownObjectTab extends HTMLTab {

  public UnknownObjectTab(ProjectEGFile encogObject) {
    super(encogObject);
    HTMLReport report = new HTMLReport();
    report.beginHTML();
    String title = "Unknown Encog Object Type";
    report.title(title);
    report.beginBody();
    report.h1(title);
    report.para("Unknown Object: " + encogObject.getEncogType());
    report.endBody();
    report.endHTML();
    this.display(report.toString());
   
  }
View Full Code Here

 
  public SVMTab(ProjectEGFile encogObject) {
    super(encogObject);
    this.network = (SVM)encogObject.getObject();
   
    HTMLReport report = new HTMLReport();
    String title = "Support Vector Machine (SVM)";
    report.beginHTML();
    report.title(title);
    report.beginBody();
    report.h1(title);
    report.beginTable();
    SVM svm = (SVM)encogObject.getObject();
    report.tablePair("Input Count",""+svm.getInputCount());
    report.tablePair("SVM Type",svm.getSVMType().toString());
    report.tablePair("Kernel Type",svm.getKernelType().toString());
    report.endTable();
    report.endBody();
    report.endHTML();
   
    this.display(report.toString());
  }
View Full Code Here

  /**
   * Produce the report.
   * @return The report.
   */
  public String produceReport() {
    final HTMLReport report = new HTMLReport();

    analyzeFile();
    report.beginHTML();
    report.title("Encog Analyst Report");
    report.beginBody();
   
    report.h1("General Statistics");
    report.beginTable();
    report.tablePair("Total row count", Format.formatInteger(this.rowCount));
    report.tablePair("Missing row count", Format.formatInteger(this.missingCount));
    report.endTable();

    report.h1("Field Ranges");
    report.beginTable();
    report.beginRow();
    report.header("Name");
    report.header("Class?");
    report.header("Complete?");
    report.header("Int?");
    report.header("Real?");
    report.header("Max");
    report.header("Min");
    report.header("Mean");
    report.header("Standard Deviation");
    report.endRow();

    for (final DataField df : this.analyst.getScript().getFields()) {
      report.beginRow();
      report.cell(df.getName());
      report.cell(Format.formatYesNo(df.isClass()));
      report.cell(Format.formatYesNo(df.isComplete()));
      report.cell(Format.formatYesNo(df.isInteger()));
      report.cell(Format.formatYesNo(df.isReal()));
      report.cell(Format.formatDouble(df.getMax(), FIVE_SPAN));
      report.cell(Format.formatDouble(df.getMin(), FIVE_SPAN));
      report.cell(Format.formatDouble(df.getMean(), FIVE_SPAN));
      report.cell(Format.formatDouble(df.getStandardDeviation(),
          FIVE_SPAN));
      report.endRow();

      if (df.getClassMembers().size() > 0) {
        report.beginRow();
        report.cell(" ");
        report.beginTableInCell(EIGHT_SPAN);
        report.beginRow();
        report.header("Code");
        report.header("Name");
        report.header("Count");
        report.endRow();
        for (final AnalystClassItem item : df.getClassMembers()) {
          report.beginRow();
          report.cell(item.getCode());
          report.cell(item.getName());
          report.cell(Format.formatInteger(item.getCount()));
          report.endRow();
        }
        report.endTableInCell();
        report.endRow();

      }

    }

    report.endTable();

    report.h1("Normalization");
    report.beginTable();
    report.beginRow();
    report.header("Name");
    report.header("Action");
    report.header("High");
    report.header("Low");
    report.endRow();

    for (final AnalystField item : this.analyst.getScript().getNormalize()
        .getNormalizedFields()) {
      report.beginRow();
      report.cell(item.getName());
      report.cell(item.getAction().toString());
      report.cell(Format.formatDouble(item.getNormalizedHigh(),
          FIVE_SPAN));
      report.cell(Format.formatDouble(item.getNormalizedLow(),
          FIVE_SPAN));
      report.endRow();
    }

    report.endTable();
   
    report.h1("Machine Learning");
    report.beginTable();
    report.beginRow();
    report.header("Name");
    report.header("Value");
    report.endRow();

    final String t = this.analyst.getScript().getProperties()
        .getPropertyString(ScriptProperties.ML_CONFIG_TYPE);
    final String a = this.analyst.getScript().getProperties()
        .getPropertyString(ScriptProperties.ML_CONFIG_ARCHITECTURE);
    final String rf = this.analyst
        .getScript()
        .getProperties()
        .getPropertyString(
            ScriptProperties.ML_CONFIG_MACHINE_LEARNING_FILE);

    report.tablePair("Type", t);
    report.tablePair("Architecture", a);
    report.tablePair("Machine Learning File", rf);
    report.endTable();

    report.h1("Files");
    report.beginTable();
    report.beginRow();
    report.header("Name");
    report.header("Filename");
    report.endRow();
    for (final String key : this.analyst.getScript().getProperties()
        .getFilenames()) {
      final String value = this.analyst.getScript().getProperties()
          .getFilename(key);
      report.beginRow();
      report.cell(key);
      report.cell(value);
      report.endRow();
    }
    report.endTable();

    report.endBody();
    report.endHTML();

    return report.toString();
  }
View Full Code Here

TOP

Related Classes of org.encog.util.HTMLReport

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.