truelearn.base
.BaseClassifier#
- class truelearn.base.BaseClassifier[source]#
Bases:
ABC
The base class of all the classifiers in TrueLearn.
Methods
fit
(x, y)Train the model.
get_params
([deep])Get parameters for this Classifier.
predict
(x)Predict whether the learner will engage in the learning event.
Predict the probability that the learner will engage in the learning event.
set_params
(**args)Set the parameters of this Classifier.
- abstract fit(x: EventModel, y: bool) Self [source]#
Train the model.
- Parameters:
x – A representation of a learning event.
y – A bool indicating whether the learner engages in the learning event.
- Returns:
The updated classifier object.
- get_params(deep: bool = True) Dict[str, Any] [source]#
Get parameters for this Classifier.
- Parameters:
deep – If True, will return the parameters for this Classifier and contained sub-objects that inherit BaseClassifier class.
- Returns:
A dict mapping variable names to the corresponding objects.
- abstract predict(x: EventModel) bool [source]#
Predict whether the learner will engage in the learning event.
- Parameters:
x – A representation of a learning event.
- Returns:
A bool indicating whether the learner will engage in the learning event.
- abstract predict_proba(x: EventModel) float [source]#
Predict the probability that the learner will engage in the learning event.
- Parameters:
x – A representation of a learning event.
- Returns:
A float indicating the probability that the learner will engage in the learning event.
- set_params(**args) Self [source]#
Set the parameters of this Classifier.
A value can be reset only if the given parameter has the same type as the original value.
- Parameters:
**args – Keyword arguments. The key should match the parameter names of the classifier. The arguments should have the correct type.
- Returns:
The updated classifier.
- Raises:
TrueLearnTypeError – Types of parameters do not satisfy their constraints.
TrueLearnValueError – Values of parameters do not satisfy their constraints.
InvalidArgumentError – If the given argument name is not in the class.