diff --git a/src/main/java/com/metaweb/gridworks/clustering/knn/kNNClusterer.java b/src/main/java/com/metaweb/gridworks/clustering/knn/kNNClusterer.java index ad488f894..5576b3372 100644 --- a/src/main/java/com/metaweb/gridworks/clustering/knn/kNNClusterer.java +++ b/src/main/java/com/metaweb/gridworks/clustering/knn/kNNClusterer.java @@ -60,10 +60,10 @@ public class kNNClusterer extends Clusterer { _config = o; _treeBuilder = new VPTreeBuilder(_distance); try { - _radius = (float) o.getDouble("radius"); + _radius = (float) o.getJSONObject("params").getDouble("radius"); } catch (JSONException e) { Gridworks.warn("No radius found, using default"); - _radius = 1.0f; + _radius = 0.1f; } } diff --git a/src/main/java/edu/mit/simile/vicino/vptree/Node.java b/src/main/java/edu/mit/simile/vicino/vptree/Node.java index 129396980..9c52a3bb2 100755 --- a/src/main/java/edu/mit/simile/vicino/vptree/Node.java +++ b/src/main/java/edu/mit/simile/vicino/vptree/Node.java @@ -40,11 +40,19 @@ public class Node implements Serializable { return obj.toString(); } - public boolean equals(Object n) { - if (n instanceof Node) { - return ((Node) n).get().equals(this.obj); - } else { - return false; + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } + if (o instanceof Node) { + return ((Node) o).get().equals(this.obj); + } + return false; + } + + @Override + public int hashCode() { + return this.obj.hashCode(); } } diff --git a/src/main/java/edu/mit/simile/vicino/vptree/VPTreeBuilder.java b/src/main/java/edu/mit/simile/vicino/vptree/VPTreeBuilder.java index 8529a5c63..451a13a8f 100755 --- a/src/main/java/edu/mit/simile/vicino/vptree/VPTreeBuilder.java +++ b/src/main/java/edu/mit/simile/vicino/vptree/VPTreeBuilder.java @@ -42,10 +42,9 @@ public class VPTreeBuilder { public VPTree buildVPTree() { Node[] nodes_array = this.nodes.toArray(new Node[this.nodes.size()]); - Gridworks.log("building tree with nodes: " + nodes_array.length); VPTree tree = new VPTree(); tree.setRoot(addNode(nodes_array, 0, nodes_array.length - 1)); - Gridworks.log("tree built"); + Gridworks.log("Built vptree with " + nodes_array.length + " nodes"); return tree; } @@ -68,9 +67,7 @@ public class VPTreeBuilder { Map> map = new HashMap>(); for (Node n : nodes) { Serializable s = n.get(); - Gridworks.log(" find results for: " + s); List results = seeker.range(s, radius); - Gridworks.log(" found: " + results.size()); map.put(s, results); } diff --git a/src/main/webapp/scripts/dialogs/facet-based-edit-dialog.js b/src/main/webapp/scripts/dialogs/facet-based-edit-dialog.js index 963ac65aa..ec21e0a83 100644 --- a/src/main/webapp/scripts/dialogs/facet-based-edit-dialog.js +++ b/src/main/webapp/scripts/dialogs/facet-based-edit-dialog.js @@ -14,7 +14,7 @@ FacetBasedEditDialog.prototype._createDialog = function() { var frame = DialogSystem.createDialog(); frame.width("900px"); - var header = $('
').addClass("dialog-header").text("Facet-based edit of column " + this._columnName).appendTo(frame); + var header = $('
').addClass("dialog-header").text("Cluster & Edit column " + this._columnName).appendTo(frame); var body = $('
').addClass("dialog-body").appendTo(frame); var footer = $('
').addClass("dialog-footer").appendTo(frame); @@ -28,14 +28,14 @@ FacetBasedEditDialog.prototype._createDialog = function() { '' + '' + '' + - '
Keying Function: ' + '' + '' + '' + '' + '' + '
' + - '