avocado.LightGBMClassifier

class avocado.LightGBMClassifier(name, featurizer, class_weights=None, weighting_function=<function evaluate_weights_flat>)

Feature based classifier using LightGBM to classify objects.

This uses a weighted multi-class logarithmic loss that normalizes for the total counts of each class. This classifier is optimized for the metric used in the PLAsTiCC Kaggle challenge.

Parameters:
  • featurizer (Featurizer) – The featurizer to use to select features for classification.
  • class_weights (dict (optional)) – Weights to use for each class. If not set, equal weights are assumed for each class.
  • weighting_function (function (optional)) – Function to use to evaluate weights. By default, evaluate_weights_flat is used which normalizes the weights for each class so that their overall weight matches the one set by class_weights. Within each class, evaluate_weights_flat gives all objects equal weights. Any weights function can be used here as long as it has the same signature as evaluate_weights_flat.
__init__(name, featurizer, class_weights=None, weighting_function=<function evaluate_weights_flat>)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(name, featurizer[, class_weights, …]) Initialize self.
load(name) Load a classifier that was previously saved to disk
predict(dataset) Generate predictions for a dataset
train(dataset[, num_folds, random_state]) Train the classifier on a dataset
write([overwrite]) Write a trained classifier to disk

Attributes

path Get the path to where a classifier should be stored on disk