experiments.baselines.decision_tree.DecisionTreeClassifierBaseline¶
- class DecisionTreeClassifierBaseline(**dt_kwargs)¶
Bases:
SupervisedExperimentBaseline
- __init__(**dt_kwargs)¶
Implements a decision tree classifier baseline for a binary classification task. Pass any keyword arguments to this class that scikit-learn’s DecisionTreeClassifier constructor takes.
- __repr__()¶
Return repr(self).
Methods
- predict(theta, X)¶
Use the trained model to predict positive class probabilities. theta isn’t used here because there are no fitted parameters in decision trees.
- Parameters:
theta – Model weights, None in this case
X (2D np.ndarray) – features
- train(X, y)¶
Instantiate a new model instance and train (fit) it to the training data, X,y
- Parameters:
X (2D np.ndarray) – features
y (1D np.ndarray) – labels