Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5c8d9e3

Browse files
committed
documentation of processdata.java
1 parent 47ef433 commit 5c8d9e3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎src/classification/ProcessData.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
package classification;
22

33
public class ProcessData {
4+
// --- Function for calculating the number of test data and flooring it, if it is not natural
45
protected static int processDataValidation (int columnCount, float percentage) {
56
return (int) Math.floor(columnCount * percentage);
67
}
78

9+
// --- Function for returning a specific part of the data set from a lower to an upper boundary --------------------
10+
// --- Function for extracting the predictors
811
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
913
float [][] dataPredictors = new float[upperBoundary - lowerBoundary][length];
14+
// Writing the data from the lower to the upper boundary to the new array
1015
for (int i = lowerBoundary; i < upperBoundary; i++) {
1116
dataPredictors[i - lowerBoundary] = data[i];
1217
}
1318
return dataPredictors;
1419
}
1520

21+
// --- Function for extracting the results
1622
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
1724
String [] dataResults = new String[upperBoundary - lowerBoundary];
25+
// Writing the data from the lower to the upper boundary to the new array
1826
for (int i = lowerBoundary; i < upperBoundary; i++) {
1927
dataResults[i - lowerBoundary] = data[i];
2028
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /