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.

Mismatched lists length when using predict function

See original GitHub issue

I tried to use the model.predict() function. The length of the input list (of strings) is 400, yet the length of predictions is only 320. May I know what is wrong? Besides, would you please add accuracy and f1 score as default metrics too? Thanks!

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
wshuyicommented, Oct 15, 2019

Worked perfectly this time. Thanks a lot!

0reactions
ThilinaRajapaksecommented, Oct 12, 2019

Oh, I got it. I wasn’t able to reproduce the issue because I was using reprocess_input_data = True.

Is there any probability that when I called predict, instead of using test set I input, the model still memorized and used valid set?

This was exactly what was going on. The predict function was picking up on the cached evaluate features. I think it should be fixed now. Can you try it and let me know, please?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Receiving a "Variable Lengths Differ" error in predict
The issue is that you're trying to call predict with a newdata argument that does not contain all of the variables used in...
Read more >
Problem when using predict() with different number of rows in ...
The problem you have is produced by the way you used the formula. Notice in your summary that your variables have names which...
Read more >
Obtain predictions, residuals, etc., after estimation - Stata
Exactly what predict can do is determined by the previous estimation command; command-specific options are documented with each estimation command. Regardless ...
Read more >
15.2 Linear regression with lm() - YaRrr! The Pirate's Guide to R
Once you have created a regression model with lm() , you can use it to easily predict results from new datasets using the...
Read more >
Excel FORECAST functions with formula examples - Ablebits
SEASONALITY - calculates the length of a seasonal or other recurring pattern. ETS.STAT - returns statistical values for time series forecasting.
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