Package cascading.pattern.model.generalregression

Examples of cascading.pattern.model.generalregression.Parameter


    String targetCategory = regressionTable.getTargetCategory();

    if( targetCategory != null )
      generalRegressionTable.setTargetCategory( targetCategory );

    generalRegressionTable.addParameter( new Parameter( "intercept", regressionTable.getIntercept() ) );

    int count = 0;

    for( CategoricalPredictor predictor : regressionTable.getCategoricalPredictors() )
      {
      String name = predictor.getName().getValue();
      String value = predictor.getValue();
      double coefficient = predictor.getCoefficient();

      generalRegressionTable.addParameter( new Parameter( "f" + count++, coefficient, new FactorPredictor( name, value ) ) );
      }

    for( NumericPredictor predictor : regressionTable.getNumericPredictors() )
      {
      String name = predictor.getName().getValue();
      int exponent = predictor.getExponent();

      double coefficient = predictor.getCoefficient();

      generalRegressionTable.addParameter( new Parameter( "f" + count++, coefficient, new CovariantPredictor( name, exponent ) ) );
      }

    return generalRegressionTable;
    }
View Full Code Here


    regressionSpec.setLinkFunction( LinkFunction.LOGIT );

    RegressionTable table = new RegressionTable();

    table.addParameter( new Parameter( "p0", -16.9456960387809d ) );
    table.addParameter( new Parameter( "p1", 11.7592159418536d, new CovariantPredictor( "sepal_length" ) ) );
    table.addParameter( new Parameter( "p2", 7.84157781514097d, new CovariantPredictor( "sepal_width" ) ) );
    table.addParameter( new Parameter( "p3", -20.0880078273996d, new CovariantPredictor( "petal_length" ) ) );
    table.addParameter( new Parameter( "p4", -21.6076488529538d, new CovariantPredictor( "petal_width" ) ) );

    regressionSpec.addRegressionTable( table );

    PredictionRegressionFunction regressionFunction = new PredictionRegressionFunction( regressionSpec );
View Full Code Here

    GeneralRegressionSpec regressionSpec = new GeneralRegressionSpec( modelSchema );

    RegressionTable regressionTable = new RegressionTable();

    regressionTable.addParameter( new Parameter( "intercept", 2.24166872421148d ) );

    regressionTable.addParameter( new Parameter( "p1", 0.53448203205212d, new CovariantPredictor( "sepal_width" ) ) );
    regressionTable.addParameter( new Parameter( "p2", 0.691035562908626d, new CovariantPredictor( "petal_length" ) ) );
    regressionTable.addParameter( new Parameter( "p3", -0.21488157609202d, new CovariantPredictor( "petal_width" ) ) );

    regressionTable.addParameter( new Parameter( "p4", 0d, new FactorPredictor( "species", "setosa" ) ) );
    regressionTable.addParameter( new Parameter( "p5", -0.43150751368126d, new FactorPredictor( "species", "versicolor" ) ) );
    regressionTable.addParameter( new Parameter( "p6", -0.61868924203063d, new FactorPredictor( "species", "virginica" ) ) );

    regressionSpec.addRegressionTable( regressionTable );

    PredictionRegressionFunction regressionFunction = new PredictionRegressionFunction( regressionSpec );
View Full Code Here

    regressionSpec.setNormalization( new SoftMaxNormalization() );

    {
    RegressionTable regressionTable = new RegressionTable( "versicolor" );

    regressionTable.addParameter( new Parameter( "intercept", 86.7061379450354d ) );
    regressionTable.addParameter( new Parameter( "p0", -11.3336819785783d, new CovariantPredictor( "sepal_length" ) ) );
    regressionTable.addParameter( new Parameter( "p1", -40.8601511206805d, new CovariantPredictor( "sepal_width" ) ) );
    regressionTable.addParameter( new Parameter( "p2", 38.439099544679d, new CovariantPredictor( "petal_length" ) ) );
    regressionTable.addParameter( new Parameter( "p3", -12.2920287460217d, new CovariantPredictor( "petal_width" ) ) );

    regressionSpec.addRegressionTable( regressionTable );
    }

    {
    RegressionTable regressionTable = new RegressionTable( "virginica" );

    regressionTable.addParameter( new Parameter( "intercept", -111.666532867146d ) );
    regressionTable.addParameter( new Parameter( "p0", -47.1170644419116d, new CovariantPredictor( "sepal_length" ) ) );
    regressionTable.addParameter( new Parameter( "p1", -51.6805606658275d, new CovariantPredictor( "sepal_width" ) ) );
    regressionTable.addParameter( new Parameter( "p2", 108.27736751831d, new CovariantPredictor( "petal_length" ) ) );
    regressionTable.addParameter( new Parameter( "p3", 54.0277175236148d, new CovariantPredictor( "petal_width" ) ) );

    regressionSpec.addRegressionTable( regressionTable );
    }

    {
    RegressionTable regressionTable = new RegressionTable( "setosa" );

    regressionTable.addParameter( new Parameter( "intercept", 0d ) );

    regressionSpec.addRegressionTable( regressionTable );
    }

    CategoricalRegressionFunction regressionFunction = new CategoricalRegressionFunction( regressionSpec );
View Full Code Here

TOP

Related Classes of cascading.pattern.model.generalregression.Parameter

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.