I am working on the following Python codes.
I am hoping to accomplish the following:
- Create a
total_fold_arraywhich will hold 5 items (folds) - For each fold, create an array of data from a larger dataset based off of the logic (which I know is correct) inside of my
for...ziploop
To help you understand:
The classses and class_weights returns:
[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0] and [0.14285714 0.14285714 0.14285714 0.14285714 0.14285714 0.14285714
0.14285714]
The while count !=6 is not working properly. In short, what I am trying to accomplish is to populate the total_fold_array with 5 individual folds, which each contain a number of rows from a dataset.
An example of the current_fold_array might be [A,B,C,D], so then ultimately, I have a total_fold_array which has 5 of those individual folds, which would look like [[A,B,C,D,],[A,B,B,C],[A,A,A,A],[B,C,D,D],[B,B,B,C]]
However, this loop does not do that. Instead, it creates total_fold_array with the length of whatever the length of classes is (in this case 7), instead of having 5 folds within.
My code is below:
I am currently getting a total_fold_array containing 7 items, when instead, it should contain 5. Each item within can have as many items as needed, but the total_fold_array should be 5 items long. I believe there is a logic bug in my code, and I am looking for some help. If I were to use a dataset with 5 classes, this works appropriately.
Please let me know if I need to make this clearer.
count = count + 1indented properly? The indentation for the last two lines look suspicious also.total_fold_arraysize of 1, so I don't know if that helps.