Hello,
When trying to process a float features between 0-1 with a special value of -1, the following error occurred during preprocessing
2025-06-22 18:51:15,698 P219 INFO Processing column: {'active': True, 'dtype': 'float', 'name': 'Feature_Ratio', 'type': 'categorical', 'category_processor': 'quantile_bucket', 'num_buckets': 35, 'embedding_dim': 15} Traceback (most recent call last): .... File "/fuxictr/preprocess/build_dataset.py", line 103, in build_dataset feature_encoder.fit(train_ddf, rebuild_dataset=True, **kwargs) File "/fuxictr/preprocess/feature_processor.py", line 152, in fit self.fit_categorical_col(col, col_series, File "/fuxictr/preprocess/feature_processor.py", line 286, in fit_categorical_col qtf.fit(col_series.values) File "/opt/conda/lib/python3.10/site-packages/sklearn/base.py", line 1151, in wrapper return fit_method(estimator, *args, **kwargs) File "/opt/conda/lib/python3.10/site-packages/sklearn/preprocessing/_data.py", line 2663, in fit X = self._check_inputs(X, in_fit=True, copy=False) File "/opt/conda/lib/python3.10/site-packages/sklearn/preprocessing/_data.py", line 2752, in _check_inputs X = self._validate_data( File "/opt/conda/lib/python3.10/site-packages/sklearn/base.py", line 604, in _validate_data out = check_array(X, input_name="X", **check_params) File "/opt/conda/lib/python3.10/site-packages/sklearn/utils/validation.py", line 940, in check_array raise ValueError( ValueError: Expected 2D array, got 1D array instead: array=[-1. -1. -1. ... -1. -1. -1.]. 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.
As far as I understood the QuantileTransformer requires 2d data, but we are feeding it column data during fit. Reshaping the column would require changes at transform function as well. Is there a way to perform quantile transformation in an easier way, or something that I am missing?
Thanks!
Hello,
When trying to process a float features between 0-1 with a special value of -1, the following error occurred during preprocessing
2025-06-22 18:51:15,698 P219 INFO Processing column: {'active': True, 'dtype': 'float', 'name': 'Feature_Ratio', 'type': 'categorical', 'category_processor': 'quantile_bucket', 'num_buckets': 35, 'embedding_dim': 15} Traceback (most recent call last): .... File "/fuxictr/preprocess/build_dataset.py", line 103, in build_dataset feature_encoder.fit(train_ddf, rebuild_dataset=True, **kwargs) File "/fuxictr/preprocess/feature_processor.py", line 152, in fit self.fit_categorical_col(col, col_series, File "/fuxictr/preprocess/feature_processor.py", line 286, in fit_categorical_col qtf.fit(col_series.values) File "/opt/conda/lib/python3.10/site-packages/sklearn/base.py", line 1151, in wrapper return fit_method(estimator, *args, **kwargs) File "/opt/conda/lib/python3.10/site-packages/sklearn/preprocessing/_data.py", line 2663, in fit X = self._check_inputs(X, in_fit=True, copy=False) File "/opt/conda/lib/python3.10/site-packages/sklearn/preprocessing/_data.py", line 2752, in _check_inputs X = self._validate_data( File "/opt/conda/lib/python3.10/site-packages/sklearn/base.py", line 604, in _validate_data out = check_array(X, input_name="X", **check_params) File "/opt/conda/lib/python3.10/site-packages/sklearn/utils/validation.py", line 940, in check_array raise ValueError( ValueError: Expected 2D array, got 1D array instead: array=[-1. -1. -1. ... -1. -1. -1.]. 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.As far as I understood the QuantileTransformer requires 2d data, but we are feeding it column data during fit. Reshaping the column would require changes at transform function as well. Is there a way to perform quantile transformation in an easier way, or something that I am missing?
Thanks!