class LinearSplineLogisticRegression

Piecewise Logistic Regression with Linear Splines

For more information regarding how to build your own estimator, read more in the User Guide.

Parameters:
  • demo_param – str, default=’demo_param’ A parameter used for demonstration of how to pass and store parameters.

  • input_score_column_index – int, default=0 The index of the column containing input scores.

  • n_knots – int, optional, default=100 Number of knots used in the linear spline logistic regression.

  • knots – list of float or np.ndarray, optional, default=None The knot locations used in the linear spline logistic regression.

  • monotonicity – str, default=’none’ Whether to enforce that the function is monotonically increasing or decreasing. Valid values are ‘none’, ‘increasing’, and ‘decreasing’.

  • intercept – bool, default=True If True, allows the function value at x=0 to be nonzero.

  • method – str, default=’slsqp’ The method named passed to scipy minimize. Supported values are ‘slsqp’ and ‘trust-constr’. For more details, see the documentation for scipy.optimize.minimize.

  • minimizer_options – dict, optional, default=None Some scipy minimizer methods have their special options. For example: {‘disp’: True} will display a termination report. For options, see the documentation for scipy.optimize.minimize.

  • C – int, default=100 Inverse of regularization strength; must be a positive float. Smaller values specify stronger regularization.

  • two_stage_fitting_initial_size – int, optional, default=None Subsample size of training data for first fitting. If two-stage fitting is not used, this should be None.

  • random_state – int, default=31 Random seed number.

Variables:
  • coef – ndarray of shape (n_features,) Coefficients of the linear spline logistic regression model.

  • intercept – float Intercept of the linear spline logistic regression model.

  • knots – ndarray of shape (n_knots,) The knot locations used in the linear spline logistic regression.

  • monotonicity – str, default=’none’ Whether the function is monotonically increasing or decreasing.

  • n_features_in – int Number of input features.

  • two_stage_fitting – bool Whether two-stage fitting is used.

  • verbose – bool Verbosity flag.

Raises:
  • ValueError – If both knots and n_knots are non-null during fitting.

  • ValueError – If monotonicity has an invalid value.

  • ValueError – If input_score_column_index is negative.

  • ValueError – If method has an invalid value.

  • ValueError