Skip to content

Commit

Permalink
OWManifoldLearning: Re-add chebyshev and jaccard distance to t-SNE
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlin-policar committed Oct 27, 2018
1 parent a88d303 commit 4cc0f50
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
4 changes: 1 addition & 3 deletions Orange/widgets/unsupervised/owmanifoldlearning.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,9 @@ def __radio_parameter_update(self, name):


class TSNEParametersEditor(ManifoldParametersEditor):
_metrics = ("manhattan", "chebyshev")
_metrics = ("euclidean", "manhattan", "chebyshev", "jaccard")
metric_index = Setting(0)
metric_values = [(x, x.capitalize()) for x in _metrics]
# rename l2 to Euclidean
metric_values = [("l2", "Euclidean")] + metric_values

perplexity = Setting(30)
early_exaggeration = Setting(12)
Expand Down
19 changes: 19 additions & 0 deletions Orange/widgets/unsupervised/tests/test_owmanifoldlearning.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,25 @@ def __callback():
self.widget.manifold_methods_combo, callback=__callback,
)

def test_metrics(self):
# Select t-SNE method, which is the only method that supports metrics
simulate.combobox_activate_item(self.widget.manifold_methods_combo, "t-SNE")

def __callback():
# Send data to input
self.send_signal(self.widget.Inputs.data, self.iris)
self.widget.apply_button.button.click()
self.assertFalse(self.widget.Error.manifold_error.is_shown())

# Clear input
self.send_signal(self.widget.Inputs.data, None)
self.widget.apply_button.button.click()
self.assertFalse(self.widget.Error.manifold_error.is_shown())

simulate.combobox_run_through_all(
self.widget.tsne_editor.metric_combo, callback=__callback,
)

@skip
def test_singular_matrices(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ requirements:
- commonmark
- serverfiles
- matplotlib >=2.0.0
- fasttsne >=0.2.9
- fasttsne >=0.2.10

test:
# Python imports
Expand Down
2 changes: 1 addition & 1 deletion requirements-core.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ serverfiles # for Data Sets synchronization
networkx
python-louvain
requests
fastTSNE>=0.2.9
fastTSNE>=0.2.10

0 comments on commit 4cc0f50

Please sign in to comment.