Closed bwareham closed 2 years ago
I figured it out -- I was trying to create the classifier with an unopened training_data file. It worked when I used 'with open(file)' as so:
with open("output/train_data.json", "r+") as file:
cl = DecisionTreeClassifier(file, format="json")
The need to do this wasn’t obvious to me from the documentation, especially since the process was running on something (when I ran cl.labels() it returned "label", so, as the error noted, it was retrieving one value, just not what I wanted). So it may be worth clarifying in a future update.
I am trying to create and train a DecisionTreeClassifier
cl = DecisionTreeClassifier("output/train_data.json", format="json")
But get the following error:
Seems like a problem with my json data, but it seems to conform to what the documentation says is required:
A similar issue was raised and closed without explanation.