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

How to use
EuclideanDistance
in
cascading.assembly

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

origin: cwensel/cascading

@Test
public void testEuclideanDistanceComposite() throws Exception
 {
 getPlatform().copyFromLocal( inputFileCritics );
 Tap source = getPlatform().getTextFile( inputFileCritics );
 Tap sink = getPlatform().getTextFile( new Fields( "line" ), getOutputPath( "euclidean/composite" ), SinkMode.REPLACE );
 // unknown number of elements
 Pipe pipe = new Each( "euclidean", 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 EuclideanDistance( 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.14814814814814814" ) ) );
 }
origin: cascading/cascading-platform

@Test
public void testEuclideanDistanceComposite() throws Exception
 {
 getPlatform().copyFromLocal( inputFileCritics );
 Tap source = getPlatform().getTextFile( inputFileCritics );
 Tap sink = getPlatform().getTextFile( new Fields( "line" ), getOutputPath( "euclidean/composite" ), SinkMode.REPLACE );
 // unknown number of elements
 Pipe pipe = new Each( "euclidean", 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 EuclideanDistance( 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.14814814814814814" ) ) );
 }
cascading.assemblyEuclideanDistance

Javadoc

Computes the euclidean 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
  • onCreateOptionsMenu (Activity)
  • findViewById (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top PhpStorm plugins
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