Package org.encog.ml.prg

Examples of org.encog.ml.prg.VariableMapping


    pop.getContext().clearDefinedVariables();
    for(AnalystField field : getScript().getNormalize().getNormalizedFields() ) {
      DataField df = getScript().findDataField(field.getName());
      String varName = field.getName();
     
      VariableMapping mapping;
     
      switch( field.getAction() ) {
        case Ignore:
          mapping = null;
          break;
        case PassThrough:
          if( df.isInteger() ) {
            mapping = new VariableMapping(varName, ValueType.intType);
          } else if( df.isReal() ) {
            mapping = new VariableMapping(varName, ValueType.floatingType);
          } else {
            mapping = new VariableMapping(varName, ValueType.stringType);
          }
          break;
        case Equilateral:
        case OneOf:
        case Normalize:
          mapping = new VariableMapping(varName, ValueType.floatingType);
          break;
        case SingleField:
          if( df.isClass() ) {
            mapping = new VariableMapping(varName, ValueType.enumType, classType++, df.getClassMembers().size() );
          } else if( df.isInteger() ) {
            mapping = new VariableMapping(varName, ValueType.intType );
          } else {
            mapping = new VariableMapping(varName, ValueType.floatingType);
          }
          break;
        default:
          throw new AnalystError("Unknown normalization action: " + field.getAction().toString());
      }
View Full Code Here

TOP

Related Classes of org.encog.ml.prg.VariableMapping

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.