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

How to use
PearsonDistance
in
cascading.assembly

Best Java code snippets using cascading.assembly.PearsonDistance (Showing top 2 results out of 315)

origin: cwensel/cascading

@Test
public void testPearsonDistanceComposite() throws Exception
 {
 getPlatform().copyFromLocal( inputFileCritics );
 Tap source = getPlatform().getTextFile( inputFileCritics );
 Tap sink = getPlatform().getTextFile( new Fields( "line" ), getOutputPath( "pearson/composite" ), SinkMode.REPLACE );
 // unknown number of elements
 Pipe pipe = new Each( "pearson", new Fields( "line" ), new RegexSplitter( "\t" ) );
 // break not names and movies
 pipe = new Each( pipe, new UnGroup( new Fields( "name", "movie", "rate" ), Fields.FIRST, 2 ) );
 // name and rate against others of same movie
 pipe = new PearsonDistance( pipe, new Fields( "name", "movie", "rate" ), new Fields( "name1", "name2", "distance" ) );
 Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe );
 flow.complete();
 validateLength( flow, 21 );
 List<Tuple> results = getSinkAsList( flow );
 assertTrue( results.contains( new Tuple( "GeneSeymour\tLisaRose\t0.39605901719066977" ) ) );
 }
}
origin: cascading/cascading-platform

@Test
public void testPearsonDistanceComposite() throws Exception
 {
 getPlatform().copyFromLocal( inputFileCritics );
 Tap source = getPlatform().getTextFile( inputFileCritics );
 Tap sink = getPlatform().getTextFile( new Fields( "line" ), getOutputPath( "pearson/composite" ), SinkMode.REPLACE );
 // unknown number of elements
 Pipe pipe = new Each( "pearson", new Fields( "line" ), new RegexSplitter( "\t" ) );
 // break not names and movies
 pipe = new Each( pipe, new UnGroup( new Fields( "name", "movie", "rate" ), Fields.FIRST, 2 ) );
 // name and rate against others of same movie
 pipe = new PearsonDistance( pipe, new Fields( "name", "movie", "rate" ), new Fields( "name1", "name2", "distance" ) );
 Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe );
 flow.complete();
 validateLength( flow, 21 );
 List<Tuple> results = getSinkAsList( flow );
 assertTrue( results.contains( new Tuple( "GeneSeymour\tLisaRose\t0.39605901719066977" ) ) );
 }
}
cascading.assemblyPearsonDistance

Javadoc

Computes the pearson distance between every unique set of first fields, with using the label and value of each element.

Expects on input three values: item, label, value

Most used methods

  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • compareTo (BigDecimal)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JOptionPane (javax.swing)
  • Top plugins for Android Studio
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