I am new at ML, and still trying to understand some concepts, so I figured I could ask here and maybe finally understand.
How does it work the whole splitting data from a data set?
Before answering, here is what I "know" and "understand" so far:
I have a data set, I'll call it "ds". ds has 10 features, f1,f2...f10, would be represented by each column of the ds. Now, I also have an array of labels that goes with each row of ds, which represents what each sample of data outputs.
Samples | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | Labels |
---|---|---|---|---|---|---|---|---|---|---|---|
1 | ele1 | ele2 | ele3 | ele4 | ele5 | ele6 | ele7 | ele8 | ele9 | ele10 | 1 |
2 | ele11 | ele12 | ele13 | ele14 | ele15 | ele16 | ele17 | ele18 | ele19 | ele20 | 0 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
n | n | n+1 | n+2 | n+3 | n+4 | n+5 | n+6 | n+7 | n+8 | n+9 | 1 |
Next, when testing ML algorithms, I'm suppose to split the ds into training data (training_data) and testing data (testing_data), and same thing with the labels, training label (training_labels), and testing labels (testing_labels). So now I have 4 pieces of information.
In order to check the algorithm's performance, I have to run the algorithm to each set of training data (rows...), and it would produce one result for each row, to which I would like to call "trained data". Once the algorithm has been run on the training data, I will also have an array of "trained_labels" ->[trained_label1, trained_label2, ... trained_label_n ] which it's size will match with the number of rows of the training_data.
Finally, I'm supposed to use this newly created "trained_labels" and compare it to the testing_labels and based on the accuracy (if all the trained_labels match all the testing_labels then it would be 100% accurate), I will be able to tell how good was the algorithm
Assuming a proportion 80% training and 20% testing, here is the big question that I still I am not able to wrap my head around, the size of the trained_labels will be different to the size of the testing labels, so given that fact, how can I campare the accuracy?
Like coding that with python syntax would be:
accuracy = (testing_labels == trained_labels).sum() / len(testing_labels) *100,
So if I could get some guidance it would be very appreciated.
Kind regards
P.S: I don't think slicing the training_labels size to match testing_labels size would be the answer.