Prerequisites

True data generating process p(y=1|x)

In[39]:=

"final_1.gif"

Out[40]=

"final_2.gif"

To make optimization tractable, compute loss by summing losses over the following points

In[3]:=

"final_3.gif"

Out[4]=

"final_4.gif"

Define log - loss and truncated log loss. Truncated log loss is used to avoid numerical problems (getting Log[1/0] during optimization). Using truncated loss has an effect that once the function gets close to 1 or 0, getting it closer no longer decreases the loss.

In[5]:=

"final_5.gif"

Out[7]=

"final_6.gif"

Linear/hinge loss. In this case we are considering probability models that never go outside of (0, 1) Since hinge loss and linear loss are identical over that domain, use linear loss

In[8]:=

"final_7.gif"

Out[9]=

"final_8.gif"

In[10]:=

"final_9.gif"

Out[11]=

"final_10.gif"

Fitter

"final_11.gif"

In[12]:=

"final_12.gif"

Best fit using log - loss and 2 degrees of freedom corresponds to Bayes optimal classifier

In[13]:=

"final_13.gif"

Out[14]=

"final_14.gif"

Because some points are on the boundary (g (x) = 1), and our function class does not include those points, there may not be a minimum, however, because we initialize the starting value to function that produces the optimal classifier, we can be sure that the result of minimization gives better loss than the starting point (it might be equal in the case of the Hessian being 0, which is not the case here). You can see that with higher degree of freedom you can decrease log loss, but that increases 0-1 loss.

In[15]:=

"final_15.gif"

"final_16.gif"

Out[16]=

"final_17.gif"

Find minimizers values for all degrees of from 2 to 30. There are warnings, likely due to the fact that minimum is outside of the achievable region (step function is not achievable exactly)

"final_18.gif"

"final_19.gif"

"final_20.gif"

"final_21.gif"

"final_22.gif"

"final_23.gif"

"final_24.gif"

"final_25.gif"

"final_26.gif"

"final_27.gif"

In[220]:=

"final_28.gif"

Out[220]=

"final_29.gif"

In[90]:=

"final_30.gif"

Out[90]=

"final_31.gif"

Evaluate approximation error

In[203]:=

"final_32.gif"

In[204]:=

"final_33.gif"

Out[204]=

"final_34.gif"

In[205]:=

"final_35.gif"

Out[205]=

"final_36.gif"

In[207]:=

"final_37.gif"

Out[207]=

"final_38.gif"


Created by Wolfram Mathematica 6.0  (12 June 2007) Valid XHTML 1.1!