stochasticLogisticRegression

This function implements stochastic logistic regression. It can be used for binary classification problem, supports the same custom parameters as stochasticLinearRegression and works the same way.

Parameters

Parameters are exactly the same as in stochasticLinearRegression:
learning rate, l2 regularization coefficient, mini-batch size, method for updating weights.
For more information see parameters.

  1. stochasticLogisticRegression(1.0, 1.0, 10, 'SGD')

1. Fitting

  1. See the `Fitting` section in the [stochasticLinearRegression](#stochasticlinearregression-usage-fitting) description.
  2. Predicted labels have to be in \[-1, 1\].

2. Predicting

  1. Using saved state we can predict probability of object having label `1`.
  2. ``` sql
  3. WITH (SELECT state FROM your_model) AS model SELECT
  4. evalMLMethod(model, param1, param2) FROM test_data
  5. ```
  6. The query will return a column of probabilities. Note that first argument of `evalMLMethod` is `AggregateFunctionState` object, next are columns of features.
  7. We can also set a bound of probability, which assigns elements to different labels.
  8. ``` sql
  9. SELECT ans < 1.1 AND ans > 0.5 FROM
  10. (WITH (SELECT state FROM your_model) AS model SELECT
  11. evalMLMethod(model, param1, param2) AS ans FROM test_data)
  12. ```
  13. Then the result will be labels.
  14. `test_data` is a table like `train_data` but may not contain target value.

See Also