TradingView
RicardoSantos
Sep 7, 2020 10:50 AM
Function K-Means Clustering
OANDA:NAS100USD
5
US Nas 100
OANDA
Description
⋅
Sep 7, 2020 10:50 AM
Description:
A Function that returns cluster centers for given data (X,Y) vector points.
Inputs:
_X: Array containing x data points.¹
_Y: Array containing y data points.¹
_number_of_clusters: number of clusters.
Note:
¹: _X and _Y size must match.
Outputs:
_centers_x: Array containing x data points.
_centers_y: Array containing y data points.
Resources:
rosettacode.org/wiki/K-means++_clustering
en.wikipedia.org/wiki/K-means_clustering
Release Notes
⋅
Mar 30, 2023 9:01 AM
Update to V5 and fixed a a few errors in the code. -_-*
Oscillators
experimental
function
kmeans
cluster
Comments
jon2snow
⋅
Mar 29, 2023 9:36 PM
It is sadly not working, Message bar 0 in remove.array function, Index -1 is out of bounds, array size is 1.
RicardoSantos
⋅
Mar 30, 2023 9:02 AM
@jon2snow
, fixed, thanks for reporting :)
luminaryfi
⋅
Sep 12, 2020 3:36 PM
Excellent Work
@RicardoSantos
!
joaoseguradocomercial
⋅
Jan 18, 2023 9:43 AM
nao roda
kakola
⋅
Mar 3, 2021 8:37 PM
Instead of vectors, can k-means clustering be used on simple linear sets of data?
RicardoSantos
⋅
Mar 3, 2021 10:58 PM
@kakola
, you can use the same set for X, Y arrays to do 1d means, but there would be better methods to achieve that..
RicardoSantos
⋅
Mar 4, 2021 8:48 AM
@kakola
, follow up: take a look at the comments in this OS discussion:
kakola
⋅
Mar 4, 2021 2:41 PM
@RicardoSantos
, I will try to find a clustering algorithm where N-clusters does not have to be initially provided.
RicardoSantos
⋅
Mar 4, 2021 2:47 PM
@kakola
, sry missing link .p
stats.stackexchange.com/questions/40454/determine-different-clusters-of-1d-data-from-database
ruimnetob
⋅
Sep 19, 2020 10:11 PM
@RicardoSantos
Olá Ricardo! Esta implementação de clustering por K-Means está funcional? Obrigado!
More