Tabnine Logo
ModelUtil.createProbabilityOutput
Code IndexAdd Tabnine to your IDE (free)

How to use
createProbabilityOutput
method
in
org.jpmml.converter.ModelUtil

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

origin: jpmml/jpmml-sklearn

@Override
public MiningModel encodeModel(Schema schema){
  MiningModel miningModel = ForestUtil.encodeBaseForest(this, Segmentation.MultipleModelMethod.AVERAGE, MiningFunction.CLASSIFICATION, schema)
    .setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, (CategoricalLabel)schema.getLabel()));
  return miningModel;
}
origin: jpmml/jpmml-sklearn

@Override
public TreeModel encodeModel(Schema schema){
  TreeModel treeModel = TreeModelUtil.encodeTreeModel(this, MiningFunction.CLASSIFICATION, schema)
    .setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, (CategoricalLabel)schema.getLabel()));
  return TreeModelUtil.transform(this, treeModel);
}
origin: org.jpmml/jpmml-h2o

.setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, categoricalLabel));
origin: cheng-li/pyramid

.setNormalizationMethod(normalizationMethod)
.setMathContext(ModelUtil.simplifyMathContext(mathContext))
.setOutput(hasProbabilityDistribution ? ModelUtil.createProbabilityOutput(mathContext, categoricalLabel) : null);
origin: jpmml/jpmml-sklearn

@Override
public NeuralNetwork encodeModel(Schema schema){
  String activation = getActivation();
  List<? extends HasArray> coefs = getCoefs();
  List<? extends HasArray> intercepts = getIntercepts();
  NeuralNetwork neuralNetwork = MultilayerPerceptronUtil.encodeNeuralNetwork(MiningFunction.CLASSIFICATION, activation, coefs, intercepts, schema)
    .setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, (CategoricalLabel)schema.getLabel()));
  return neuralNetwork;
}
origin: jpmml/jpmml-sklearn

@Override
public Model encodeModel(Schema schema){
  List<? extends Classifier> estimators = getEstimators();
  List<? extends Number> weights = getWeights();
  CategoricalLabel categoricalLabel = (CategoricalLabel)schema.getLabel();
  List<Model> models = new ArrayList<>();
  for(Classifier estimator : estimators){
    Model model = estimator.encodeModel(schema);
    models.add(model);
  }
  String voting = getVoting();
  Segmentation.MultipleModelMethod multipleModelMethod = parseVoting(voting, (weights != null && weights.size() > 0));
  MiningModel miningModel = new MiningModel(MiningFunction.CLASSIFICATION, ModelUtil.createMiningSchema(categoricalLabel))
    .setSegmentation(MiningModelUtil.createSegmentation(multipleModelMethod, models, weights))
    .setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, categoricalLabel));
  return miningModel;
}
origin: jpmml/jpmml-sklearn

.setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, categoricalLabel));
origin: jpmml/jpmml-sklearn

@Override
public MiningModel encodeModel(Schema schema){
  List<? extends Classifier> estimators = getEstimators();
  List<List<Integer>> estimatorsFeatures = getEstimatorsFeatures();
  Segmentation.MultipleModelMethod multipleModelMethod = Segmentation.MultipleModelMethod.AVERAGE;
  for(Classifier estimator : estimators){
    if(!estimator.hasProbabilityDistribution()){
      multipleModelMethod = Segmentation.MultipleModelMethod.MAJORITY_VOTE;
      break;
    }
  }
  MiningModel miningModel = BaggingUtil.encodeBagging(estimators, estimatorsFeatures, multipleModelMethod, MiningFunction.CLASSIFICATION, schema)
    .setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, (CategoricalLabel)schema.getLabel()));
  return miningModel;
}
origin: jpmml/jpmml-r

.setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, categoricalLabel));
origin: jpmml/jpmml-r

@Override
public TreeModel encodeModel(Schema schema){
  S4Object binaryTree = getObject();
  RGenericVector tree = (RGenericVector)binaryTree.getAttributeValue("tree");
  Output output;
  switch(this.miningFunction){
    case REGRESSION:
      output = new Output();
      break;
    case CLASSIFICATION:
      CategoricalLabel categoricalLabel = (CategoricalLabel)schema.getLabel();
      output = ModelUtil.createProbabilityOutput(DataType.DOUBLE, categoricalLabel);
      break;
    default:
      throw new IllegalArgumentException();
  }
  output.addOutputFields(ModelUtil.createEntityIdField(FieldName.create("nodeId")));
  TreeModel treeModel = encodeTreeModel(tree, schema)
    .setOutput(output);
  return treeModel;
}
origin: jpmml/jpmml-r

.setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, categoricalLabel));
origin: jpmml/jpmml-r

  @Override
  public Model encodeModel(Schema schema){
    RGenericVector bagging = getObject();

    RGenericVector trees = (RGenericVector)bagging.getValue("trees");

    CategoricalLabel categoricalLabel = (CategoricalLabel)schema.getLabel();

    List<TreeModel> treeModels = encodeTreeModels(trees);

    MiningModel miningModel = new MiningModel(MiningFunction.CLASSIFICATION, ModelUtil.createMiningSchema(categoricalLabel))
      .setSegmentation(MiningModelUtil.createSegmentation(Segmentation.MultipleModelMethod.MAJORITY_VOTE, treeModels))
      .setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, categoricalLabel));

    return miningModel;
  }
}
origin: jpmml/jpmml-sklearn

.setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, categoricalLabel));
.setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, categoricalLabel));
origin: jpmml/jpmml-r

  @Override
  public Model encodeModel(Schema schema){
    RGenericVector boosting = getObject();

    RGenericVector trees = (RGenericVector)boosting.getValue("trees");
    RDoubleVector weights = (RDoubleVector)boosting.getValue("weights");

    CategoricalLabel categoricalLabel = (CategoricalLabel)schema.getLabel();

    List<TreeModel> treeModels = encodeTreeModels(trees);

    MiningModel miningModel = new MiningModel(MiningFunction.CLASSIFICATION, ModelUtil.createMiningSchema(categoricalLabel))
      .setSegmentation(MiningModelUtil.createSegmentation(Segmentation.MultipleModelMethod.WEIGHTED_MAJORITY_VOTE, treeModels, weights.getValues()))
      .setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, categoricalLabel));

    return miningModel;
  }
}
origin: jpmml/jpmml-r

RegressionModel regressionModel = new RegressionModel(MiningFunction.CLASSIFICATION, ModelUtil.createMiningSchema(categoricalLabel), null)
  .setNormalizationMethod(RegressionModel.NormalizationMethod.SOFTMAX)
  .setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, categoricalLabel));
origin: jpmml/jpmml-r

.setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, categoricalLabel));
origin: jpmml/jpmml-r

@Override
public Model encodeModel(Schema schema){
  RGenericVector party = getObject();
  RGenericVector partyNode = (RGenericVector)party.getValue("node");
  RGenericVector predicted = (RGenericVector)DecorationUtil.getValue(party, "predicted");
  RVector<?> response = (RVector<?>)predicted.getValue("(response)");
  RDoubleVector prob = (RDoubleVector)predicted.getValue("(prob)", true);
  Node root = encodeNode(new True(), partyNode, response, prob, schema);
  TreeModel treeModel;
  if(RExpUtil.isFactor(response)){
    CategoricalLabel categoricalLabel = (CategoricalLabel)schema.getLabel();
    treeModel = new TreeModel(MiningFunction.CLASSIFICATION, ModelUtil.createMiningSchema(categoricalLabel), root)
      .setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, categoricalLabel));
  } else
  {
    treeModel = new TreeModel(MiningFunction.REGRESSION, ModelUtil.createMiningSchema(schema.getLabel()), root);
  }
  return treeModel;
}
origin: jpmml/jpmml-r

  generalRegressionModel.setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, (CategoricalLabel)label));
  break;
default:
origin: jpmml/jpmml-r

.setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, categoricalLabel));
origin: jpmml/jpmml-sklearn

@Override
public NaiveBayesModel encodeModel(Schema schema){
  int[] shape = getThetaShape();
  int numberOfClasses = shape[0];
  int numberOfFeatures = shape[1];
  List<? extends Number> theta = getTheta();
  List<? extends Number> sigma = getSigma();
  CategoricalLabel categoricalLabel = (CategoricalLabel)schema.getLabel();
  BayesInputs bayesInputs = new BayesInputs();
  for(int i = 0; i < numberOfFeatures; i++){
    Feature feature = schema.getFeature(i);
    List<? extends Number> means = CMatrixUtil.getColumn(theta, numberOfClasses, numberOfFeatures, i);
    List<? extends Number> variances = CMatrixUtil.getColumn(sigma, numberOfClasses, numberOfFeatures, i);
    ContinuousFeature continuousFeature = feature.toContinuousFeature();
    BayesInput bayesInput = new BayesInput(continuousFeature.getName())
      .setTargetValueStats(encodeTargetValueStats(categoricalLabel.getValues(), means, variances));
    bayesInputs.addBayesInputs(bayesInput);
  }
  List<Integer> classCount = getClassCount();
  BayesOutput bayesOutput = new BayesOutput(categoricalLabel.getName(), null)
    .setTargetValueCounts(encodeTargetValueCounts(categoricalLabel.getValues(), classCount));
  NaiveBayesModel naiveBayesModel = new NaiveBayesModel(0d, MiningFunction.CLASSIFICATION, ModelUtil.createMiningSchema(categoricalLabel), bayesInputs, bayesOutput)
    .setOutput(ModelUtil.createProbabilityOutput(DataType.DOUBLE, categoricalLabel));
  return naiveBayesModel;
}
org.jpmml.converterModelUtilcreateProbabilityOutput

Popular methods of ModelUtil

  • createMiningSchema
  • createPredictedOutput
  • createRescaleTargets
  • createPredictedField
  • createProbabilityField
  • createModelVerification
  • createVerificationField
  • ensureOutput
  • createEntityIdField
  • createProbabilityFields
  • simplifyMathContext
  • simplifyMathContext

Popular in Java

  • Making http requests using okhttp
  • onCreateOptionsMenu (Activity)
  • getSharedPreferences (Context)
  • setScale (BigDecimal)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now