Skip to content

Found array with 0 feature(s) (shape=(16752, 0)) while a minimum of 1 is required. #20

Description

@xsun1229

Hi PoPs team,

I encountered an error when replacing the example features with my own. My feature matrix is a binary (gene-by-GO terms) matrix derived from GO membership data. All other inputs remain the same as in the tutorial example.

python pops.py  --gene_annot_path example/data/utils/gene_annot_jun10.txt  \
--feature_mat_prefix GO/test  \
--num_feature_chunks 2  \
--magma_prefix example/data/magma_scores/PASS_Schizophrenia  \
--out_prefix LDL

However, I received the following error:

Traceback (most recent call last):
  File "pops.py", line 912, in <module>
    main(config_dict)
  File "pops.py", line 876, in main
    coefs_df = compute_coefficients(X_train, Y_train, cols, config_dict["method"], config_dict["random_seed"])
  File "pops.py", line 623, in compute_coefficients
    reg.fit(X_train, Y_train)
  File "/software/python-anaconda-2020.02-el7-x86_64/lib/python3.7/site-packages/sklearn/linear_model/_ridge.py", line 2030, in fit
    estimator.fit(X, y, sample_weight=sample_weight)
  File "/software/python-anaconda-2020.02-el7-x86_64/lib/python3.7/site-packages/sklearn/linear_model/_ridge.py", line 1834, in fit
    y_numeric=True,
  File "/software/python-anaconda-2020.02-el7-x86_64/lib/python3.7/site-packages/sklearn/base.py", line 581, in _validate_data
    X, y = check_X_y(X, y, **check_params)
  File "/software/python-anaconda-2020.02-el7-x86_64/lib/python3.7/site-packages/sklearn/utils/validation.py", line 976, in check_X_y
    estimator=estimator,
  File "/software/python-anaconda-2020.02-el7-x86_64/lib/python3.7/site-packages/sklearn/utils/validation.py", line 817, in check_array
    % (n_features, array.shape, ensure_min_features, context)
ValueError: Found array with 0 feature(s) (shape=(16752, 0)) while a minimum of 1 is required.

Could you help me identify what might be causing this issue? Are there any preprocessing steps I might be missing?

Thanks for your help!

Best,
Xiaotong

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions