"LogisticRegression" (Machine Learning Method)

Details & Suboptions

  • "LogisticRegression" models the log probabilities of each class with a linear combination of numerical features , , where corresponds to the parameters for class k. The estimation of the parameter matrix is done by minimizing the loss function sum_(i=1)^m-log(P_(theta)(class=y_i|x_i))+lambda_1 sum_(i=1)^nTemplateBox[{{theta, _, i}}, Abs]+(lambda_2)/2 sum_(i=1)^ntheta_i^2.
  • The following options can be given:
  • "L1Regularization"0value of in the loss function
    "L2Regularization"Automaticvalue of in the loss function
    "OptimizationMethod"Automaticwhat method to use
  • Possible settings for "OptimizationMethod" include:
  • "LBFGS"limited memory BroydenFletcherGoldfarbShanno algorithm
    "StochasticGradientDescent"stochastic gradient method
    "Newton"Newton method

Examples

open allclose all

Basic Examples  (2)

Train a classifier function on labeled examples:

In[1]:=
Click for copyable input
Out[1]=

Look at the ClassifierInformation:

In[2]:=
Click for copyable input
Out[2]=

Classify a new example:

In[3]:=
Click for copyable input
Out[3]=

Generate some normally distributed data:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input

Visualize it:

In[3]:=
Click for copyable input
Out[3]=

Train a classifier on this dataset:

In[4]:=
Click for copyable input
Out[4]=

Plot the training set and the probability distribution of each class as a function of the features:

In[5]:=
Click for copyable input
Out[5]=

Options  (6)

See Also

Classify  ClassifierFunction  ClassifierMeasurements  ClassifierInformation  Predict  PredictorInformation  PredictorMeasurements  SequencePredict  ClusterClassify  LogisticSigmoid

Related Methods