Adding final data generator function
This commit is contained in:
parent
c9747b67cd
commit
9562c12c0c
9 changed files with 13 additions and 1 deletions
BIN
activations.o
Normal file
BIN
activations.o
Normal file
Binary file not shown.
BIN
main.o
Normal file
BIN
main.o
Normal file
Binary file not shown.
BIN
myprogram
Executable file
BIN
myprogram
Executable file
Binary file not shown.
BIN
network.o
Normal file
BIN
network.o
Normal file
Binary file not shown.
BIN
neurons.o
Normal file
BIN
neurons.o
Normal file
Binary file not shown.
|
@ -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);
|
||||
}
|
||||
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);
|
||||
}else
|
||||
{
|
||||
|
@ -187,7 +199,7 @@ void print_data(const Data *data)
|
|||
temp_feature = temp_feature->next_feature;
|
||||
}
|
||||
temp_hotlabel = current_sample->first_hot;
|
||||
printf("##> ");
|
||||
printf(">##> ");
|
||||
while(temp_hotlabel != NULL)
|
||||
{
|
||||
printf("%f ", temp_hotlabel->value);
|
||||
|
|
BIN
preprocessing.o
Normal file
BIN
preprocessing.o
Normal file
Binary file not shown.
BIN
randomness.o
Normal file
BIN
randomness.o
Normal file
Binary file not shown.
BIN
training.o
Normal file
BIN
training.o
Normal file
Binary file not shown.
Loading…
Reference in a new issue