write_clustering_results

tsml_eval.utils.results_writing.write_clustering_results(cluster_predictions, cluster_probabilities, class_labels, clusterer_name, dataset_name, file_path, full_path=True, split=None, resample_id=None, time_unit='N/A', first_line_comment=None, parameter_info='No Parameter Info', clustering_accuracy=-1, fit_time=-1, predict_time=-1, benchmark_time=-1, memory_usage=-1, n_classes=-1, n_clusters=-1)[source]

Write the predictions for a clustering experiment in the format used by tsml.

Parameters:
cluster_predictionsnp.array

The predicted values to write to file. Must be the same length as labels.

cluster_probabilitiesnp.ndarray

Estimated cluster probabilities. These are written after the predicted values for each case.

class_labelsnp.array

The actual class values written to file with the predicted values. If no label is available for a case, a NaN value should be substituted.

clusterer_namestr

Name of the clusterer that made the predictions. Written to file and can determine file structure if full_path is False.

dataset_namestr

Name of the problem the clusterer was built on.

file_pathstr

Path to write the results file to or the directory to build the default file structure if full_path is False.

full_pathboolean, default=True

If True, results are written directly to the directory passed in file_path. If False, then a standard file structure using the clusterer and dataset names is created and used to write the results file.

splitstr or None, default=None

Either None, ‘TRAIN’ or ‘TEST’. Influences the result file name and first line of the file.

resample_idint or None, default=None

Indicates what random seed was used to resample the data or used as a random_state for the clusterer.

time_unitstr, default=”N/A”

The format used for timings in the file, i.e. ‘Seconds’, ‘Milliseconds’, ‘Nanoseconds’

first_line_commentstr or None, default=None

Optional comment appended to the end of the first line, i.e. the file used to generate the results or a dictionary linking label indices to actual values.

parameter_infostr, default=”No Parameter Info”

Unstructured estimator dependant information, i.e. estimator parameters or values from the model build.

clustering_accuracyfloat, default=-1

The clustering accuracy of the predictions.

fit_timeint, default=-1

The time taken to fit the clusterer.

predict_timeint, default=-1

The time taken to predict the cluster labels.

benchmark_timeint, default=-1

A benchmark time for the hardware used to scale other timings.

memory_usageint, default=-1

The memory usage of the clusterer.

n_classesint, default=-1

The number of classes in the dataset.

n_clustersint, default=-1

The number of clusters founds by the clusterer.