Package cascading.pattern.model.tree

Examples of cascading.pattern.model.tree.TreeSpec


    {
    ModelSchema modelSchema = createModelSchema( model );

    Tree tree = createTree( model, modelSchema );

    TreeSpec treeSpec = new TreeSpec( modelSchema, tree );

    return create( tail, modelSchema, new TreeFunction( treeSpec ) );
    }
View Full Code Here


        throw new PatternException( "segment predicates currently not supported, got: " + segment.getPredicate() );

      Model segmentModel = segment.getModel();

      if( segmentModel instanceof TreeModel )
        models.add( new TreeSpec( modelSchema, createTree( (TreeModel) segmentModel, modelSchema ) ) );
      else
        throw new PatternException( "ensemble model currently not supported, got: " + segmentModel );
      }

    EnsembleSpec<TreeSpec> miningSpec = new EnsembleSpec<TreeSpec>( modelSchema, models );
View Full Code Here

    EnsembleSpec<TreeSpec> ensembleSpec = new EnsembleSpec<TreeSpec>( modelSchema );

    ensembleSpec.setSelectionStrategy( new MajorityVote() );

    {
    TreeSpec treeSpec = new TreeSpec( modelSchema );

    Tree tree = new Tree( "1" );

    tree.addPredicate( "1", "2", new LessOrEqualThanPredicate( "var0", 0.5d ) );
    tree.addPredicate( "2", "4", new LessOrEqualThanPredicate( "var2", 0.5d ), "1" );
    tree.addPredicate( "2", "5", new GreaterThanPredicate( "var2", 0.5d ), "0" );
    tree.addPredicate( "1", "3", new GreaterThanPredicate( "var0", 0.5d ) );
    tree.addPredicate( "3", "6", new LessOrEqualThanPredicate( "var1", 0.5d ), "0" );
    tree.addPredicate( "3", "7", new GreaterThanPredicate( "var1", 0.5d ), "1" );

    treeSpec.setTree( tree );

    ensembleSpec.addModelSpec( treeSpec );
    }

    {
    TreeSpec treeSpec = new TreeSpec( modelSchema );

    Tree tree = new Tree( "1" );

    tree.addPredicate( "1", "2", new LessOrEqualThanPredicate( "var1", 0.5d ), "1" );
    tree.addPredicate( "1", "3", new GreaterThanPredicate( "var1", 0.5d ), "0" );

    treeSpec.setTree( tree );

    ensembleSpec.addModelSpec( treeSpec );
    }

    {
    TreeSpec treeSpec = new TreeSpec( modelSchema );

    Tree tree = new Tree( "1" );

    tree.addPredicate( "1", "2", new LessOrEqualThanPredicate( "var0", 0.5d ), "1" );
    tree.addPredicate( "1", "3", new GreaterThanPredicate( "var0", 0.5d ), "0" );

    treeSpec.setTree( tree );

    ensembleSpec.addModelSpec( treeSpec );
    }

    String inputData = "randomforest.tsv";
View Full Code Here

    EnsembleSpec<TreeSpec> ensembleSpec = new EnsembleSpec<TreeSpec>( modelSchema );

    ensembleSpec.setSelectionStrategy( new Average() );

    {
    TreeSpec treeSpec = new TreeSpec( modelSchema );

    Tree tree = new Tree( "1" );

    tree.addPredicate( "1", "2", new LessOrEqualThanPredicate( "var0", 0.5d ) );
    tree.addPredicate( "2", "4", new LessOrEqualThanPredicate( "var2", 0.5d ), 1 );
    tree.addPredicate( "2", "5", new GreaterThanPredicate( "var2", 0.5d ), 0 );
    tree.addPredicate( "1", "3", new GreaterThanPredicate( "var0", 0.5d ) );
    tree.addPredicate( "3", "6", new LessOrEqualThanPredicate( "var1", 0.5d ), 0 );
    tree.addPredicate( "3", "7", new GreaterThanPredicate( "var1", 0.5d ), 1 );

    treeSpec.setTree( tree );

    ensembleSpec.addModelSpec( treeSpec );
    }

    {
    TreeSpec treeSpec = new TreeSpec( modelSchema );

    Tree tree = new Tree( "1" );

    tree.addPredicate( "1", "2", new LessOrEqualThanPredicate( "var1", 0.5d ), 1 );
    tree.addPredicate( "1", "3", new GreaterThanPredicate( "var1", 0.5d ), 0 );

    treeSpec.setTree( tree );

    ensembleSpec.addModelSpec( treeSpec );
    }

    {
    TreeSpec treeSpec = new TreeSpec( modelSchema );

    Tree tree = new Tree( "1" );

    tree.addPredicate( "1", "2", new LessOrEqualThanPredicate( "var0", 0.5d ), 1 );
    tree.addPredicate( "1", "3", new GreaterThanPredicate( "var0", 0.5d ), 0 );

    treeSpec.setTree( tree );

    ensembleSpec.addModelSpec( treeSpec );
    }

    String inputData = "randomforest-predict.tsv";
View Full Code Here

      .append( new Fields( "var1", double.class ) )
      .append( new Fields( "var2", double.class ) );

    ModelSchema modelSchema = new ModelSchema( expectedFields, predictedFields );

    TreeSpec treeSpec = new TreeSpec( modelSchema );

    Tree tree = new Tree( "1" );

    tree.addPredicate( "1", "2", new LessOrEqualThanPredicate( "var0", 0.5d ) );
    tree.addPredicate( "2", "4", new LessOrEqualThanPredicate( "var2", 0.5d ), "1" );
    tree.addPredicate( "2", "5", new GreaterThanPredicate( "var2", 0.5d ), "0" );
    tree.addPredicate( "1", "3", new GreaterThanPredicate( "var0", 0.5d ) );
    tree.addPredicate( "3", "6", new LessOrEqualThanPredicate( "var1", 0.5d ), "0" );
    tree.addPredicate( "3", "7", new GreaterThanPredicate( "var1", 0.5d ), "1" );

    treeSpec.setTree( tree );

    TreeFunction treeFunction = new TreeFunction( treeSpec );

    TupleEntry tupleArguments = new TupleEntry( expectedFields, new Tuple( 0d, 1d, 0d ) );
View Full Code Here

TOP

Related Classes of cascading.pattern.model.tree.TreeSpec

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.