-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Labels
bugSomething isn't workingSomething isn't working
Description
- I'm submitting a ...
- question about how to use this project
- Summary
I am trying to serialize and deserialize DecisionTreeClassifier, however it throws an error. What is a valid way to save tree to file and restore it later?
Source:
const decision = new DecisionTreeClassifier({ featureLabels: ['a','b'] });
const deserialized = new DecisionTreeClassifier({ featureLabels: ['a','b'] });
const X = [[0, 0], [1, 1]];
const y = [0, 1];
decision.fit( X, y );
const serialized = JSON.stringify(decision.toJSON())
deserialized.fromJSON(JSON.parse(serialized))
Stacktrace:
TypeError: node.question.match is not a function
at DecisionTreeClassifier._predict (C:\apps\ml\src\lib\tree\tree.ts:434:23)
at DecisionTreeClassifier.predict (C:\apps\ml\src\lib\tree\tree.ts:202:24)
at Object.predict (C:\apps\ml/dttest.js:12:27)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working