Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

TEST Add sparse dataset inclusion coverage for row ID and ignore attributes.

Aperta Adatta ai principianti
#1,749 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
data, testing

Direzione di ricerca

Inizia in tests/test_datasets/test_dataset.py, in OpenMLDatasetTestSparse::test_get_sparse_dataset_rowid_and_ignore_and_target. Esegui il comando pytest mirato indicato nell’issue, quindi esamina i controlli di esclusione esistenti e il comportamento di inclusione richiesto. Il lavoro è completato quando il test copre entrambe le modalità e verifica la forma restituita, gli indicatori categoriali e la forma del target.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description :-

This PR improves the regression test coverage for sparse dataset retrieval when row ID and ignored attributes are configured for the dataset.

The existing test already defined a row ID attribute and an ignored attribute, but the retrieval operation was performed with both inclusion options disabled. As a result, the test confirmed that these attributes were excluded from the returned feature data, but it did not verify what happens when a caller explicitly requests them.

This change extends the test so that the inclusion behaviour is also checked. The dataset is retrieved with both include_row_id=True and include_ignore_attribute=True, allowing the test to verify that the additional attributes are correctly represented in the returned feature matrix.

The new assertions also check the dimensions of the returned data and the associated categorical information. This ensures that the test does not only execute successfully, but also confirms that the returned dataset has the expected structure.

Changes :-

  1. Extended the existing sparse dataset test to cover the case where row ID attributes are explicitly included in the returned features.

  2. Added coverage for retrieving attributes that were previously marked as ignored by using include_ignore_attribute=True

  3. Verified that enabling both inclusion options results in a feature matrix with the expected shape (600, 20000)

  4. Added a check for the length of the categorical indicator list to ensure it corresponds to all 20,000 returned features.

  5. Verified that every categorical indicator is False, matching the expected characteristics of the returned sparse dataset.

  6. Added an assertion for the target data to confirm that the returned target has the expected shape (600,)

  7. Kept the existing exclusion behaviour covered so that the test continues to validate both inclusion and exclusion scenarios.
    Testing

The updated sparse dataset test was executed using the following command:

bash
pytest tests/test_datasets/test_dataset.py::OpenMLDatasetTestSparse::test_get_sparse_dataset_rowid_and_ignore_and_target

Lingua principale
Python
Stelle
361
Fork
296
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openml/openml-python

Tutte le issue di openml/openml-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.