Skip to content

Commit

Permalink
Update unittests.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxinye authored Feb 4, 2025
1 parent 6df4e17 commit 257612e
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions unittests.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,21 +233,21 @@ def test_explain(self):
clx.predict(X)
clx.predict(X[:1000])

clx.explain(plot=True, showsplist=True, figsize=(10,10), savefig=True)
clx.explain(0, plot=True, savefig=True, showsplist=True)
clx.explain(plot=False, showsplist=True, figsize=(10,10), savefig=True)
clx.explain(0, plot=False, savefig=True, showsplist=True)
clx.form_starting_point_clusters_table(aggregate=True)
clx.explain(3, 2000, plot=True, savefig=False)
clx.explain(0, 2008, plot=True, savefig=True, replace_name=['Superman', 'Batman'])
clx.explain(3, 2000, plot=False, savefig=False)
clx.explain(0, 2008, plot=False, savefig=True, replace_name=['Superman', 'Batman'])

clx.explain(2000, 2028, plot=True, add_arrow=True, savefig=True, showallgroups=True, include_dist=True)
clx.explain(2000, 2028, plot=False, add_arrow=True, savefig=True, showallgroups=True, include_dist=True)

clx.explain(0, 2008, plot=True, add_arrow=True, directed_arrow=-1, savefig=True, fmt='pdf')
clx.explain(0, 2008, plot=True, add_arrow=True, directed_arrow=1, savefig=True, fmt='png')
clx.explain(index1=[0, 0], index2=[4,5], plot=True, add_arrow=True, show_connected_label=True, directed_arrow=1)
clx.explain(index1=np.array([6, 6]), index2=np.array([6, 6]), plot=True, add_arrow=True, directed_arrow=1)
clx.explain(0, 2008, plot=False, add_arrow=True, directed_arrow=-1, savefig=True, fmt='pdf')
clx.explain(0, 2008, plot=False, add_arrow=True, directed_arrow=1, savefig=True, fmt='png')
clx.explain(index1=[0, 0], index2=[4,5], plot=False, add_arrow=True, show_connected_label=True, directed_arrow=1)
clx.explain(index1=np.array([6, 6]), index2=np.array([6, 6]), plot=False, add_arrow=True, directed_arrow=1)
clx = CLASSIX(radius=0.5, group_merging='distance', minPts=4999, mergeTinyGroups=False)
clx.fit(X)
clx.explain(0, 2008, plot=True, add_arrow=True, directed_arrow=-1, savefig=True, fmt='jpg')
clx.explain(0, 2008, plot=False, add_arrow=True, directed_arrow=-1, savefig=True, fmt='jpg')
clx.timing()
except:
checkpoint = 0
Expand All @@ -265,7 +265,7 @@ def test_explain_str_input(self):
clx.fit_transform(X)
print(clx.clusterSizes_)
print(clx.groupCenters_)
clx.explain(index1='Carl', index2='Bert', plot=True, show_connected_label=True, showallgroups=True, sp_fontsize=12)
clx.explain(index1='Carl', index2='Bert', plot=False, show_connected_label=True, showallgroups=True, sp_fontsize=12)

except:
checkpoint = 0
Expand All @@ -281,10 +281,10 @@ def test_explain_hdim(self):
clx = CLASSIX(radius=0.5, group_merging='distance', minPts=3)
clx.fit_transform(X)
clx.predict(X)
clx.explain(plot=True, figsize=(10,10), savefig=False)
clx.explain(0, plot=True, savefig=False)
clx.explain(3, 2000, plot=True, savefig=False)
clx.explain(0, 2008, plot=True, savefig=False)
clx.explain(plot=False, figsize=(10,10), savefig=False)
clx.explain(0, plot=False, savefig=False)
clx.explain(3, 2000, plot=False, savefig=False)
clx.explain(0, 2008, plot=False, savefig=False)
except:
checkpoint = 0

Expand All @@ -300,10 +300,10 @@ def test_explain_1D(self):
clx = CLASSIX(radius=0.5, group_merging='distance', minPts=3)
clx.fit_transform(X)
clx.predict(X)
clx.explain(plot=True, figsize=(10,10), savefig=False)
clx.explain(0, plot=True, savefig=False)
clx.explain(3, 2000, plot=True, savefig=False)
clx.explain(0, 2008, plot=True, savefig=False)
clx.explain(plot=False, figsize=(10,10), savefig=False)
clx.explain(0, plot=False, savefig=False)
clx.explain(3, 2000, plot=False, savefig=False)
clx.explain(0, 2008, plot=False, savefig=False)
except:
checkpoint = 0

Expand All @@ -316,11 +316,11 @@ def test_explain_connected_groups(self):
try:
clx = CLASSIX(radius=0.1, minPts=99, verbose=1, group_merging='distance')
clx.fit(X)
clx.explain(773, 22, plot=True, add_arrow=True, include_dist=False)
clx.explain(773, 22, plot=False, add_arrow=True, include_dist=False)

clx = CLASSIX(radius=0.1, minPts=99, verbose=1, group_merging='density')
clx.fit(X)
clx.explain(773, 22, plot=True, add_arrow=True, include_dist=False)
clx.explain(773, 22, plot=False, add_arrow=True, include_dist=False)
except:
checkpoint = 0

Expand Down

0 comments on commit 257612e

Please sign in to comment.