gbopt/acquisition_functions/eif.py
def _normalize(self):
        """
        Scale Y to the range [0,1].
        Set the max labeled point as a pivot, and set its value to 1.
        Scale the predictions of unlabeled points that is greater than pivot to [0.5, 1].
        Scale the predictions of unlabeled points that it smaller than pivot to [0. 0.5).
        """
        lids = self.graph.lids
        Y = self.graph.Y
        n = Y.shape[0]
        uids = np.delete(np.arange(Y.shape[0]), lids)
        YU = Y[uids]
        YL = Y[lids]

        Y_norm = np.zeros((n))

        pivot = max(YL)
        pivot_id = lids[np.argmax(YL)]
        Y_norm[pivot_id] = 1

        YU_max = max(YU)
        YU_min = min(YU)

        for u in uids:
            if Y[u] >= pivot:
                Y_norm[u] = (Y[u] - pivot) / (YU_max - pivot) * 0.5 + 0.5
            else:
                Y_norm[u] = (pivot - Y[u]) / (pivot - YU_min) * 0.5

        return Y_norm

        Scale Y to the range [0,1].
        Set the max labeled point as a pivot, and set its value to 1.
        Scale the predictions of unlabeled points that is greater than pivot to [0.5, 1].
        Scale the predictions of unlabeled points that it smaller than pivot to [0. 0.5).
        
Scale Y to the range [0,1].
Set the max labeled point as a pivot, and set its value to 1.
Scale the predictions of unlabeled points that is greater than pivot to [0.5, 1].
Scale the predictions of unlabeled points that it smaller than pivot to [0.
Scale Y to the range [ 0 1 ] . Set the max labeled point as a pivot and set its value to 1 . Scale the predictions of unlabeled points that is greater than pivot to [ 0 . 5 1 ] . Scale the predictions of unlabeled points that it smaller than pivot to [ 0 .
def _normalize(self):
        lids = self.graph.lids
        Y = self.graph.Y
        n = Y.shape[0]
        uids = np.delete(np.arange(Y.shape[0]), lids)
        YU = Y[uids]
        YL = Y[lids]
        Y_norm = np.zeros((n))
        pivot = max(YL)
        pivot_id = lids[np.argmax(YL)]
        Y_norm[pivot_id] = 1
        YU_max = max(YU)
        YU_min = min(YU)
        for u in uids:
            if Y[u] >= pivot:
                Y_norm[u] = (Y[u] - pivot) / (YU_max - pivot) * 0.5 + 0.5
            else:
                Y_norm[u] = (pivot - Y[u]) / (pivot - YU_min) * 0.5
        return Y_norm
def _normalize ( self ) : lids = self . graph . lids Y = self . graph . Y n = Y . shape [ 0 ] uids = np . delete ( np . arange ( Y . shape [ 0 ] ) , lids ) YU = Y [ uids ] YL = Y [ lids ] Y_norm = np . zeros ( ( n ) ) pivot = max ( YL ) pivot_id = lids [ np . argmax ( YL ) ] Y_norm [ pivot_id ] = 1 YU_max = max ( YU ) YU_min = min ( YU ) for u in uids : if Y [ u ] >= pivot : Y_norm [ u ] = ( Y [ u ] - pivot ) / ( YU_max - pivot ) * 0.5 + 0.5 else : Y_norm [ u ] = ( pivot - Y [ u ] ) / ( pivot - YU_min ) * 0.5 return Y_norm
Scale Y to the range [0,1].
Scale Y to the range [ 0 1 ] .
"""
        Scale Y to the range [0,1].
        Set the max labeled point as a pivot, and set its value to 1.
        Scale the predictions of unlabeled points that is greater than pivot to [0.5, 1].
        Scale the predictions of unlabeled points that it smaller than pivot to [0. 0.5).
        """
self