Manages a clustered set of Polynomial Chaos Expansion (PCE) models for localized regression.
More...
|
| | ModelClusterPoly ()=default |
| |
| | ~ModelClusterPoly ()=default |
| |
| void | set (std::vector< cmp::PolynomialExpansion > *polynomials, const double &gamma=0, const double &seed=42) |
| |
| void | condition (const Eigen::Ref< const Eigen::MatrixXd > &xObs, const Eigen::Ref< const Eigen::VectorXd > &yObs, const Eigen::Ref< const Eigen::VectorXs > &labels) |
| |
| size_t | nClusters () const |
| |
| void | fit () |
| |
| size_t | nPoints () const |
| |
| size_t | dim () const |
| |
| size_t | getMembership (size_t i) const |
| |
| const Eigen::VectorXs & | getLabels () const |
| |
| size_t | getClusterSize (size_t i) const |
| |
| cmp::PolynomialExpansion & | operator[] (size_t i) |
| |
| const Eigen::VectorXd & | centroid (size_t i) const |
| |
| Eigen::VectorXs | getIndices (size_t clusterIndex) const |
| |
| void | updateModel (const std::vector< bool > &affectedClusters) |
| |
| void | performSwitches (const std::vector< std::pair< size_t, size_t > > &newOwners) |
| |
| bool | isFit (const size_t &clusterIndex) const |
| |
| void | setFit (const size_t &clusterIndex, const bool &fit) |
| |
| double | computeScore (size_t globalIndex) const |
| |
| double | computeScore (size_t model, size_t globalIndex) const |
| |
| std::vector< std::pair< size_t, size_t > > | switchStep (cmp::classifier::Classifier *classifier, const double &T=1.0, const size_t &maxAllowedSwitches=10, const double &minProb=0.1) |
| |
| std::vector< std::pair< size_t, size_t > > | deterministicSwitchStep (cmp::classifier::Classifier *cls, const size_t &maxAllowedSwitches, const double &minProb) |
| |
| void | purgeStep (const size_t &clusterIndex) |
| |
| std::vector< std::vector< double > > | computeProbabilities (const double &T, cmp::classifier::Classifier *classifier, const double &minProb=0.1) const |
| |
| Eigen::MatrixXd | confusionMatrix (std::vector< std::vector< double > > switchingProbability) const |
| |
| void | mergeClusters (const size_t &clusterIndex1, const size_t &clusterIndex2, bool hparGuess=false) |
| |
Manages a clustered set of Polynomial Chaos Expansion (PCE) models for localized regression.
Mathematical Formulation Partitions the input dataset \(\mathcal{D} = \{(\mathbf{x}_i, y_i)\}_{i=1}^N\) into \(K\) localized clusters. For each cluster \(k \in \{0, \dots, K-1\}\), it fits a localized Polynomial Chaos Expansion surrogate:
\[
Y^{(k)}(\boldsymbol{\xi}) \approx \sum_{j=0}^{P-1} c_j^{(k)} \Psi_j^{(k)}(\boldsymbol{\xi})
\]
where \(\Psi_j^{(k)}\) is the orthonormal polynomial basis for cluster \(k\), and \(c_j^{(k)}\) are the local expansion coefficients. For a test query \(\mathbf{x}^*\), local predictions are combined using the classifier's posterior probabilities \(P(C=k \mid \mathbf{x}^*)\):
\[
\mu(\mathbf{x}^*) = \sum_{k=1}^K P(C=k \mid \mathbf{x}^*) \mu_k(\mathbf{x}^*)
\]
where \(\mu_k(\mathbf{x}^*)\) is the output of the \(k\)-th local PCE model.
Implementation Algorithm
condition() groups training inputs according to active clusters and solves the local spectral projection or regression to estimate coefficients \(c_j^{(k)}\).
predict() obtains classifier probabilities and computes the weighted average of local polynomial evaluations.