Esempio n. 1
0
    def predict(self, x_, nlv_=None):
        x = mx.NewMatrix(x_)
        pscores_ = mx.initMatrix()
        py_ = mx.initMatrix()

        nlv = None
        if nlv_ is None:
            nlv = self.nlv
        else:
            nlv = self.nlv

        PLSYPredictorAllLV(x, self.mpls, pscores_, py_)
        pscores = mx.MatrixToList(pscores_)
        py = mx.MatrixToList(py_)
        mx.DelMatrix(x)
        del x
        mx.DelMatrix(pscores_)
        del pscores_
        mx.DelMatrix(py_)
        del py_
        return py, pscores
Esempio n. 2
0
    def reconstruct_original_matrix(self, npc_=None, scores_=None):
        npc = None
        if npc_ is None:
            npc = self.npc
        else:
            npc = npc_

        scores = None
        if scores_ is None:
            scores = self.mpca[0].scores
        else:
            scores = scores_

        ivals = mx.initMatrix()
        PCAIndVarPredictor(scores, self.mpca[0].loadings,
                           self.mpca[0].colaverage, self.mpca[0].colscaling,
                           npc, ivals)
        omx = mx.MatrixToList(ivals)
        mx.DelMatrix(ivals)
        del ivals
        return omx
Esempio n. 3
0
 def get_weights(self):
     return mx.MatrixToList(self.mpls[0].xweights)
Esempio n. 4
0
 def get_qloadings(self):
     return mx.MatrixToList(self.mpls[0].yloadings)
Esempio n. 5
0
 def get_uscores(self):
     return mx.MatrixToList(self.mpls[0].yscores)
Esempio n. 6
0
 def get_loadings(self):
     return mx.MatrixToList(self.mpca[0].loadings)
Esempio n. 7
0
 def get_scores(self):
     return mx.MatrixToList(self.mpca[0].scores)