def computeRealizedRelationshipKernel(self,genotype=None): X = zeroMeanUnitVarianz(data=genotype) K = 1.0/X.shape[1]*sp.dot(X,X.T) #if K contains negative values set these values to 0 ind = sp.where(K<0) K[ind] = 0 return K
def computeRealizedRelationshipKernel(self, genotype=None): X = zeroMeanUnitVarianz(data=genotype) K = 1.0 / X.shape[1] * sp.dot(X, X.T) #if K contains negative values set these values to 0 ind = sp.where(K < 0) K[ind] = 0 return K
def transformData(self,data=None,transformation="none"): data = data.flatten() if transformation=="zeroMean": return zeroMean(data) elif transformation=="unitVariance": return zeroMeanUnitVarianz(data) elif transformation=="sqrt": return sqrtTransformation(data) elif transformation=="log10": return logTransformation(data) elif transformation=="boxcox": new_data = boxcoxTransformation(data) if new_data.sum()==data.sum(): self.__transformed = False else: self.__transformed = True return new_data elif transformation=="dummyVariable": return createDummyVariables(data) else: return data
def transformData(self, data=None, transformation="none"): data = data.flatten() if transformation == "zeroMean": return zeroMean(data) elif transformation == "unitVariance": return zeroMeanUnitVarianz(data) elif transformation == "sqrt": return sqrtTransformation(data) elif transformation == "log10": return logTransformation(data) elif transformation == "boxcox": new_data = boxcoxTransformation(data) if new_data.sum() == data.sum(): self.__transformed = False else: self.__transformed = True return new_data elif transformation == "dummyVariable": return createDummyVariables(data) else: return data