def representativeness(S): #入力: getDistances()のデータ要素# #return representativeness objectiveness# tempDMat = S.getDistances() norm = tempDMat.mean() return (lambda X: (1 - ex.kmedoid_loss(X, tempDMat, float(norm))))
def uniformity(S): ''' Based on representativeness_shell implementation in 'example_objectives.py' :input S: DataElement with function getChrDistances() :return: uniformity objective ''' tempDMat = S.getChrDistances() norm = tempDMat.mean() return (lambda X: (1 - ex.kmedoid_loss(X, tempDMat, float(norm))))
def representativeness_shell_y(S): ''' Representativeness shell Eq. (8) :param S: DataElement with function getDistances() :return: representativeness objective ''' tempDMat=S.getDistancesY() norm=tempDMat.mean() return (lambda X: (1 - ex.kmedoid_loss(X,tempDMat,float(norm))))
def representativeness_shell_y(S): ''' Representativeness shell Eq. (8) :param S: DataElement with function getDistances() :return: representativeness objective ''' tempDMat = S.getDistancesY() norm = tempDMat.mean() return (lambda X: (1 - ex.kmedoid_loss(X, tempDMat, float(norm))))
def uniformity(S): #入力:S(getChrDistance()のデータ要素)# #return: uniformity objective# tempDMat = S.getChrDistances() norm = tempDMat.mean() return (lambda X: (1 - ex.kmedoid_loss(X, tempDMat, float(norm))))