Conversation
Codecov Report
@@ Coverage Diff @@
## master #80 +/- ##
==========================================
+ Coverage 98.61% 98.68% +0.07%
==========================================
Files 13 13
Lines 1511 1603 +92
==========================================
+ Hits 1490 1582 +92
Misses 21 21
Continue to review full report at Codecov.
|
| * @param maxIterations The maximum number of iterations allowed. | ||
| */ | ||
| KHIVAAPI void kMeans(khiva_array *tss, int *k, khiva_array *centroids, khiva_array *labels, float *tolerance, | ||
| int *maxIterations); |
There was a problem hiding this comment.
use snake case in this var name
| * @param centroids The resulting means or centroids. | ||
| * @param labels The resulting labels of each time series which is the closest centroid. | ||
| * @param tolerance The error tolerance to stop the computation of the centroids. | ||
| * @param maxIterations The maximum number of iterations allowed. |
There was a problem hiding this comment.
don't forget to change it here too
| * @param centroids The resulting means or centroids. | ||
| * @param labels The resulting labels of each time series which is the closest centroid. | ||
| * @param tolerance The error tolerance to stop the computation of the centroids. | ||
| * @param maxIterations The maximum number of iterations allowed. |
| * @param maxIterations The maximum number of iterations allowed. | ||
| */ | ||
| KHIVAAPI void kShape(khiva_array *tss, int *k, khiva_array *centroids, khiva_array *labels, float *tolerance, | ||
| int *maxIterations); |
| #include <khiva_c/clustering.h> | ||
|
|
||
| void kMeans(khiva_array *tss, int *k, khiva_array *centroids, khiva_array *labels, float *tolerance, | ||
| int *maxIterations) { |
| } | ||
|
|
||
| void kShape(khiva_array *tss, int *k, khiva_array *centroids, khiva_array *labels, float *tolerance, | ||
| int *maxIterations) { |
| */ | ||
| JNIEXPORT jlongArray JNICALL Java_io_shapelets_khiva_Clustering_kMeans(JNIEnv *env, jobject, jlong ref_tss, jint k, | ||
| jlong ref_centroids, jlong ref_labels, | ||
| jfloat tolerance, jint maxIterations); |
There was a problem hiding this comment.
here it is ok, don't change it
| // Extract first EigenVector | ||
| af::array first = af::lookup(evectors, indMaxEigenValue, 1); | ||
|
|
||
| // TODO: Check this normalization is necessary. |
| float error = std::numeric_limits<float>::max(); | ||
| int iter = 0; | ||
|
|
||
| // Stop Criteria: Stop updating after convergence is reached. |
There was a problem hiding this comment.
... or the max number of iterations is reached.
|
|
||
| unsigned int idxh[5] = {0, 1, 2, 0, 1}; | ||
|
|
||
| float expected_c[35] = {-0.5234, 0.1560, -0.3627, -1.2764, -0.7781, 0.9135, 1.8711, |
There was a problem hiding this comment.
use CamelCase in this file. Applies to other variables as well
otorreno
left a comment
There was a problem hiding this comment.
Take a look at the comments and merge eigenValues and eigenVectors functions
Make sure you have checked all steps below.
Description
Tests
Benchmarks
Commits
License
Documentation