evaluateMatrices | R Documentation |
Evaluate if the algorithm converged by comparing two successive membership matrices. Calculate the absolute difference between the matrices and then calculate the max of each row. If all the values of the final vector are below the fixed tolerance, then return True, else return False
evaluateMatrices(mat1, mat2, tol)
mat1 |
A n X k matrix giving for each observation n, its probability to belong to the cluster k at iteration i |
mat2 |
A n X k matrix giving for each observation n, its probability to belong to the cluster k at iteration i+1 |
tol |
A float representing the algorithm tolerance |
A boolean, TRUE if the test is passed, FALSE otherwise
#This is an internal function, no example provided
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.