KMeansPlain#
- class KMeansPlain#
A plaintext representation of a KMeans model.
- set_centroids(self: pyhelayers.KMeansPlain, c: numpy.ndarray[numpy.float64]) None #
Set the Centroids. The input argument is a matrix of shape [num_centers,num_features], where the i’th row specifies the i’th centroid.
- Parameters:
c (numpy array of doubles) – The centroid matrix.
-
class KMeansPlain : public helayers::PlainModel#
A plaintext representation of a KMeans model.
Public Functions
-
KMeansPlain()#
Construct an empty object.
-
~KMeansPlain()#
Destructor.
-
KMeansPlain(const KMeansPlain &src) = delete#
Deleted copy constructor.
-
KMeansPlain &operator=(const KMeansPlain &src) = delete#
Deleted operator=.
-
void setCentroids(const DoubleTensor &c)#
Set the Centroids.
The input argument is a matrix of shape [num_centers,num_features], where the i’th row specifies the i’th centroid.
- Parameters:
c – The centroid matrix.
-
virtual std::shared_ptr<HeModel> getEmptyHeModel(const HeContext &he) const override#
Returns an empty HE KMeans object.
- Parameters:
he – the context
-
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.
-
KMeansPlain()#