concrete.ml.sklearn.glm
module concrete.ml.sklearn.glm
concrete.ml.sklearn.glmImplement sklearn's Generalized Linear Models (GLM).
class PoissonRegressor
PoissonRegressorA Poisson regression model with FHE.
method __init__
__init____init__(
n_bits: 'Union[int, dict]' = 2,
alpha: 'float' = 1.0,
fit_intercept: 'bool' = True,
max_iter: 'int' = 100,
tol: 'float' = 0.0001,
warm_start: 'bool' = False,
verbose: 'int' = 0
)property fhe_circuit
Get the FHE circuit.
Returns:
Circuit: the FHE circuit
property input_quantizers
Get the input quantizers.
Returns:
List[QuantizedArray]: the input quantizers
property onnx_model
property output_quantizers
Get the input quantizers.
Returns:
List[QuantizedArray]: the input quantizers
property quantize_input
Get the input quantization function.
Returns:
Callable: function that quantizes the input
method fit
fitFit the GLM regression quantized model.
Args:
X: The training data, which can be: * numpy arrays * torch tensors * pandas DataFrame or Seriesy(numpy.ndarray): The target data.*args: The arguments to pass to the sklearn linear model.**kwargs: The keyword arguments to pass to the sklearn linear model.
method post_processing
post_processingPost-processing the predictions.
Args:
y_preds(numpy.ndarray): The predictions to post-process.already_dequantized(bool): Wether the inputs were already dequantized or not. Default to False.
Returns:
numpy.ndarray: The post-processed predictions.
method predict
predictPredict on user data.
Predict on user data using either the quantized clear model, implemented with tensors, or, if execute_in_fhe is set, using the compiled FHE circuit.
Args:
X(numpy.ndarray): The input data.execute_in_fhe(bool): Whether to execute the inference in FHE. Default to False.
Returns:
numpy.ndarray: The model's predictions.
class GammaRegressor
GammaRegressorA Gamma regression model with FHE.
method __init__
__init__property fhe_circuit
Get the FHE circuit.
Returns:
Circuit: the FHE circuit
property input_quantizers
Get the input quantizers.
Returns:
List[QuantizedArray]: the input quantizers
property onnx_model
property output_quantizers
Get the input quantizers.
Returns:
List[QuantizedArray]: the input quantizers
property quantize_input
Get the input quantization function.
Returns:
Callable: function that quantizes the input
method fit
fitFit the GLM regression quantized model.
Args:
X: The training data, which can be: * numpy arrays * torch tensors * pandas DataFrame or Seriesy(numpy.ndarray): The target data.*args: The arguments to pass to the sklearn linear model.**kwargs: The keyword arguments to pass to the sklearn linear model.
method post_processing
post_processingPost-processing the predictions.
Args:
y_preds(numpy.ndarray): The predictions to post-process.already_dequantized(bool): Wether the inputs were already dequantized or not. Default to False.
Returns:
numpy.ndarray: The post-processed predictions.
method predict
predictPredict on user data.
Predict on user data using either the quantized clear model, implemented with tensors, or, if execute_in_fhe is set, using the compiled FHE circuit.
Args:
X(numpy.ndarray): The input data.execute_in_fhe(bool): Whether to execute the inference in FHE. Default to False.
Returns:
numpy.ndarray: The model's predictions.
class TweedieRegressor
TweedieRegressorA Tweedie regression model with FHE.
method __init__
__init__property fhe_circuit
Get the FHE circuit.
Returns:
Circuit: the FHE circuit
property input_quantizers
Get the input quantizers.
Returns:
List[QuantizedArray]: the input quantizers
property onnx_model
property output_quantizers
Get the input quantizers.
Returns:
List[QuantizedArray]: the input quantizers
property quantize_input
Get the input quantization function.
Returns:
Callable: function that quantizes the input
method fit
fitFit the GLM regression quantized model.
Args:
X: The training data, which can be: * numpy arrays * torch tensors * pandas DataFrame or Seriesy(numpy.ndarray): The target data.*args: The arguments to pass to the sklearn linear model.**kwargs: The keyword arguments to pass to the sklearn linear model.
method post_processing
post_processingPost-processing the predictions.
Args:
y_preds(numpy.ndarray): The predictions to post-process.already_dequantized(bool): Wether the inputs were already dequantized or not. Default to False.
Returns:
numpy.ndarray: The post-processed predictions.
method predict
predictPredict on user data.
Predict on user data using either the quantized clear model, implemented with tensors, or, if execute_in_fhe is set, using the compiled FHE circuit.
Args:
X(numpy.ndarray): The input data.execute_in_fhe(bool): Whether to execute the inference in FHE. Default to False.
Returns:
numpy.ndarray: The model's predictions.
Last updated
Was this helpful?