Negative log-likelihood loss.
Inheritance HierarchySystemObject
Accord.Math.Optimization.LossesLogLikelihoodLoss
Accord.Math (in Accord.Math.dll) Version: 3.8.0
Syntax[SerializableAttribute] public class LogLikelihoodLoss : ILoss<double[][]>, ILoss<double[][], double>, ILoss<double[]>, ILoss<double[], double>
<SerializableAttribute> Public Class LogLikelihoodLoss Implements ILoss(Of Double()()), ILoss(Of Double()(), Double), ILoss(Of Double()), ILoss(Of Double(), Double)Request Example View Source
The LogLikelihoodLoss type exposes the following members.
Constructors Methods Name Description EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object.) FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.) GetHashCodeServes as the default hash function.
(Inherited from Object.) GetTypeGets the Type of the current instance.
(Inherited from Object.) Loss(Double)Computes the loss between the expected values (ground truth) and the given actual values that have been predicted.
Loss(Double)Computes the loss between the expected values (ground truth) and the given actual values that have been predicted.
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object.) ToStringReturns a string that represents the current object.
(Inherited from Object.) Top Extension Methods Name Description HasMethodChecks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) IsEqualCompares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.) To(Type) Overloaded.Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) ToT Overloaded.Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) Top RemarksThe log-likelihood loss can be used to measure the performance of unsupervised model fitting algorithms. It simply computes the sum of all log-likelihood values produced by the model.
If you would like to measure the performance of a supervised classification model based on their probability predictions, please refer to the BinaryCrossEntropyLoss and CategoryCrossEntropyLoss for binary and multi-class decision problems, respectively.
ExamplesThe following example shows how to learn an one-class SVM and measure its performance using the log-likelihood loss class.
Accord.Math.Random.Generator.Seed = 0; double[][] inputs = { new double[] { +1.0312479734420776 }, new double[] { +0.99444115161895752 }, new double[] { +0.21835240721702576 }, new double[] { +0.47197291254997253 }, new double[] { +0.68701112270355225 }, new double[] { -0.58556461334228516 }, new double[] { -0.64154046773910522 }, new double[] { -0.66485315561294556 }, new double[] { +0.37940266728401184 }, new double[] { -0.61046308279037476 } }; var teacher = new OneclassSupportVectorLearning<Linear>() { Kernel = new Linear(), Nu = 0.1 }; var svm = teacher.Learn(inputs); double[] prediction = svm.Score(inputs); double ll = new LogLikelihoodLoss().Loss(prediction);See Also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4