LogisticRegressionPlain#
- class LogisticRegressionPlain#
A plaintext representation of a LogisticRegression model.
- get_activation(self: pyhelayers.LogisticRegressionPlain) pyhelayers.LRActivation #
Gets the activation to be used in the LogisticRegressionPlain prediction.
- get_bias(self: pyhelayers.LogisticRegressionPlain) numpy.ndarray[numpy.float64] #
Returns the model bias.
- get_weights(self: pyhelayers.LogisticRegressionPlain) numpy.ndarray[numpy.float64] #
Returns the model weights.
-
class LogisticRegressionPlain : public helayers::PlainModel#
A plaintext representation of a Logistic Regression model.
Public Functions
-
LogisticRegressionPlain()#
Construct an empty LogisticRegressionPlain object.
-
void initFromTensor(const PlainModelHyperParams &hyperParams, const DoubleTensor &w, double b)#
Initializes the model and its weights from a tensor object.
- Parameters:
hyperParams – hyperparameters for this LogisticRegressionPlain
w – a tensor object with the weights
b – the bias value
-
virtual std::shared_ptr<HeModel> getEmptyHeModel(const HeContext &he) const override#
Returns an empty HE LogisticRegression object.
- Parameters:
he – the context
-
inline LRActivationType getActivation() const#
Returns the activation function.
-
inline DoubleTensor getWeights() const#
Returns the coefficient (trained weights) of the features in the decision function.
-
inline DoubleTensor getBias() const#
Intercept (a.k.a. bias) added to the decision function.
-
inline virtual std::string getClassName() const override#
Returns the name of this class.
-
virtual void debugPrint(const std::string &title = "", Verbosity verbosity = VERBOSITY_REGULAR, std::ostream &out = std::cout) const override#
Prints the content of this object.
- Parameters:
title – Text to add to the print
verbosity – Verbosity level
out – Output stream
-
virtual std::vector<PlainTensorMetadata> getInputsPlainTensorMetadata() const override#
Returns a vector of PlainTensorMetadata objects.
The i-th element of this vector contains metadata relating to the i-th input of this PlainModel (such as shape and batch dimension). If this PlainModel is initialized for prediction, the returned vector describes inputs for the the predict() method. If this PlainModel is initialized for fitting, the returned vector describes the inputs for the fit() method.
-
LogisticRegressionPlain()#