Skip to content

Commit

Permalink
K-means version-control
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaJoctan committed Jul 18, 2024
1 parent b6ad50b commit 400f766
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Clustering/KMeans.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <Graphics\Graphic.mqh>
CGraphic graph;
#include <MALE5\matrix_utils.mqh>
#include <MALE5\MatrixExtend.mqh>

//+------------------------------------------------------------------+
enum errors
Expand All @@ -22,7 +22,6 @@ enum errors

class CKMeans
{
CMatrixutils matrix_utils;

private:
ulong n; //number of samples
Expand Down Expand Up @@ -181,7 +180,7 @@ void CKMeans::KMeansClustering(matrix &clustered_matrix, matrix &centroids, int
// solving for new cluster and updtating the old ones


cluster_comb_v = matrix_utils.MatrixToVector(cluster_comb_m);
cluster_comb_v = MatrixExtend::MatrixToVector(cluster_comb_m);


if(iter == iterations-1)
Expand Down Expand Up @@ -270,7 +269,7 @@ void CKMeans::ElbowMethod(const int initial_k=1, int total_k=10, bool showPlot =
for(ulong j=0; j<x_y_z.Size()/m_cols; j++)
{

matrix_utils.Copy(x_y_z, short_v, uint(j*m_cols), (uint)m_cols);
MatrixExtend::Copy(x_y_z, short_v, uint(j*m_cols), (uint)m_cols);

//--- WCSS ( within cluster sum of squared residuals )

Expand Down

0 comments on commit 400f766

Please sign in to comment.