... | @@ -2,25 +2,41 @@ |
... | @@ -2,25 +2,41 @@ |
|
|
|
|
|
A fast implementation of mean-shift clustering using dual-tree range search. Given a dataset, this uses the mean shift algorithm to produce and return a clustering of the data.
|
|
A fast implementation of mean-shift clustering using dual-tree range search. Given a dataset, this uses the mean shift algorithm to produce and return a clustering of the data.
|
|
|
|
|
|
|
|
```prolog
|
|
|
|
:- use_module('path/to/.../src/methods/mean_shift/mean_shift.pl').
|
|
|
|
|
|
|
|
%% usage example
|
|
|
|
TrainData = [5.1,3.5,1.4, 4.9,3.0,1.4, 4.7,3.2,1.3, 4.6,3.1,1.5],
|
|
|
|
meanShift(1, 1000, TrainData, 3, AssignList, CentroidsList, _, 0, 0).
|
|
|
|
```
|
|
|
|
|
|
# Available Predicates
|
|
# Available Predicates
|
|
|
|
|
|
* [meanShift/12](/PrologMethods/Clustering/mean_shift#meanshift12)
|
|
* [meanShift/9](/PrologMethods/Clustering/mean_shift#meanshift9)
|
|
|
|
|
|
---
|
|
---
|
|
|
|
|
|
[links/resources](/PrologMethods/Clustering/mean_shift#connected-linksresources)
|
|
[links/resources](/PrologMethods/Clustering/mean_shift#connected-linksresources)
|
|
|
|
|
|
## **_meanShift/12_**
|
|
## **_meanShift/9_**
|
|
|
|
|
|
Perform mean shift clustering on the data, returning a list of cluster assignments and centroids.
|
|
Perform mean shift clustering on the data, returning a list of cluster assignments and centroids.
|
|
|
|
|
|
```prolog
|
|
```prolog
|
|
%% part of the predicate definition
|
|
%% predicate definition
|
|
meanShift( +float32, +integer,
|
|
meanShift(Radius, MaxIterations, DataList, DataRows, AssignmentsList, CentroidsList, ZCols, ForceConvergence, UseSeeds) :-
|
|
|
|
MaxIterations >= 0,
|
|
|
|
convert_list_to_float_array(DataList, DataRows, array(Xsize, Xrownum, X)),
|
|
|
|
meanShiftI(Radius, MaxIterations, X, Xsize, Xrownum, Y, Ysize, Z, ZCols, ZRows, ForceConvergence, UseSeeds),
|
|
|
|
convert_float_array_to_list(Y, Ysize, AssignmentsList),
|
|
|
|
convert_float_array_to_2d_list(Z, ZCols, ZRows, CentroidsList).
|
|
|
|
|
|
|
|
%% foreign c++ predicate definition
|
|
|
|
foreign(meanShift, c, meanShiftI(+float32, +integer,
|
|
+pointer(float_array), +integer, +integer,
|
|
+pointer(float_array), +integer, +integer,
|
|
-pointer(float_array), -integer,
|
|
-pointer(float_array), -integer,
|
|
-pointer(float_array), -integer, -integer,
|
|
-pointer(float_array), -integer, -integer,
|
|
+integer, +integer).
|
|
+integer, +integer)).
|
|
```
|
|
```
|
|
|
|
|
|
### Parameters
|
|
### Parameters
|
... | @@ -40,8 +56,8 @@ meanShift( +float32, +integer, |
... | @@ -40,8 +56,8 @@ meanShift( +float32, +integer, |
|
|
|
|
|
If you want a more detailed explanation, then go to the python documentation. There is most of the time a good explanation on how the methods work and what the parameters do.
|
|
If you want a more detailed explanation, then go to the python documentation. There is most of the time a good explanation on how the methods work and what the parameters do.
|
|
|
|
|
|
* [**MLpack::mean_shift_C++\_documentation**](https://www.mlpack.org/doc/stable/doxygen/classmlpack_1_1meanshift_1_1MeanShift.html)
|
|
* [**MLpack::mean_shift_C++\_documentation**](https://www.mlpack.org/doc/mlpack-3.4.2/doxygen/classmlpack_1_1meanshift_1_1MeanShift.html)
|
|
* [**MLpack::mean_shift_Python_documentation**](https://www.mlpack.org/doc/stable/python_documentation.html#mean_shift)
|
|
* [**MLpack::mean_shift_Python_documentation**](https://www.mlpack.org/doc/mlpack-3.4.2/python_documentation.html#mean_shift)
|
|
|
|
|
|
added some of the links from the python documentation
|
|
added some of the links from the python documentation
|
|
|
|
|
... | | ... | |