Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions graph/plot_minkowski.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def main():
ax.scatter(points, minkowski_values)
# from lib.minkowski import minkowski_distance
# ax.scatter(centroids[0][dim], minkowski_distance(centroids[0][dim], dimension_data, p))
ax.axis('off')
fig.savefig(str(filename), dpi=300, bbox_inches='tight')
plt.close(fig)

Expand Down
4 changes: 2 additions & 2 deletions lib/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ def get_experiment_data(experiment_id: int, dimension: int) -> tuple[int, float,
mu_prefix: list[list[float | int]] = [[]]
sigma_list: list[float | int] = []

if experiment_id == 1:
if experiment_id == 2:
print('Experiment with 2 clusters')
n_clusters = 2
sigma_list = [1, 1]
prob = 0.5
mu_prefix = [[-4, 0], [4, 0]]

elif experiment_id == 2:
elif experiment_id == 3:
print('Experiment with 3 clusters')
n_clusters = 3
sigma_list = [1, 1, 1]
Expand Down
10 changes: 5 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
parser.add_argument(
'--exp',
type=int,
default=1,
help='Experiment id (1: 2 clusters, 2: 3 clusters)'
default=2,
help='Experiment id (2: 2 clusters, 3: 3 clusters)'
)


Expand All @@ -27,16 +27,16 @@ def main():

minkowski_parameter = [0.2, 0.6, 1, 1.5, 2, 3, 5]
T_parameter = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
repeats = 10
n_points = [500, 1000]
repeats = 100
n_points = [100, 500, 1000]

dimension = 20
n_clusters, prob, mu_list, cov_matrices = get_experiment_data(
experiment_id=args.exp, dimension=dimension)

for points in n_points:
experiment_name = f'Clusters:{n_clusters}, points:{points}'
output_path = experiments_path / f'exp_1_{points}'
output_path = experiments_path / f'exp_{args.exp}_points_{points}'

run_experiment(
n_clusters=n_clusters,
Expand Down
Binary file removed report/images/plot_minkowski_function_with_p_0.2.png
Binary file not shown.
Binary file modified report/images/plot_minkowski_function_with_p_0.3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified report/images/plot_minkowski_function_with_p_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified report/images/plot_minkowski_function_with_p_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified report/images/plot_minkowski_function_with_p_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.