Skip to content

Commit

Permalink
reinstate db_scan test and instantiate TSNE with parameter 'init="ran…
Browse files Browse the repository at this point in the history
…dom"' to extend compatibility across multiple python versions
  • Loading branch information
ben9809 committed Apr 21, 2024
1 parent f3640e6 commit f4cb322
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion arbitragelab/ml_approach/optics_dbscan_pairs_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def plot_clustering_info(self, n_dimensions: int = 2, method: str = "",

fig = plt.figure(facecolor='white', figsize=figsize)

tsne = TSNE(n_components=n_dimensions)
tsne = TSNE(n_components=n_dimensions, init='random')

tsne_fv = pd.DataFrame(tsne.fit_transform(self.feature_vector),
index=self.feature_vector.index)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_optics_dbscan_pairs_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,10 @@ def test_plotting_methods(self):
self.assertTrue(isinstance(knee_plot_pyplot_obj, Axes))

# Test 2d cluster plot return object.
self.pair_selector.dimensionality_reduction_by_components(2)
twod_pyplot_obj = self.pair_selector.plot_clustering_info(n_dimensions=2)
self.assertTrue(isinstance(twod_pyplot_obj, Axes))

# Test 3d cluster plot return object.
self.pair_selector.dimensionality_reduction_by_components(3)
threed_pyplot_obj = self.pair_selector.plot_clustering_info(n_dimensions=3)
self.assertTrue(isinstance(threed_pyplot_obj, Axes))

Expand Down

0 comments on commit f4cb322

Please sign in to comment.