Codota Logo
Feature.getName
Code IndexAdd Codota to your IDE (free)

How to use
getName
method
in
org.jpmml.converter.Feature

Best Java code snippets using org.jpmml.converter.Feature.getName (Showing top 20 results out of 315)

  • Common ways to obtain Feature
private void myMethod () {
Feature f =
  • Codota IconSchema schema;schema.getFeature(int1)
  • Smart code suggestions by Codota
}
origin: jpmml/jpmml-r

static
private String formatHingeFunction(int dir, Feature feature, double cut){
  switch(dir){
    case -1:
      return ("h(" + cut + " - " + (feature.getName()).getValue() + ")");
    case 1:
      return ("h(" + (feature.getName()).getValue() + " - " + cut + ")");
    default:
      throw new IllegalArgumentException();
  }
}
origin: jpmml/jpmml-sparkml

public void putFeatures(String column, List<Feature> features){
  List<Feature> existingFeatures = this.columnFeatures.get(column);
  if(existingFeatures != null && existingFeatures.size() > 0){
    if(features.size() != existingFeatures.size()){
      throw new IllegalArgumentException("Expected " + existingFeatures.size() + " features, got " + features.size() + " features");
    }
    for(int i = 0; i < existingFeatures.size(); i++){
      Feature existingFeature = existingFeatures.get(i);
      Feature feature = features.get(i);
      if(!(feature.getName()).equals(existingFeature.getName())){
        throw new IllegalArgumentException();
      }
    }
  }
  this.columnFeatures.put(column, features);
}
origin: jpmml/jpmml-sklearn

@Override
protected List<String> formatColumns(List<Feature> features){
  List<String> result = new ArrayList<>();
  for(Feature feature : features){
    FieldName name = feature.getName();
    result.add("data:" + XMLUtil.createTagName(name.getValue()));
  }
  if(result.contains("data:output")){
    throw new IllegalArgumentException();
  }
  result.add("data:output");
  return result;
}
origin: jpmml/jpmml-r

public Double getCoefficient(Feature feature, RDoubleVector coefficients){
  FieldName name = feature.getName();
  if(feature instanceof HasDerivedName){
    BiMap<Feature, FieldName> inverseFeatures = this.features.inverse();
    name = inverseFeatures.get(feature);
  }
  return coefficients.getValue(name.getValue());
}
origin: jpmml/jpmml-sklearn

public void renameFeature(Feature feature, FieldName renamedName){
  FieldName name = feature.getName();
  DerivedField derivedField = removeDerivedField(name);
  try {
    Field field = Feature.class.getDeclaredField("name");
    if(!field.isAccessible()){
      field.setAccessible(true);
    }
    field.set(feature, renamedName);
  } catch(ReflectiveOperationException roe){
    throw new RuntimeException(roe);
  }
  derivedField.setName(renamedName);
  addDerivedField(derivedField);
}
origin: jpmml/jpmml-sklearn

public Feature getFeature(FieldName name){
  List<? extends Feature> features = getFeatures();
  for(Feature feature : features){
    if((feature.getName()).equals(name)){
      return feature;
    }
  }
  throw new IllegalArgumentException(name.getValue());
}
origin: jpmml/jpmml-sklearn

@Override
public List<Feature> encodeFeatures(List<Feature> features, SkLearnEncoder encoder){
  List<?> classes = getClasses();
  ClassDictUtil.checkSize(1, features);
  Feature feature = features.get(0);
  List<String> inputCategories = new ArrayList<>();
  List<String> outputCategories = new ArrayList<>();
  for(int i = 0; i < classes.size(); i++){
    inputCategories.add(ValueUtil.formatValue(classes.get(i)));
    outputCategories.add(ValueUtil.formatValue(i));
  }
  Supplier<MapValues> mapValuesSupplier = () -> {
    encoder.toCategorical(feature.getName(), inputCategories);
    return PMMLUtil.createMapValues(feature.getName(), inputCategories, outputCategories);
  };
  DerivedField derivedField = encoder.ensureDerivedField(FeatureUtil.createName("label_encoder", feature), OpType.CATEGORICAL, DataType.INTEGER, mapValuesSupplier);
  Feature encodedFeature = new CategoricalFeature(encoder, derivedField, outputCategories);
  Feature result = new CategoricalFeature(encoder, feature, inputCategories){
    @Override
    public ContinuousFeature toContinuousFeature(){
      return encodedFeature.toContinuousFeature();
    }
  };
  return Collections.singletonList(result);
}
origin: jpmml/jpmml-sparkml

encoder.toCategorical(feature.getName(), categories);
MapValues mapValues = PMMLUtil.createMapValues(feature.getName(), categories, values);
origin: jpmml/jpmml-sklearn

String inputColumn = inputColumns.get(i);
mapValues.addFieldColumnPairs(new FieldColumnPair(feature.getName(), inputColumn));
origin: org.jpmml/jpmml-h2o

  static
  public Feature encodeFeature(Feature feature, Object replacementValue, MissingValueTreatmentMethod missingValueTreatmentMethod){
    ModelEncoder encoder = (ModelEncoder)feature.getEncoder();

    Field<?> field = feature.getField();

    if(field instanceof DataField){
      MissingValueDecorator missingValueDecorator = new MissingValueDecorator()
        .setMissingValueReplacement(ValueUtil.formatValue(replacementValue))
        .setMissingValueTreatment(missingValueTreatmentMethod);

      encoder.addDecorator(feature.getName(), missingValueDecorator);

      return feature;
    } else

    {
      throw new IllegalArgumentException();
    }
  }
}
origin: jpmml/jpmml-lightgbm

  .setImportance(importance);
encoder.addDecorator(feature.getName(), importanceDecorator);
origin: jpmml/jpmml-sklearn

encoder.toCategorical(feature.getName(), categories);
origin: jpmml/jpmml-sparkml

Field<?> field = encoder.getField(feature.getName());
  encoder.addDecorator(feature.getName(), missingValueDecorator);
} else
origin: jpmml/jpmml-sklearn

@Override
public List<Feature> encodeFeatures(List<Feature> features, SkLearnEncoder encoder){
  String function = getFunction();
  Boolean trimBlanks = getTrimBlanks();
  if(function == null && !trimBlanks){
    return features;
  }
  List<Feature> result = new ArrayList<>();
  for(Feature feature : features){
    Expression expression = feature.ref();
    if(function != null){
      expression = PMMLUtil.createApply(function, expression);
    } // End if
    if(trimBlanks){
      expression = PMMLUtil.createApply("trimBlanks", expression);
    }
    Field<?> field = encoder.toCategorical(feature.getName(), Collections.emptyList());
    // XXX: Should have been set by the previous transformer
    field.setDataType(DataType.STRING);
    DerivedField derivedField = encoder.createDerivedField(FeatureUtil.createName("normalize", feature), OpType.CATEGORICAL, DataType.STRING, expression);
    feature = new StringFeature(encoder, derivedField);
    result.add(feature);
  }
  return result;
}
origin: cheng-li/pyramid

static
private Predicate encodePredicate(Feature feature, Node node, boolean left){
  FieldName name = feature.getName();
  SimplePredicate.Operator operator;
  String value;
origin: jpmml/jpmml-sklearn

FieldName name = h2oFeature.getName();
origin: jpmml/jpmml-sklearn

return feature.getName();
origin: jpmml/jpmml-r

FieldName name = feature.getName();
origin: jpmml/jpmml-sklearn

FieldName name = feature.getName();
origin: jpmml/jpmml-sklearn

encoder.addDecorator(feature.getName(), missingValueDecorator);
org.jpmml.converterFeaturegetName

Popular methods of Feature

  • toContinuousFeature
  • getField
  • ref
  • getDataType
  • getEncoder
  • equals
  • hashCode
  • toStringHelper

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • requestLocationUpdates (LocationManager)
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • Menu (java.awt)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
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