nolearn.metrics

nolearn.metrics.multiclass_logloss(actual, predicted, eps=1e-15)[source]

Multi class version of Logarithmic Loss metric.

Parameters:
  • actual – Array containing the actual target classes
  • predicted – Matrix with class predictions, one probability per class
nolearn.metrics.learning_curve(self, dataset, classifier, steps=10, verbose=0, random_state=42)

Create a learning curve that uses more training cases with each step.

Parameters:
  • dataset (Dataset) – Dataset to work with
  • classifier (BaseEstimator) – Classifier for fitting and making predictions.
  • steps (int) – Number of steps in the learning curve.
Result:

3-tuple with lists scores_train, scores_test, sizes

Drawing the resulting learning curve can be done like this:

dataset = Dataset()
clf = LogisticRegression()
scores_train, scores_test, sizes = learning_curve(dataset, clf)
pl.plot(sizes, scores_train, 'b', label='training set')
pl.plot(sizes, scores_test, 'r', label='test set')
pl.legend(loc='lower right')
pl.show()
nolearn.metrics.learning_curve_logloss(self, dataset, classifier, steps=10, verbose=0, random_state=42)

Same as learning_curve() but uses multiclass_logloss() as the loss funtion.

Previous topic

nolearn.lasagne

This Page