Lime: Explaining the predictions of any machine learning classifier
BSD 2-Clause "Simplified" License
11.64k
stars
1.81k
forks
source link
ValueError: Found input variables with inconsistent numbers of samples: [5000, 20000] ? how does this occur is soemthing wrong with my tokeniser ? #725
so i had to covert a 3d array to a 2d one, how ever the code breaks here, as i understand 5000 is the num_samples given i don't understand where the 20000 is coming from and why it breaking the runtime
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\achin\AppData\Local\Programs\Python\Python311\Lib\site-packages\lime\lime_base.py", line 136, in feature_selection return self.feature_selection(data, labels, weights, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\achin\AppData\Local\Programs\Python\Python311\Lib\site-packages\lime\lime_base.py", line 82, in feature_selection clf.fit(data, labels, sample_weight=weights) File "C:\Users\achin\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\base.py", line 1151, in wrapper return fit_method(estimator, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\achin\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\linear_model\_ridge.py", line 1134, in fit X, y = self._validate_data( ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\achin\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\base.py", line 621, in _validate_data X, y = check_X_y(X, y, **check_params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\achin\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\utils\validation.py", line 1166, in check_X_y check_consistent_length(X, y) File "C:\Users\achin\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\utils\validation.py", line 410, in check_consistent_length raise ValueError( ValueError: Found input variables with inconsistent numbers of samples: [5000, 20000]
so i had to covert a 3d array to a 2d one, how ever the code breaks here, as i understand 5000 is the num_samples given i don't understand where the 20000 is coming from and why it breaking the runtime
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\achin\AppData\Local\Programs\Python\Python311\Lib\site-packages\lime\lime_base.py", line 136, in feature_selection return self.feature_selection(data, labels, weights, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\achin\AppData\Local\Programs\Python\Python311\Lib\site-packages\lime\lime_base.py", line 82, in feature_selection clf.fit(data, labels, sample_weight=weights) File "C:\Users\achin\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\base.py", line 1151, in wrapper return fit_method(estimator, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\achin\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\linear_model\_ridge.py", line 1134, in fit X, y = self._validate_data( ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\achin\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\base.py", line 621, in _validate_data X, y = check_X_y(X, y, **check_params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\achin\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\utils\validation.py", line 1166, in check_X_y check_consistent_length(X, y) File "C:\Users\achin\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\utils\validation.py", line 410, in check_consistent_length raise ValueError( ValueError: Found input variables with inconsistent numbers of samples: [5000, 20000]