concrete.ml.sklearn.glm.md
Last updated
Last updated
concrete.ml.sklearn.glm
Implement sklearn's Generalized Linear Models (GLM).
PoissonRegressor
A Poisson regression model with FHE.
Parameters:
n_bits
(int, Dict[str, int]): Number of bits to quantize the model. If an int is passed for n_bits, the value will be used for quantizing inputs and weights. If a dict is passed, then it should contain "op_inputs" and "op_weights" as keys with corresponding number of quantization bits so that: - op_inputs : number of bits to quantize the input values - op_weights: number of bits to quantize the learned parameters Default to 8.
For more details on PoissonRegressor please refer to the scikit-learn documentation: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.PoissonRegressor.html
__init__
post_processing
Post-processing the predictions.
Args:
y_preds
(numpy.ndarray): The predictions to post-process.
already_dequantized
(bool): Whether the inputs were already dequantized or not. Default to False.
Returns:
numpy.ndarray
: The post-processed predictions.
predict
Predict 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.
GammaRegressor
A Gamma regression model with FHE.
Parameters:
n_bits
(int, Dict[str, int]): Number of bits to quantize the model. If an int is passed for n_bits, the value will be used for quantizing inputs and weights. If a dict is passed, then it should contain "op_inputs" and "op_weights" as keys with corresponding number of quantization bits so that: - op_inputs : number of bits to quantize the input values - op_weights: number of bits to quantize the learned parameters Default to 8.
For more details on GammaRegressor please refer to the scikit-learn documentation: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.GammaRegressor.html
__init__
post_processing
Post-processing the predictions.
Args:
y_preds
(numpy.ndarray): The predictions to post-process.
already_dequantized
(bool): Whether the inputs were already dequantized or not. Default to False.
Returns:
numpy.ndarray
: The post-processed predictions.
predict
Predict 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.
TweedieRegressor
A Tweedie regression model with FHE.
Parameters:
n_bits
(int, Dict[str, int]): Number of bits to quantize the model. If an int is passed for n_bits, the value will be used for quantizing inputs and weights. If a dict is passed, then it should contain "op_inputs" and "op_weights" as keys with corresponding number of quantization bits so that: - op_inputs : number of bits to quantize the input values - op_weights: number of bits to quantize the learned parameters Default to 8.
For more details on TweedieRegressor please refer to the scikit-learn documentation: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.TweedieRegressor.html
__init__
post_processing
Post-processing the predictions.
Args:
y_preds
(numpy.ndarray): The predictions to post-process.
already_dequantized
(bool): Whether the inputs were already dequantized or not. Default to False.
Returns:
numpy.ndarray
: The post-processed predictions.
predict
Predict 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.