Codota Logo
LocalTransformations
Code IndexAdd Codota to your IDE (free)

How to use
LocalTransformations
in
org.dmg.pmml

Best Java code snippets using org.dmg.pmml.LocalTransformations (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: org.jpmml/pmml-model

@Override
public VisitorAction visit(LocalTransformations localTransformations){
  if(localTransformations.hasDerivedFields()){
    this.localDerivedFields.addAll(localTransformations.getDerivedFields());
  }
  return super.visit(localTransformations);
}
origin: jpmml/jpmml-model

/**
 * Create an instance of {@link LocalTransformations }
 * 
 */
public LocalTransformations createLocalTransformations() {
  return new LocalTransformations();
}
origin: jpmml/jpmml-model

@Override
public LocalTransformations addExtensions(Extension... extensions) {
  getExtensions().addAll(Arrays.asList(extensions));
  return this;
}
origin: jpmml/jpmml-model

public LocalTransformations addDerivedFields(DerivedField... derivedFields) {
  getDerivedFields().addAll(Arrays.asList(derivedFields));
  return this;
}
origin: org.jpmml/pmml-model

@Override
public VisitorAction accept(Visitor visitor) {
  VisitorAction status = visitor.visit(this);
  if (status == VisitorAction.CONTINUE) {
    visitor.pushParent(this);
    if ((status == VisitorAction.CONTINUE)&&hasExtensions()) {
      status = org.dmg.pmml.PMMLObject.traverse(visitor, getExtensions());
    }
    if ((status == VisitorAction.CONTINUE)&&hasDerivedFields()) {
      status = org.dmg.pmml.PMMLObject.traverse(visitor, getDerivedFields());
    }
    visitor.popParent();
  }
  if (status == VisitorAction.TERMINATE) {
    return VisitorAction.TERMINATE;
  }
  return VisitorAction.CONTINUE;
}
origin: ShifuML/shifu

private LocalTransformations getLocalTranformations(NeuralNetwork model) {
  // delete target
  List<DerivedField> derivedFields = model.getLocalTransformations().getDerivedFields();
  // add bias
  DerivedField field = new DerivedField(OpType.CONTINUOUS, DataType.DOUBLE).withName(new FieldName(
      PluginConstants.biasValue));
  field.withExpression(new Constant(String.valueOf(PluginConstants.bias)));
  derivedFields.add(field);
  return new LocalTransformations().withDerivedFields(derivedFields);
}
origin: ShifuML/shifu

@Override
public LocalTransformations build(BasicML basicML) {
  LocalTransformations localTransformations = new LocalTransformations();
  if(basicML instanceof BasicFloatNetwork) {
    BasicFloatNetwork bfn = (BasicFloatNetwork) basicML;
    Set<Integer> featureSet = bfn.getFeatureSet();
    for(ColumnConfig config: columnConfigList) {
      if(config.isFinalSelect()
          && (CollectionUtils.isEmpty(featureSet) || featureSet.contains(config.getColumnNum()))) {
        double cutoff = modelConfig.getNormalizeStdDevCutOff();
        localTransformations.withDerivedFields(config.isCategorical() ? createCategoricalDerivedField(
            config, cutoff, modelConfig.getNormalizeType()) : createNumericalDerivedField(config,
            cutoff, modelConfig.getNormalizeType()));
      }
    }
  } else {
    for(ColumnConfig config: columnConfigList) {
      if(config.isFinalSelect()) {
        double cutoff = modelConfig.getNormalizeStdDevCutOff();
        localTransformations.withDerivedFields(config.isCategorical() ? createCategoricalDerivedField(
            config, cutoff, modelConfig.getNormalizeType()) : createNumericalDerivedField(config,
            cutoff, modelConfig.getNormalizeType()));
      }
    }
  }
  return localTransformations;
}
origin: jpmml/jpmml-model

@Override
public PMMLObject popParent(){
  PMMLObject parent = super.popParent();
  if(parent instanceof Model){
    Model model = (Model)parent;
    LocalTransformations localTransformations = model.getLocalTransformations();
    if(localTransformations != null){
      processLocalTransformations(localTransformations);
      if(!localTransformations.hasDerivedFields()){
        model.setLocalTransformations(null);
      }
    }
  } else
  if(parent instanceof PMML){
    PMML pmml = (PMML)parent;
    TransformationDictionary transformationDictionary = pmml.getTransformationDictionary();
    if(transformationDictionary != null){
      processTransformationDictionary(transformationDictionary);
      if(!transformationDictionary.hasDefineFunctions() && !transformationDictionary.hasDerivedFields()){
        pmml.setTransformationDictionary(null);
      }
    }
  }
  return parent;
}
origin: org.jpmml/pmml-model

public LocalTransformations addDerivedFields(DerivedField... derivedFields) {
  getDerivedFields().addAll(Arrays.asList(derivedFields));
  return this;
}
origin: jpmml/jpmml-model

@Override
public VisitorAction accept(Visitor visitor) {
  VisitorAction status = visitor.visit(this);
  if (status == VisitorAction.CONTINUE) {
    visitor.pushParent(this);
    if ((status == VisitorAction.CONTINUE)&&hasExtensions()) {
      status = org.dmg.pmml.PMMLObject.traverse(visitor, getExtensions());
    }
    if ((status == VisitorAction.CONTINUE)&&hasDerivedFields()) {
      status = org.dmg.pmml.PMMLObject.traverse(visitor, getDerivedFields());
    }
    visitor.popParent();
  }
  if (status == VisitorAction.TERMINATE) {
    return VisitorAction.TERMINATE;
  }
  return VisitorAction.CONTINUE;
}
origin: org.jpmml/pmml-model

@Override
public PMMLObject popParent(){
  PMMLObject parent = super.popParent();
  if(parent instanceof Model){
    Model model = (Model)parent;
    LocalTransformations localTransformations = model.getLocalTransformations();
    if(localTransformations != null){
      processLocalTransformations(localTransformations);
      if(!localTransformations.hasDerivedFields()){
        model.setLocalTransformations(null);
      }
    }
  } else
  if(parent instanceof PMML){
    PMML pmml = (PMML)parent;
    TransformationDictionary transformationDictionary = pmml.getTransformationDictionary();
    if(transformationDictionary != null){
      processTransformationDictionary(transformationDictionary);
      if(!transformationDictionary.hasDefineFunctions() && !transformationDictionary.hasDerivedFields()){
        pmml.setTransformationDictionary(null);
      }
    }
  }
  return parent;
}
origin: jpmml/jpmml-model

@Override
public VisitorAction visit(LocalTransformations localTransformations){
  if(localTransformations.hasDerivedFields()){
    this.localDerivedFields.addAll(localTransformations.getDerivedFields());
  }
  return super.visit(localTransformations);
}
origin: jpmml/jpmml-evaluator

  @Override
  public Map<FieldName, DerivedField> load(LocalTransformations localTransformations){
    return IndexableUtil.buildMap(localTransformations.getDerivedFields());
  }
});
origin: jpmml/jpmml-evaluator

if(localTransformations != null && localTransformations.hasDerivedFields()){
  this.localDerivedFields = CacheUtil.getValue(localTransformations, ModelEvaluator.localDerivedFieldCache);
origin: org.jpmml/pmml-model

/**
 * Create an instance of {@link LocalTransformations }
 * 
 */
public LocalTransformations createLocalTransformations() {
  return new LocalTransformations();
}
origin: org.jpmml/pmml-model

@Override
public LocalTransformations addExtensions(Extension... extensions) {
  getExtensions().addAll(Arrays.asList(extensions));
  return this;
}
origin: jpmml/jpmml-model

private void processLocalTransformations(LocalTransformations localTransformations){
  if(localTransformations.hasDerivedFields()){
    List<DerivedField> derivedFields = localTransformations.getDerivedFields();
    Set<DerivedField> activeDerivedFields = getActiveDerivedFields(new HashSet<>(derivedFields));
    derivedFields.retainAll(activeDerivedFields);
  }
}
origin: ShifuML/shifu

public static Map<FieldName, DerivedField> getDerivedFieldMap(LocalTransformations localTransformations) {
  Map<FieldName, DerivedField> derivedFieldMap = new HashMap<FieldName, DerivedField>();
  for(DerivedField derivedField: localTransformations.getDerivedFields()) {
    derivedFieldMap.put(derivedField.getName(), derivedField);
  }
  return derivedFieldMap;
}
origin: org.jpmml/pmml-model

private void processLocalTransformations(LocalTransformations localTransformations){
  if(localTransformations.hasDerivedFields()){
    List<DerivedField> derivedFields = localTransformations.getDerivedFields();
    Set<DerivedField> activeDerivedFields = getActiveDerivedFields(new HashSet<>(derivedFields));
    derivedFields.retainAll(activeDerivedFields);
  }
}
origin: ShifuML/shifu

public static Map<FieldName, DerivedField> getDerivedFieldMap(LocalTransformations localTransformations) {
  Map<FieldName, DerivedField> derivedFieldMap = new HashMap<FieldName, DerivedField>();
  for(DerivedField derivedField: localTransformations.getDerivedFields()) {
    derivedFieldMap.put(derivedField.getName(), derivedField);
  }
  return derivedFieldMap;
}
org.dmg.pmmlLocalTransformations

Most used methods

  • getDerivedFields
  • <init>
  • hasDerivedFields
  • getExtensions
  • hasExtensions
  • withDerivedFields

Popular in Java

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (Timer)
  • getExternalFilesDir (Context)
  • requestLocationUpdates (LocationManager)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • ImageIO (javax.imageio)
  • Join (org.hibernate.mapping)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now