Developer Guide for Intel® Data Analytics Acceleration Library 2019 Update 4

Batch Processing

Logistic regression algorithm follows the general workflow described in Training and Prediction > Classification > Usage Model

Training

For a description of the input and output, refer to Usage Model: Training and Prediction.

In addition to the parameters of classifier described in Training and Prediction > Classification > Usage Model, the logistic regression batch training algorithm has the following parameters:

Parameter

Default Value

Description

algorithmFPType

float

The floating-point type that the algorithm uses for intermediate computations. Can be float or double.

method

defaultDense

The computation method used by the logistic regression. The only training method supported so far is the default dense method.

nClasses

Not applicable.

The number of classes. A required parameter.

interceptFlag

True

A flag that indicates a need to compute θ0 j

penaltyL1

0

L1 regularization coefficient

penaltyL2

0

L2 regularization coefficient

optimizationSolver

SGD solver

All iterative solvers are available as optimization procedures to use at the training stage:

SGD
Stochastic Gradient Descent Algorithm
ADAGRAD
Adaptive Subgradient Method
LBFGS
Limited-Memory Broyden-Fletcher-Goldfarb-Shanno Algorithm
SAGA
Stochastic Average Gradient Accelerated Method

Prediction

For a description of the input, refer to Usage Model: Training and Prediction.

At the prediction stage logistic regression batch algorithm has the following parameters:

Parameter

Default Value

Description

algorithmFPType

float

The floating-point type that the algorithm uses for intermediate computations. Can be float or double.

method

defaultDense

The computation method used by logistic regression. The only prediction method supported so far is the default dense method.

nClasses

Not applicable.

The number of classes. A required parameter.

resultsToCompute

computeClassesLabels

The 64-bit integer flag that specifies which extra characteristics of the logistic regression to compute.

Provide one of the following values to request a single characteristic or use bitwise OR to request a combination of the characteristics:

  • computeClassesLabels for prediction

  • computeClassesProbabilities for probabilities

  • computeClassesLogProbabilities for logProbabilities

Output

In addition to classifier output, logistic regression prediction calculates the result described below. Pass the Result ID as a parameter to the methods that access the results of your algorithm. For more details, seeAlgorithms.

Result ID

Result

probabilities

Numeric table of size:

  • n x 1, if nClasses = 2
  • n x nClasses, if nClasses > 2
containing probabilities of classes computed when computeClassesProbabilities option is enabled. If nClasses = 2, the table contains probabilities of class "1".

logProbabilities

Numeric table of size:
  • n x 1, if nClasses = 2
  • n x nClasses, if nClasses > 2

containing logarithms of classes' probabilities computed when computeClassesLogProbabilities option is enabled. If nClasses = 2, the table contains logarithms of class "1" probabilities.

Note

  • If resultsToCompute does not contain computeClassesLabels, the prediction table is NULL.

  • If resultsToCompute does not contain computeClassesProbabilities, the probabilities table is NULL.

  • If resultsToCompute does not contain computeClassesLogProbabilities, the logProbabilities table is NULL.

  • By default, each numeric table of this result is an object of the HomogenNumericTable class, but you can define the result as an object of any class derived from NumericTable except for PackedSymmetricMatrix and PackedTriangularMatrix.

Examples

C++:

Java*:

Python*: