concrete.ml.sklearn.linear_model
module concrete.ml.sklearn.linear_model
concrete.ml.sklearn.linear_modelImplement sklearn linear model.
class LinearRegression
LinearRegressionA linear regression model with FHE.
Arguments:
n_bits(int): default is 2.use_sum_workaround(bool): indicate if the sum workaround should be used or not. Thisfeature is experimental and should be used carefully. Important note: it only works for a LinearRegression model with N features, N a power of 2, for now. More information available in the QuantizedReduceSum operator. Default to False.
For more details on LinearRegression please refer to the scikit-learn documentation: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html
method __init__
__init____init__(
n_bits=2,
use_sum_workaround=False,
fit_intercept=True,
normalize='deprecated',
copy_X=True,
n_jobs=None,
positive=False
)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
Get the ONNX model.
.. # noqa: DAR201
Returns:
onnx.ModelProto: the 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 FHE linear model.
Args:
X: training data By default, you should be able to pass: * 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.
Returns: Any
class ElasticNet
ElasticNetAn ElasticNet regression model with FHE.
Arguments:
n_bits(int): default is 2.
For more details on ElasticNet please refer to the scikit-learn documentation: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.ElasticNet.html
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
Get the ONNX model.
.. # noqa: DAR201
Returns:
onnx.ModelProto: the 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
class Lasso
LassoA Lasso regression model with FHE.
Arguments:
n_bits(int): default is 2.
For more details on Lasso please refer to the scikit-learn documentation: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Lasso.html
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
Get the ONNX model.
.. # noqa: DAR201
Returns:
onnx.ModelProto: the 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
class Ridge
RidgeA Ridge regression model with FHE.
Arguments:
n_bits(int): default is 2.
For more details on Ridge please refer to the scikit-learn documentation: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Ridge.html
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
Get the ONNX model.
.. # noqa: DAR201
Returns:
onnx.ModelProto: the 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
class LogisticRegression
LogisticRegressionA logistic regression model with FHE.
Arguments:
n_bits(int): default is 2.
For more details on LogisticRegression please refer to the scikit-learn documentation: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html
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
Get the ONNX model.
.. # noqa: DAR201
Returns:
onnx.ModelProto: the 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
Last updated
Was this helpful?