nbClusters = nbSeriesInChunk;
double idealNbSeriesInChunk = 0.0; //unused if randomize == TRUE
- if (!randomize)
+ if (!randomize)
{
// Adjust nbSeriesInChunk to avoid small remainders.
// Each node should have at least nbSeriesInChunk (as given to the function).
}
//main classification task (using clustering result)
+//NOTE: ifileName == courbes à classer (?!)
int classif_main(int argc, char** argv)
{
const char* ifileName = argv[1];
uint32_t smallestNonProcessedIndex = 0;
double DISTOR = 0.0;
+ FILE* labelsFile = fopen("LABELS", "w");
while (smallestNonProcessedIndex < nbSeries)
{
uint32_t lowerBound = smallestNonProcessedIndex;
for (uint32_t i=0; i<upperBound-lowerBound; i++)
ranks[i] = lowerBound + i;
PowerCurve* data = deserialize(ifileName, NULL, ranks, upperBound-lowerBound);
- uint32_t* labels = get_class(data, upperBound-lowerBound, medoids, nbClusters,
+ uint32_t* labels = get_class(data, upperBound-lowerBound, medoids, nbClusters,
nbValues, p_for_dissims, &DISTOR);
- // send labels to standard output
+ // send labels to LABELS file
for (uint32_t i=0; i<upperBound-lowerBound; i++)
{
free(data[i].values);
- fprintf(stdout, "%u\n",labels[i]);
+ fprintf(labelsFile, "%u\n",labels[i]);
}
free(data);
free(labels);
smallestNonProcessedIndex += (upperBound-lowerBound);
}
+ fclose(labelsFile);
for (uint32_t i=0; i<nbClusters; i++)
free(medoids[i].values);
free(medoids);
free(ranks);
- fprintf(stderr, "DISTOR = %g\n",DISTOR);
+ fprintf(stdout, "DISTOR = %g\n",DISTOR);
return 0;
}