pyanno4rt.optimization.components._logistic_regression_tcp

Logistic regression TCP component.

Overview

Classes

LogisticRegressionTCP

Logistic regression TCP component class.

Classes

class pyanno4rt.optimization.components._logistic_regression_tcp.LogisticRegressionTCP(model_parameters, embedding='active', weight=1.0, rank=1, bounds=None, link=None, identifier=None, display=True)[source]

Bases: pyanno4rt.optimization.components.MachineLearningComponentClass

Logistic regression TCP component class.

This class provides methods to compute the value and the gradient of the logistic regression TCP component, as well as to add the logistic regression model.

Parameters:
  • model_parameters (dict) – Dictionary with the data handling & learning model parameters, see the class MachineLearningComponentClass.

  • embedding ({'active', 'passive'}, default='active') – Mode of embedding for the component. In ‘passive’ mode, the component value is computed and tracked, but not considered in the optimization problem, unlike in ‘active’ mode.

  • weight (int or float, default=1.0) – Weight of the component function.

  • rank (int, default=1) – Rank of the component in the lexicographic order.

  • bounds (None or list, default=None) – Constraint bounds for the component.

  • link (None or list, default=None) – Other segments used for joint evaluation.

  • identifier (None or str, default=None) – Additional string for naming the component.

  • display (bool, default=True) – Indicator for the display of the component.

data_model_handler

The object used to handle the dataset, the feature map generation and the feature (re-)calculation.

Type:

object of class DataModelHandler

model

The object used to preprocess, tune, train, inspect and evaluate the logistic regression model.

Type:

object of class LogisticRegressionModel

parameter_value

Value of the logistic regression model coefficients.

Type:

list

intercept_value

Value of the logistic regression model intercept.

Type:

None or list

bounds

See ‘Parameters’. Transformed by the inverse sigmoid function.

Type:

list

Overview

Methods

get_intercept_value()

Get the value of the intercept.

set_intercept_value(*args)

Set the value of the intercept.

add_model()

Add the logistic regression model to the component.

compute_value(*args)

Compute the component value.

compute_gradient(*args)

Compute the component gradient.

Members

get_intercept_value()[source]

Get the value of the intercept.

Returns:

Value of the intercept.

Return type:

list

set_intercept_value(*args)[source]

Set the value of the intercept.

Parameters:

*args (tuple) – Keyworded parameters. args[0] should give the value to be set.

add_model()[source]

Add the logistic regression model to the component.

compute_value(*args)[source]

Compute the component value.

Parameters:

*args (tuple) – Keyworded parameters, where args[0] must be the dose vector(s) to evaluate and args[1] the corresponding segment(s).

Returns:

Value of the component function.

Return type:

float

compute_gradient(*args)[source]

Compute the component gradient.

Parameters:

*args (tuple) – Keyworded parameters, where args[0] must be the dose vector(s) to evaluate and args[1] the corresponding segment(s).

Returns:

Value of the component gradient.

Return type:

ndarray