Esempio n. 1
0
    def U_calc(self):
        """generates the u matrix with the help of intersection of the C and R matrix found by 
		   selecting rows and columns randomly with a certaing probability associated with the 
		   					selection of that row or column"""
        self.ucal = self.R[:, self.c]
        svd = SVD()
        svd.Ucalc(self.ucal, self.ucal.transpose())
        svd.Vcalc(self.ucal, self.ucal.transpose())
        svd.Sigma()

        sigma = svd.sigma

        for i in range(0, max(svd.rank_u, svd.rank_v)):
            if sigma[i, i] != 0:
                sigma[i, i] = (1 / sigma[i, i])

        self.U = (svd.V.transpose()) * (sigma) * (sigma) * (svd.U.transpose())