Guest User

Untitled

a guest
Apr 9th, 2022
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. ValueError Traceback (most recent call last)
  2. ~\AppData\Local\Temp/ipykernel_11092/4166757493.py in <module>
  3. 1 from sklearn import preprocessing
  4. 2
  5. ----> 3 scaler = preprocessing.StandardScaler().fit(SXtrain)
  6. 4
  7. 5 """Scale the smaller training set"""
  8.  
  9. ~\anaconda3\lib\site-packages\sklearn\preprocessing\_data.py in fit(self, X, y, sample_weight)
  10. 728 # Reset internal state before fitting
  11. 729 self._reset()
  12. --> 730 return self.partial_fit(X, y, sample_weight)
  13. 731
  14. 732 def partial_fit(self, X, y=None, sample_weight=None):
  15.  
  16. ~\anaconda3\lib\site-packages\sklearn\preprocessing\_data.py in partial_fit(self, X, y, sample_weight)
  17. 764 """
  18. 765 first_call = not hasattr(self, "n_samples_seen_")
  19. --> 766 X = self._validate_data(X, accept_sparse=('csr', 'csc'),
  20. 767 estimator=self, dtype=FLOAT_DTYPES,
  21. 768 force_all_finite='allow-nan', reset=first_call)
  22.  
  23. ~\anaconda3\lib\site-packages\sklearn\base.py in _validate_data(self, X, y, reset, validate_separately, **check_params)
  24. 419 out = X
  25. 420 elif isinstance(y, str) and y == 'no_validation':
  26. --> 421 X = check_array(X, **check_params)
  27. 422 out = X
  28. 423 else:
  29.  
  30. ~\anaconda3\lib\site-packages\sklearn\utils\validation.py in inner_f(*args, **kwargs)
  31. 61 extra_args = len(args) - len(all_args)
  32. 62 if extra_args <= 0:
  33. ---> 63 return f(*args, **kwargs)
  34. 64
  35. 65 # extra_args > 0
  36.  
  37. ~\anaconda3\lib\site-packages\sklearn\utils\validation.py in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, estimator)
  38. 692 # If input is 1D raise error
  39. 693 if array.ndim == 1:
  40. --> 694 raise ValueError(
  41. 695 "Expected 2D array, got 1D array instead:\narray={}.\n"
  42. 696 "Reshape your data either using array.reshape(-1, 1) if "
  43.  
  44. ValueError: Expected 2D array, got 1D array instead:
  45. array=[8.21304911e-01 1.44999358e-37 8.76388929e-01].
  46. Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
Advertisement
Add Comment
Please, Sign In to add comment