-
Notifications
You must be signed in to change notification settings - Fork 267
Benedict: Visualization of manifolds of categorical distributions #1813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
813cb50
f357911
9b08101
d8e2950
e1378c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
"""Unit tests for visualization.""" | ||
|
||
import geomstats.visualization as visualization | ||
import matplotlib | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
import tests.conftest | ||
|
||
from CategoricalDistributionsManifold import CategoricalDistributionsManifold | ||
|
||
matplotlib.use("Agg") # NOQA | ||
|
||
|
||
class TestVisualizationManifoldOfCategoricalDistributions( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rename to TestVisualizationCategorical |
||
tests.conftest.TestCase): | ||
def setup_method(self): | ||
self.n_samples = 10 | ||
self.CD2 = CategoricalDistributionsManifold(dim=2) | ||
self.CD3 = CategoricalDistributionsManifold(dim=3) | ||
plt.figure() | ||
|
||
@staticmethod | ||
def test_tutorial_matplotlib(): | ||
visualization.tutorial_matplotlib() | ||
|
||
def test_plot(self): | ||
self.CD2.plot() | ||
self.CD3.plot() | ||
|
||
def test_scatter(self): | ||
self.CD2.scatter(self.n_samples) | ||
self.CD3.scatter(self.n_samples) | ||
|
||
def test_plot_geodesic(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing test_plot_log, test_plot_exp, test__plot_two_points_and_a_vector |
||
b2 = np.array([0.2, 0.3, 0.5]) | ||
v2 = np.array([1, 0, 0]) | ||
self.CD2.plot_geodesic(initial_point=b2, tangent_vector=v2) | ||
|
||
b3 = np.array([0.3, 0.3, 0.2, 0.2]) | ||
v3 = np.array([1, 0, 0, 0]) | ||
self.CD3.plot_geodesic(initial_point=b3, tangent_vector=v3) | ||
|
||
def test_plot_grid(self): | ||
self.CD2.plot_grid() | ||
|
||
@staticmethod | ||
def teardown_method(): | ||
plt.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for visualization of the manifold of categorical distributions