Skip to content

Errors in the code #1

@nikhilteja91

Description

@nikhilteja91

I am running the "test_quantile.py", where I am getting the following array errors. I a, running the code in Python 3.8 in Windows 10.
Could you please help me out?

______________________________ ERROR collecting pyquantregForest/tests/test_quantile.py _______________________________
tests\test_quantile.py:29: in
quantiles = quantForest.compute_quantile(x, alpha, do_optim=True)
pyquantregForest.py:221: in compute_quantile
X_nodes = self.get_nodes(X, i_tree)
pyquantregForest.py:156: in get_nodes
X_nodes = self.apply(X[0]).transpose()
....\sklearn\ensemble_forest.py:228: in apply
X = self._validate_X_predict(X)
....\sklearn\ensemble_forest.py:422: in validate_X_predict
return self.estimators
[0]._validate_X_predict(X, check_input=True)
....\sklearn\tree_classes.py:407: in _validate_X_predict
X = self._validate_data(X, dtype=DTYPE, accept_sparse="csr",
....\sklearn\base.py:421: in _validate_data
X = check_array(X, **check_params)
....\sklearn\utils\validation.py:63: in inner_f
return f(*args, **kwargs)
....\sklearn\utils\validation.py:687: in check_array
raise ValueError(
E ValueError: Expected 2D array, got scalar array instead:
E array=3.0.
E 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.
==================== warnings summary ================================
....\pyreadline\py3k_compat.py:8
C:\Users\user\anaconda3\lib\site-packages\pyreadline\py3k_compat.py:8: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
return isinstance(x, collections.Callable)

....\scipy\fft_init_.py:97
C:\Users\user\anaconda3\lib\site-packages\scipy\fft_init_.py:97: DeprecationWarning: The module numpy.dual is deprecated. Instead of using dual, use the functions directly from numpy or scipy.
from numpy.dual import register_func

....\scipy\special\orthogonal.py:81
....\scipy\special\orthogonal.py:81
C:\Users\user\anaconda3\lib\site-packages\scipy\special\orthogonal.py:81: DeprecationWarning: np.int is a deprecated alias for the builtin int. To silence this warning, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
from numpy import (exp, inf, pi, sqrt, floor, sin, cos, around, int,

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=============== short test summary info ===================================
ERROR tests\test_quantile.py - ValueError: Expected 2D array, got scalar array instead:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions