if ( o instanceof TreeModel ) { TreeModel tree = (TreeModel) o; tree.setMissingValueStrategy( MISSINGVALUESTRATEGY.NULL_PREDICTION );
@Test public void testMissingTreeDefault() throws Exception { PMML4Compiler compiler = new PMML4Compiler(); PMML pmml = compiler.loadModel( PMML, ResourceFactory.newClassPathResource( source2 ).getInputStream() ); for ( Object o : pmml.getAssociationModelsAndBaselineModelsAndClusteringModels() ) { if ( o instanceof TreeModel ) { TreeModel tree = (TreeModel) o; tree.setMissingValueStrategy( MISSINGVALUESTRATEGY.DEFAULT_CHILD ); } } KieSession kSession = getSession( compiler.generateTheory( pmml ) ); setKSession( kSession ); setKbase( getKSession().getKieBase() ); kSession.fireAllRules(); //init model FactType tgt = kSession.getKieBase().getFactType( packageName, "Fld9" ); FactType tok = kSession.getKieBase().getFactType( PMML4Helper.pmmlDefaultPackageName(), "TreeToken" ); kSession.getEntryPoint( "in_Fld1" ).insert( 70.0 ); kSession.getEntryPoint( "in_Fld2" ).insert( 40.0 ); kSession.getEntryPoint( "in_Fld3" ).insert( "miss" ); kSession.fireAllRules(); Object token = getToken( kSession ); assertEquals( 0.72, (Double) tok.get( token, "confidence" ), 1e-6 ); assertEquals( "null", tok.get( token, "current" ) ); assertEquals( 40.0, tok.get( token, "totalCount" ) ); checkFirstDataFieldOfTypeStatus(tgt, true, false, "Missing", "tgtX" ); checkGeneratedRules(); }
if ( o instanceof TreeModel ) { TreeModel tree = (TreeModel) o; tree.setMissingValueStrategy( MISSINGVALUESTRATEGY.DEFAULT_CHILD );
if ( o instanceof TreeModel ) { TreeModel tree = (TreeModel) o; tree.setMissingValueStrategy( MISSINGVALUESTRATEGY.NONE );
if ( o instanceof TreeModel ) { TreeModel tree = (TreeModel) o; tree.setMissingValueStrategy( MISSINGVALUESTRATEGY.LAST_PREDICTION );
if ( o instanceof TreeModel ) { TreeModel tree = (TreeModel) o; tree.setMissingValueStrategy( MISSINGVALUESTRATEGY.AGGREGATE_NODES );