CovertMark.analytics.learning module

class CovertMark.analytics.learning.Classifier(classifier)[source]

Bases: abc.ABC

Abstract class for common classifier methods.

predict(validation_inputs)[source]

Classify unseen inputs, can be used for both validation prediction and recall prediction.

Parameters:validation_inputs (list) – input rows of features for validation, should not have been seen during training.
Returns:array of positive(1) / negative(0) labels predicted.
train(training_features, training_labels)[source]

Train on training input feature rows.

Parameters:
  • training_features (list) – input rows of features for training, without labels. These should be redrawn between training runs.
  • training_labels (list) – corresponding labels for the input rows.
class CovertMark.analytics.learning.LogisticRegression(multithreaded=True)[source]

Bases: CovertMark.analytics.learning.Classifier

Generic logistic regression with stable L1 penalisation and fast SAGA solver to converge quickly, but can overfit on high dimensional spaces.

class CovertMark.analytics.learning.SGD(loss='hinge', multithreaded=True)[source]

Bases: CovertMark.analytics.learning.Classifier

Stochastic gradient descent linear classification, as a less memory-intensive and incremental learning-compatible alternative to linear SVM (LinearSVC).