예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
 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
예제 #4
0
 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