-
Notifications
You must be signed in to change notification settings - Fork 31
/
TweedieLoss.xml
130 lines (126 loc) · 7.26 KB
/
TweedieLoss.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<Type Name="TweedieLoss" FullName="Microsoft.ML.Trainers.TweedieLoss">
<TypeSignature Language="C#" Value="public sealed class TweedieLoss : Microsoft.ML.Trainers.ILossFunction<float,float>, Microsoft.ML.Trainers.IRegressionLoss" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit TweedieLoss extends System.Object implements class Microsoft.ML.Trainers.ILossFunction`2<float32, float32>, class Microsoft.ML.Trainers.IRegressionLoss, class Microsoft.ML.Trainers.IScalarLoss" />
<TypeSignature Language="DocId" Value="T:Microsoft.ML.Trainers.TweedieLoss" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class TweedieLoss
Implements ILossFunction(Of Single, Single), IRegressionLoss" />
<TypeSignature Language="F#" Value="type TweedieLoss = class
 interface IRegressionLoss
 interface IScalarLoss
 interface ILossFunction<single, single>" />
<AssemblyInfo>
<AssemblyName>Microsoft.ML.Data</AssemblyName>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>Microsoft.ML.Trainers.ILossFunction<System.Single,System.Single></InterfaceName>
</Interface>
<Interface>
<InterfaceName>Microsoft.ML.Trainers.IRegressionLoss</InterfaceName>
</Interface>
<Interface>
<InterfaceName>Microsoft.ML.Trainers.IScalarLoss</InterfaceName>
</Interface>
</Interfaces>
<Docs>
<summary>
Tweedie loss, based on the log-likelihood of the Tweedie distribution. This loss function is used in Tweedie regression.
</summary>
<remarks type="text/markdown"><![CDATA[
The Tweedie Loss function is defined as:
$
L(\hat{y}, y, i) =
\begin{cases}
\hat{y} - y ln(\hat{y}) + ln(\Gamma(y)) & \text{if } i = 1 \\\\
\hat{y} + \frac{y}{\hat{y}} - \sqrt{y} & \text{if } i = 2 \\\\
\frac{(\hat{y})^{2 - i}}{2 - i} - y \frac{(\hat{y})^{1 - i}}{1 - i} - (\frac{y^{2 - i}}{2 - i} - y\frac{y^{1 - i}}{1 - i}) & \text{otherwise}
\end{cases}
$
where $\hat{y}$ is the predicted value, $y$ is the true label, $\Gamma$ is the [Gamma function](https://en.wikipedia.org/wiki/Gamma_function), and $i$ is the index parameter for the [Tweedie distribution](https://en.wikipedia.org/wiki/Tweedie_distribution), in the range [1, 2].
$i$ is set to 1.5 by default. $i = 1$ is Poisson loss, $i = 2$ is gamma loss, and intermediate values are compound Poisson-Gamma loss.
]]></remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public TweedieLoss (double index = 1.5);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(float64 index) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.ML.Trainers.TweedieLoss.#ctor(System.Double)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (Optional index As Double = 1.5)" />
<MemberSignature Language="F#" Value="new Microsoft.ML.Trainers.TweedieLoss : double -> Microsoft.ML.Trainers.TweedieLoss" Usage="new Microsoft.ML.Trainers.TweedieLoss index" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.ML.Data</AssemblyName>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="index" Type="System.Double" />
</Parameters>
<Docs>
<param name="index">Index parameter for the Tweedie distribution, in the range [1, 2].
1 is Poisson loss, 2 is gamma loss, and intermediate values are compound Poisson loss.</param>
<summary>
Constructor for Tweedie loss.
</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Derivative">
<MemberSignature Language="C#" Value="public float Derivative (float output, float label);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance float32 Derivative(float32 output, float32 label) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.ML.Trainers.TweedieLoss.Derivative(System.Single,System.Single)" />
<MemberSignature Language="VB.NET" Value="Public Function Derivative (output As Single, label As Single) As Single" />
<MemberSignature Language="F#" Value="abstract member Derivative : single * single -> single
override this.Derivative : single * single -> single" Usage="tweedieLoss.Derivative (output, label)" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:Microsoft.ML.Trainers.IScalarLoss.Derivative(System.Single,System.Single)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>Microsoft.ML.Data</AssemblyName>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Single</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="output" Type="System.Single" />
<Parameter Name="label" Type="System.Single" />
</Parameters>
<Docs>
<param name="output">To be added.</param>
<param name="label">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Loss">
<MemberSignature Language="C#" Value="public double Loss (float output, float label);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance float64 Loss(float32 output, float32 label) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.ML.Trainers.TweedieLoss.Loss(System.Single,System.Single)" />
<MemberSignature Language="VB.NET" Value="Public Function Loss (output As Single, label As Single) As Double" />
<MemberSignature Language="F#" Value="abstract member Loss : single * single -> double
override this.Loss : single * single -> double" Usage="tweedieLoss.Loss (output, label)" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:Microsoft.ML.Trainers.ILossFunction`2.Loss(`0,`1)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>Microsoft.ML.Data</AssemblyName>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Double</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="output" Type="System.Single" />
<Parameter Name="label" Type="System.Single" />
</Parameters>
<Docs>
<param name="output">To be added.</param>
<param name="label">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>