A tool, mean-shift-cluster is developed, which accepts both circular-linear data and linear data.
Mean-shift-cluster supports three kernels: flat kernel
, Gaussian kernel
and truncated Gaussian kernel
.
Mean-shift-cluster provides three APIs:
fit
: Fit input dataset using mean shift algorithm. Cluster centers and labels for each sample can be accessed.get_cluster_info
: Provide basic information of each cluster(mode), using input dataset.predict
: Predict the cluster results of any dataset, using the fitted mean-shift-cluster instance.
The inputs are:
kernel
: Type is string. Options are: flat, gaussian, truncated_gaussiankernel_parameters
: type is List[float].- For flat kernel: [bandwidth]
- For Gaussian kernel: [beta]
- For truncated Gaussian kernel: [bandwidth, beta]
data_type
: Type is string. Options are: circular-linear, linear
To run example.py from this directory:
cd mean-shift
poetry run python example.py
A simple usage example is in example.py. And more details are in the report.
The script used when writing the report is reporter.py.