|
1 | 1 | package classification;
|
2 | 2 |
|
3 | 3 | public class ProcessData {
|
| 4 | + // --- Function for calculating the number of test data and flooring it, if it is not natural |
4 | 5 | protected static int processDataValidation (int columnCount, float percentage) {
|
5 | 6 | return (int) Math.floor(columnCount * percentage);
|
6 | 7 | }
|
7 | 8 |
|
| 9 | + // --- Function for returning a specific part of the data set from a lower to an upper boundary -------------------- |
| 10 | + // --- Function for extracting the predictors |
8 | 11 | protected static float[][] processDataPredictors (float [][] data, int lowerBoundary, int upperBoundary, int length) {
|
| 12 | + // Creating an array for saving the data from the upper to the lower boundary |
9 | 13 | float [][] dataPredictors = new float[upperBoundary - lowerBoundary][length];
|
| 14 | + // Writing the data from the lower to the upper boundary to the new array |
10 | 15 | for (int i = lowerBoundary; i < upperBoundary; i++) {
|
11 | 16 | dataPredictors[i - lowerBoundary] = data[i];
|
12 | 17 | }
|
13 | 18 | return dataPredictors;
|
14 | 19 | }
|
15 | 20 |
|
| 21 | + // --- Function for extracting the results |
16 | 22 | protected static String[] processDataResults (String [] data, int lowerBoundary, int upperBoundary) {
|
| 23 | + // Creating an array for saving the data from the upper to the lower boundary |
17 | 24 | String [] dataResults = new String[upperBoundary - lowerBoundary];
|
| 25 | + // Writing the data from the lower to the upper boundary to the new array |
18 | 26 | for (int i = lowerBoundary; i < upperBoundary; i++) {
|
19 | 27 | dataResults[i - lowerBoundary] = data[i];
|
20 | 28 | }
|
|
0 commit comments