kmeans upgrade

This commit is contained in:
pavanvpatil 2022-10-20 13:26:43 +05:30
parent 09d33644c9
commit 2ff209a38b
1 changed files with 3 additions and 3 deletions

View File

@ -8,9 +8,9 @@ gboolean kmeans(struct data_frame *df,unsigned long long int *count_A,unsigned l
unsigned long long int *count_C,long double *A,long double *B,long double *C)
{
float CURR_FREQ = to_intconvertor(df->dpmu[0]->freq);
long double diff_A = abs(*A-CURR_FREQ);
long double diff_B = abs(*B-CURR_FREQ);
long double diff_C = abs(*C-CURR_FREQ);
long double diff_A = fabs(*A-CURR_FREQ);
long double diff_B = fabs(*B-CURR_FREQ);
long double diff_C = fabs(*C-CURR_FREQ);
printf("A: %Lf, B: %Lf, C: %Lf\n",*A,*B,*C);
if(diff_A <= diff_B && diff_A <= diff_C){
*A = ((*count_A*(*A))+CURR_FREQ)/(++*count_A);