Adding final data generator function

This commit is contained in:
Abdel Kader Chabi Sika Boni 2021-12-12 01:03:38 +01:00
parent c9747b67cd
commit 9562c12c0c
9 changed files with 13 additions and 1 deletions

BIN
activations.o Normal file

Binary file not shown.

BIN
main.o Normal file

Binary file not shown.

BIN
myprogram Executable file

Binary file not shown.

BIN
network.o Normal file

Binary file not shown.

BIN
neurons.o Normal file

Binary file not shown.

View file

@ -149,6 +149,18 @@ Data *csv_to_samples(char *path_to_csv, int n_features, char *features_separator
} }
add_sample_to_data(data, current_sample); add_sample_to_data(data, current_sample);
} }
Sample *current_sample = data->first_sample;
int number_of_train_samples = ((float)data->size*train_percent) / 100.0; //calculate number of training samples based on provided percentage
while(number_of_train_samples > 0)
{
current_sample = current_sample->next_sample;
number_of_train_samples--;
}
while(current_sample != NULL)
{
current_sample->t = TEST;
current_sample = current_sample->next_sample;
}
fclose(file); fclose(file);
}else }else
{ {
@ -187,7 +199,7 @@ void print_data(const Data *data)
temp_feature = temp_feature->next_feature; temp_feature = temp_feature->next_feature;
} }
temp_hotlabel = current_sample->first_hot; temp_hotlabel = current_sample->first_hot;
printf("##> "); printf(">##> ");
while(temp_hotlabel != NULL) while(temp_hotlabel != NULL)
{ {
printf("%f ", temp_hotlabel->value); printf("%f ", temp_hotlabel->value);

BIN
preprocessing.o Normal file

Binary file not shown.

BIN
randomness.o Normal file

Binary file not shown.

BIN
training.o Normal file

Binary file not shown.