LinearRegressionEstimator#

class LinearRegressionEstimator#

A class for fitting a Linear-Regression Model.

decrypt_decode_phi(self: pyhelayers.LinearRegressionEstimator) List[float]#

Decrypts and decodes the model coefficients which were computed by fitMultipleLinearRegression() function. Returns the decrypted coefficients.

encode_encrypt(self: pyhelayers.LinearRegressionEstimator, inputs: List[numpy.ndarray[numpy.float64]]) List[pyhelayers.CTileTensor]#

Encodes and encrypts the given inputs to be sent to fitMultipleLinearRegression() function.

Parameters:

inputs – The plaintext inputs. This vector should contain two elements, representing xTrain and yTrain respectively.

fit_multiple_linear_regression(self: pyhelayers.LinearRegressionEstimator, inputs: List[pyhelayers.CTileTensor]) None#

Fits this LinearRegression model on the given inputs. Use this function to fit a LinearRegression with more than one variable.

Parameters:

inputs – The fit encrypted inputs (xTrain and yTrain). These inputs can be encrypted using encode_encrypt() function of this class.

set_inverse_approximation_precision(self: pyhelayers.LinearRegressionEstimator, precision: int) None#

Controls the precision of the inverse approximation used by this LinearRegressionEstimator. A higher value increases accuracy on the account of increasing runtime.

Parameters:

precision – The desired precision