[
https://issues.apache.org/jira/browse/FLINK-1741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14386962#comment-14386962
]
ASF GitHub Bot commented on FLINK-1741:
---------------------------------------
Github user vasia commented on a diff in the pull request:
https://github.com/apache/flink/pull/544#discussion_r27407901
--- Diff:
flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/JaccardSimilarityMeasureExample.java
---
@@ -0,0 +1,207 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.graph.example;
+
+import org.apache.flink.api.common.ProgramDescription;
+import org.apache.flink.api.common.functions.MapFunction;
+import org.apache.flink.api.java.DataSet;
+import org.apache.flink.api.java.ExecutionEnvironment;
+import org.apache.flink.api.java.tuple.Tuple2;
+import org.apache.flink.api.java.tuple.Tuple3;
+import org.apache.flink.graph.Edge;
+import org.apache.flink.graph.EdgeDirection;
+import org.apache.flink.graph.Graph;
+import org.apache.flink.graph.Vertex;
+import org.apache.flink.graph.NeighborsFunction;
+import org.apache.flink.graph.Triplet;
+import org.apache.flink.graph.example.utils.JaccardSimilarityMeasureData;
+import org.apache.flink.types.NullValue;
+
+import java.util.HashSet;
+import java.util.Iterator;
+
+/**
+ * Given an undirected, unweighted graph,return a weighted graph where the
edge values are equal
+ * to the Jaccard similarity coefficient - the number of common neighbors
divided by the total number
--- End diff --
I'd say "the size of the union of the neighbor sets", instead of "total
number of neighbors". The Jaccard coefficient denominator doesn't just sum up
the neighborhood sizes, it's the size of the union.
> Add Jaccard Similarity Metric Example
> -------------------------------------
>
> Key: FLINK-1741
> URL: https://issues.apache.org/jira/browse/FLINK-1741
> Project: Flink
> Issue Type: Task
> Components: Gelly
> Affects Versions: 0.9
> Reporter: Andra Lungu
> Assignee: Andra Lungu
>
> http://www.inside-r.org/packages/cran/igraph/docs/similarity
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)