Advertisement
john_1726

Untitled

Jun 27th, 2022
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. ---------------------------------------------------------------------------
  2. ValueError Traceback (most recent call last)
  3. D:\Users\psalm\AppData\Local\Temp/ipykernel_41176/1930297868.py in <module>
  4. 14 print("Performance of kNN regressor with n = 10")
  5. 15 breast_cancer_y_pred = knn_10_regr.predict(x_test)
  6. ---> 16 print("Mean squared error: %.2f" % mean_squared_error(y_test, breast_cancer_y))
  7. 17 print("Coefficient of determination: %.2f" % r2_score(y_test, breast_cancer_y))
  8. 18 print()
  9.  
  10. C:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\validation.py in inner_f(*args, **kwargs)
  11. 61 extra_args = len(args) - len(all_args)
  12. 62 if extra_args <= 0:
  13. ---> 63 return f(*args, **kwargs)
  14. 64
  15. 65 # extra_args > 0
  16. C:\ProgramData\Anaconda3\lib\site-packages\sklearn\metrics\_regression.py in mean_squared_error(y_true, y_pred, sample_weight, multioutput, squared)
  17. 333 0.825...
  18. 334 """
  19. --> 335 y_type, y_true, y_pred, multioutput = _check_reg_targets(
  20. 336 y_true, y_pred, multioutput)
  21. 337 check_consistent_length(y_true, y_pred, sample_weight)
  22. C:\ProgramData\Anaconda3\lib\site-packages\sklearn\metrics\_regression.py in _check_reg_targets(y_true, y_pred, multioutput, dtype)
  23. 86 the dtype argument passed to check_array.
  24. 87 """
  25. ---> 88 check_consistent_length(y_true, y_pred)
  26. 89 y_true = check_array(y_true, ensure_2d=False, dtype=dtype)
  27. 90 y_pred = check_array(y_pred, ensure_2d=False, dtype=dtype)
  28.  
  29. C:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\validation.py in check_consistent_length(*arrays)
  30. 317 uniques = np.unique(lengths)
  31. 318 if len(uniques) > 1:
  32. --> 319 raise ValueError("Found input variables with inconsistent numbers of"
  33. 320 " samples: %r" % [int(l) for l in lengths])
  34. 321
  35.  
  36. ValueError: Found input variables with inconsistent numbers of samples: [114, 569]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement