Tabnine Logo
CategoricalRegressionFunction
Code IndexAdd Tabnine to your IDE (free)

How to use
CategoricalRegressionFunction
in
cascading.pattern.model.generalregression

Best Java code snippets using cascading.pattern.model.generalregression.CategoricalRegressionFunction (Showing top 2 results out of 315)

origin: cascading/pattern-core

@Override
public void operate( FlowProcess flowProcess, FunctionCall<Context<BaseRegressionFunction.ExpressionContext>> functionCall )
 {
 TupleEntry arguments = functionCall.getArguments();
 ExpressionEvaluator[] expressions = functionCall.getContext().payload.expressions;
 double[] results = functionCall.getContext().payload.results;
 for( int i = 0; i < expressions.length; i++ )
  results[ i ] = expressions[ i ].calculate( arguments );
 LOG.debug( "raw regression: {}", results );
 for( int i = 0; i < expressions.length; i++ )
  results[ i ] = getSpec().getLinkFunction().calculate( results[ i ] );
 LOG.debug( "link regression: {}", results );
 results = getSpec().getNormalization().normalize( results );
 LOG.debug( "probabilities: {}", results );
 double max = Doubles.max( results );
 int index = Doubles.indexOf( results, max );
 String category = expressions[ index ].getTargetCategory();
 LOG.debug( "category: {}", category );
 if( !getSpec().getModelSchema().isIncludePredictedCategories() )
  {
  functionCall.getOutputCollector().add( functionCall.getContext().result( category ) );
  return;
  }
 Tuple result = functionCall.getContext().tuple;
 result.set( 0, category );
 for( int i = 0; i < results.length; i++ )
  result.set( i + 1, results[ i ] );
 functionCall.getOutputCollector().add( result );
 }
}
origin: cascading/pattern-core

CategoricalRegressionFunction regressionFunction = new CategoricalRegressionFunction( regressionSpec );
cascading.pattern.model.generalregressionCategoricalRegressionFunction

Javadoc

Class CategoricalRegressionFunction will return a classification or category with the greatest probability as determined by the set of RegressionTables added to the GeneralRegressionSpec.

Most used methods

  • <init>
  • getSpec

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • getContentResolver (Context)
  • Permission (java.security)
    Legacy security code; do not use.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • CodeWhisperer alternatives
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