Skip to content

Conversation

@nvavrock
Copy link

Problem

The original app was throwing the following error during model training:
Error in y - ymean : non-numeric argument to binary operator

This occurred because the play, outlook, and windy columns were being read as characters rather than factors, which randomForest requires for classification.

Changes

  • Added stringsAsFactors = FALSE to read.csv.
  • Explicitly converted play, outlook, and windy to factors (Lines 23-25).
  • Refactored the datasetInput reactive expression in the server to ensure input data types match the training data levels exactly.

Fixed bug related to non-numeric argument in prediction process by ensuring correct data types for input variables. Refactored the datasetInput reactive expression for better clarity and efficiency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant