0

Kindly help through this mess, I cant get what the issue behind this error is.

enter image description here

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • check your data for factor variables with only one level, e.g. lapply(train, nevels) – MichaelChirico May 08 '22 at 21:00
  • or similarly for string columns: lengths(lapply(Filter(is.character, train), unique)) – MichaelChirico May 08 '22 at 21:02
  • try 'binomial' instead of binomial only – cnp May 08 '22 at 21:12
  • Welcome to Stack Overflow! Can you please post your code in a text format rather than as a (link to) an image? Images are unsearchable and inaccessible to people using screen readers ... A [mcve] would be nice, but in the absence of that could you please also edit your question to include the output of `str(train)`? See also: https://stackoverflow.com/questions/49083065/contrasts-can-only-be-applied-to-factors-with-at-least-two-levels – Ben Bolker May 08 '22 at 21:19
  • If the linked answer does *not* answer your question, please edit your question to explain how your problem differs, and high-rep users can vote to re-open it ... – Ben Bolker May 08 '22 at 21:23

0 Answers0