Skip to content

Instantly share code, notes, and snippets.

@LouisdeBruijn
Created March 11, 2020 14:55
Show Gist options
  • Select an option

  • Save LouisdeBruijn/0de885fa43d4d36129fce2838cf2641b to your computer and use it in GitHub Desktop.

Select an option

Save LouisdeBruijn/0de885fa43d4d36129fce2838cf2641b to your computer and use it in GitHub Desktop.
def baseline_classifier(Xtest, Ytest):
"""Baseline by randomly assigning a label to each document."""
label_list = [label for label in set(Ytest)] # random.choice cannot index a set, so needs to be a list
baseline = [random.choice(label_list) for sent in Xtest]
return baseline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment