numpy learning

One-hot labels preprocessing

  • Weighting samples with confidence score

    1
    2
    3
    index = np.ragmax(predicted_result,axis=1)
    arg = np_utils.to_categorical(index,classes)
    weighted_one_hot=predicted_result*arg
  • Selection && weighting samples with confidence score

    1
    weighted_selected_one_hot=np.where(predicted_result>k,predicted_result,0)
  • Extending vector into matrix

    1
    xx = [np.full(classes,value) for value in x]