Commit efbdaf86 authored by Lennart Holzenkamp's avatar Lennart Holzenkamp
Browse files

fixing file output and removing prints

parent 53d4e8a7
......@@ -342,7 +342,6 @@ def distance_matrix(df, weights):
single_column_df = df[columns[i]]
matrix = matrix + calc_distance(single_column_df, i, n, weights)
print('weight-sum:' + str(sum(weights)))
return matrix / sum(weights)
......@@ -361,13 +360,12 @@ def calc_distance(df, weight_index, n, weights):
distance_func = lev
for j in range(n):
first_elem = npm[j]
for k in range(j+1,n):
matrix[j, k] = distance_func(first_elem, npm[k])
first_elem = npm[j]
for k in range(j+1,n):
matrix[j, k] = distance_func(first_elem, npm[k])
matrix = matrix + matrix.T
matrix = matrix / matrix.max()
print('current weight: ' + str(weights[weight_index]))
return matrix * weights[weight_index]
......
......@@ -14,7 +14,7 @@ from sklearn import cluster as skcluster
# PARAMETERS
p_ocel_file = './data/ocel.jsonocel'
p_mode = 'existence' # all | existence
p_object_type = 'products' # object-type-name, options depend on the data
p_object_type = 'items' # object-type-name, options depend on the data
p_attr_weights = {
'producer': 2
} # attributes that are not given in the data are not used
......@@ -186,7 +186,7 @@ if not os.path.exists(directory):
appendix_len = len(str(cluster_count))
for ii in range(0, len(res)):
filename = directory + '/cluster_' + str(ii+1).rjust(appendix_len) + '.' + p_ocel_file_type + 'ocel'
pm4py.write_ocel(ocel, filename)
pm4py.write_ocel(res[ii], filename)
print(str(ii+1).rjust(appendix_len) + '/' + str(cluster_count) + '"' + filename + '" stored.')
duration = datetime.datetime.now() - start_ts
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment