Skip to content

Instantly share code, notes, and snippets.

View mohannishant6's full-sized avatar

Nishant Mohan mohannishant6

  • HelloFresh SE
  • Berlin
View GitHub Profile
def target_encode_multiclass(X,y): #X,y are pandas df and series
y=y.astype(str) #convert to string to onehot encode
enc=ce.OneHotEncoder().fit(y)
y_onehot=enc.transform(y)
class_names=y_onehot.columns #names of onehot encoded columns
X_obj=X.select_dtypes('object') #separate categorical columns
@mohannishant6
mohannishant6 / random_guess_log_loss.ipynb
Last active October 4, 2020 11:28
random guessing log loss
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.