question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: X has 9371 features, but StandardScaler is expecting 74698 features as input.

See original GitHub issue

Hi,

When I evaluate a trained discourse parsing model (e.g. using rst_eval rst_discourse_tb_edus_TRAINING_DEV.json -p rst_parsing_model.C1.0 --use_gold_syntax), I encountered the error in the title.

Since the code uses sparse features, my guess is that the set of features in the training and test sets are different.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mufeilicommented, May 27, 2021

Thank you for developing and maintaining such a great tool!

1reaction
desilinguistcommented, May 27, 2021

Interesting! Yes, it could certainly be that it’s a SKLL 2.5 issue since we haven’t really tested rstfinder with that yet.

Glad you have a workaround for now. I will try to replicate the issue on my end and see what changes are required.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sklearn ValueError: X has 2 features per sample; expecting 11
I know that the error is that the model has been trained using 11 functions, but it is envisaged to use 2 functions,...
Read more >
ValueError: X has 1 features, but this StandardScaler is ...
The line that raises the error is pipe.predict_proba(est_arrival_hours) As I can see from your code est_arrival_hours has dimension (n x 1) ...
Read more >
Python Value Error: X has 913 features per sample, expecting 3
I am trying to predict the class of the test input using stacking method but I am getting following error on the predict...
Read more >
X has 2 features, but DecisionTreeClassifier is expecting 5 ...
X has 2 features, but DecisionTreeClassifier is expecting 5 features as input. Hello, I am trying to do a Decision Tree for this...
Read more >
Titanic Data Science Solutions | Kaggle
Which features within the dataset contribute significantly to our solution goal? ... T, ValueError: X has 9 features per sample; expecting 10.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found