Link Search Menu Expand Document

Classification

Presentation

Data can be use to classification problem. For classification the label vector for an input vector must be a vector of 0 with just a 1 for the class number. For example if you have 5 classes and the input corresponds to class 3 the expected output vector must be:

vector<float> expectedOutput = {0, 0, 1, 0, 0};

When calculating accuracy of a neural network the class of items is the output with the value closest to 1.

Declaration

Data(problem:classification,
     std::vector<std::vector<float>>& trainingInputs,
     std::vector<std::vector<float>>& trainingLabels,
     std::vector<std::vector<float>>& testingInputs,
     std::vector<std::vector<float>>& testingLabels,
     nature typeOfTemporal = nature::nonTemporal,
     int numberOfRecurrences = 0);

Arguments

  • trainingInputs: 2D vector of all the data inputs use to train the neural network. Each vector<float> represents an input for the neural network.
  • trainingLabels: 2D vector of all the expected outputs use to train the neural network. Each vector<float> represents the expected output by the neural network for the corresponding input.
  • testingInputs: 2D vector of all the data inputs use to evaluate the neural network. Each vector<float> represents an input for the neural network.
  • testingLabels: 2D vector of all the expected outputs use to evaluate the neural network. Each vector<float> represents the expected output by the neural network for the corresponding input.
  • typeOfTemporal: An enum corresponding to the temporal nature of problem associated with the data. There are 3 types of temporal nature nonTemporal, sequential and timeSeries.
  • numberOfRecurrences: Size of sequence used for train neural network. Only used for timeSeries otherwise leave the value at 0.