code/Missing_info/main.py
def custom_label(y, strategy='one_hot'):
    'This function generates the labels based on input strategies, one hot, reg'
    print('labeling stragey is', strategy)
    y_shape = y.shape
    num_classes = y_shape[1]
    if strategy == 'one_hot':
        for i in range(0,y_shape[0]):
            thisOutputs = y[i,:]
            # logOut = 20*np.log10(thisOutputs)
            max_index = thisOutputs.argsort()[-1:][::-1]  # For one hot encoding we need the best one
            y[i,:] = 0
            y[i,max_index] = 1

    elif strategy == 'reg':
        for i in range(0,y_shape[0]):
            thisOutputs = y[i,:]
            # logOut = 20*np.log10(thisOutputs)   # old version
            logOut = thisOutputs
            y[i,:] = logOut
    else:
        print('Invalid strategy')
    return y,num_classes
This function generates the labels based on input strategies, one hot, reg
This function generates the labels based on input strategies, one hot, reg
This function generates the labels based on input strategies one hot reg
def custom_label(y, strategy='one_hot'):
    print('labeling stragey is', strategy)
    y_shape = y.shape
    num_classes = y_shape[1]
    if strategy == 'one_hot':
        for i in range(0,y_shape[0]):
            thisOutputs = y[i,:]
            max_index = thisOutputs.argsort()[-1:][::-1]  
            y[i,:] = 0
            y[i,max_index] = 1
    elif strategy == 'reg':
        for i in range(0,y_shape[0]):
            thisOutputs = y[i,:]
               # old version
            logOut = thisOutputs
            y[i,:] = logOut
    else:
        print('Invalid strategy')
    return y,num_classes
def custom_label ( y , strategy = 'one_hot' ) : print ( 'labeling stragey is' , strategy ) y_shape = y . shape num_classes = y_shape [ 1 ] if strategy == 'one_hot' : for i in range ( 0 , y_shape [ 0 ] ) : thisOutputs = y [ i , : ] max_index = thisOutputs . argsort ( ) [ - 1 : ] [ : : - 1 ] y [ i , : ] = 0 y [ i , max_index ] = 1 elif strategy == 'reg' : for i in range ( 0 , y_shape [ 0 ] ) : thisOutputs = y [ i , : ] logOut = thisOutputs y [ i , : ] = logOut else : print ( 'Invalid strategy' ) return y , num_classes
This function generates the labels based on input strategies, one hot, reg
This function generates the labels based on input strategies one hot reg
'This function generates the labels based on input strategies, one hot, reg' # logOut = 20*np.log10(thisOutputs) # For one hot encoding we need the best one # logOut = 20*np.log10(thisOutputs)   # old version
y
strategy