congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
MiningSegmentTransfer.addResultToRequestMapping
Code IndexAdd Tabnine to your IDE (free)

How to use
addResultToRequestMapping
method
in
org.kie.pmml.pmml_4_2.model.mining.MiningSegmentTransfer

Best Java code snippets using org.kie.pmml.pmml_4_2.model.mining.MiningSegmentTransfer.addResultToRequestMapping (Showing top 3 results out of 315)

origin: org.drools/kie-pmml

public MiningSegmentTransfer getSegmentTransfer( MiningSegment targetSegment, String targetFieldName) {
  MiningSegmentTransfer xfer = null;
  int lastIndex = targetSegment.getSegmentIndex() - 1;
  if (lastIndex < 0) {
    throw new IndexOutOfBoundsException("Cannot have an undefined mining field in the first segment");
  }
  for (int idx = lastIndex; idx >= 0; idx--) {
    MiningSegment seg = miningSegments.get(idx);
    if (seg != null && seg.getInternalModel() != null) {
      List<PMMLOutputField> outputs = seg.getInternalModel().getOutputFields();
      if (outputs != null) {
        for (PMMLOutputField field: outputs) {
          if (field.getName().equals(targetFieldName)) {
            xfer = new MiningSegmentTransfer(this.segmentationId, seg.getSegmentId(), targetSegment.getSegmentId());
            xfer.addResultToRequestMapping(targetFieldName, targetFieldName);
            return xfer;
          }
        }
      }
    }
  }
  return xfer;
}
origin: org.drools/kie-pmml

@Test
public void testSimpleWithFieldNamesMap() {
  MiningSegmentTransfer mst = new MiningSegmentTransfer(simpleResult,"SEGMENT_2");
  mst.addResultToRequestMapping("var1", "someVarA");
  doBaselineAssertions(simpleResult,mst);
  assertEquals(1,mst.getResultFieldNameToRequestFieldName().size());
}

origin: org.drools/kie-pmml

  @Test
  public void testComplexResult() {
    MiningSegmentTransfer mst = new MiningSegmentTransfer(complexResult,"SEGMENT_2");
    mst.addResultToRequestMapping("firstObject", "object1");
    mst.addResultToRequestMapping("myComplex.varA", "stringFromMyComplex");
    mst.addResultToRequestMapping("myComplex.varB", "intValue");
    doBaselineAssertions(complexResult,mst);
    assertEquals(3,mst.getResultFieldNameToRequestFieldName().size());
    PMMLRequestData rqst = mst.getOutboundRequest();
    assertNotNull(rqst);
    assertEquals(complexResult.getCorrelationId(),rqst.getCorrelationId());
    Map<String,ParameterInfo> params = rqst.getMappedRequestParams();
    assertEquals(complexResult.getResultValue("firstObject", null), params.get("object1").getValue());
    assertEquals(complexResult.getResultValue("myComplex", "varA"), params.get("stringFromMyComplex").getValue());
    assertEquals(complexResult.getResultValue("myComplex", "varB"), params.get("intValue").getValue());
    System.out.println(rqst);
    System.out.println(complexResult);
  }
}
org.kie.pmml.pmml_4_2.model.miningMiningSegmentTransferaddResultToRequestMapping

Popular methods of MiningSegmentTransfer

  • <init>
  • getOutboundRequest
  • getCorrelationId
  • getFromSegmentId
  • getResultFieldNameToRequestFieldName
  • getSegmentationId
  • getToSegmentId
  • getValueFromResult

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • ImageIO (javax.imageio)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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