Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatch in Feature Names Between Classifier's Training and Prediction Phases #17

Open
rakshit-upadhyay214 opened this issue Oct 3, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@rakshit-upadhyay214
Copy link

issue

While using the model for classification, a ValueError is raised due to a mismatch between the feature names used during the training phase (fit) and those passed during the inference phase (predict). The features passed at prediction time have inconsistent names compared to those seen during training.

Steps to Reproduce:

  1. Load the trained RF_mining_model.pkl .
  2. Attempt to make predictions using test data obtained from the original dataset's train-test split.
  3. Observe the ValueError due to mismatched feature names.

Expected Behavior: The feature names should match and remain consistent throughout.

Proposed Solution: Training classifier model against the exact feature names as they appear in the dataset.

Copy link

github-actions bot commented Oct 3, 2024

👋 Thank you for raising an issue! We appreciate your effort in helping us improve. Our team will review it shortly. Stay tuned!

@Devanik21
Copy link
Owner

Can you specify which model is it ?
GBoost or RForest

@Devanik21 Devanik21 self-assigned this Oct 3, 2024
@Devanik21 Devanik21 added the bug Something isn't working label Oct 3, 2024
@rakshit-upadhyay214
Copy link
Author

It was Random Forest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants