I have a bunch of spectrograms with labels that I want to use different machine learning methods for classification on. So I've wanted to use "sklearn.datasets.load_files()" to try out my dataset with some decision trees. But unfortunately I'm at a loss on how to achieve that.
I have a directory set up with the different classes of png files in different subfolders. So loading the images with "sklearn.datasets.load_files('path')" worked. But
tree=DecisionTreeRegressor(max_depth=3)
tree.fit(training.data,training.target)
gave me a value error "ValueError: could not convert string to float". Thus, I did some more reading in the documentation of load_files, and saw the possability to add the "encoding" parameter. After opening one of the files with notepad++, I saw that apparently the file uses 'ANSI' as encoding. Hence, I've tried "sklearn.datasets.load_files('path', encoding = 'ANSI')". I still get a "ValueError: could not convert string to float: " message though.
There is a very similar question already on this forum (see here), but the github link results in a 404 error and I'm at a loss on what to do with the remainders of the answer.
I'm under the impression that the load_files with correct encoding parameters should work, since the documentation linked aboved mentions images. Maybe I am wrong though, or there is some in between step that I'm missing. Thank you for reading!