Skip to main content

A package that will automatically determine the dataset scheme/format for a UCI dataset, and import it to the best of its ability. Preserves the UCI Python import API. Please see https://github.com/ArnaoutLab/Lucie

Project description

Lucie

A Python package that will automatically import un-importable datasets on the UCI ML repository, by using heuristics to figure out how each dataset is likely to be laid out. Our package name "Lucie" is inspired by its function: loading UCI repos

Preserves the UCIML API to the best of its ability, with one minor change (see below).

Succeeds on 95.4% of the top 250 datasets, and includes manually cleaned datasets to allow all top 100 datasets to be imported.

GitHub: https://github.com/ArnaoutLab/Lucie

PyPI Package: pip install lucie

ArXiV Paper:

Usage and API Changes

For previously importable datasets, we have one minor change: instead of returning the dataset itself, this program will return a tuple, with the first element indicating the dataset format, and the second representing the dataset.

Example:

from lucie import fetch_ucirepo 
# fetch dataset 
- iris = fetch_ucirepo(id=53)
+ iris = fetch_ucirepo(id=53)[1]
# data (as pandas dataframes) 
X = iris.data.features 
y = iris.data.targets 
  
# metadata 
print(iris.metadata) 

# variable information 
print(iris.variables) 

For datasets that were previously not importable, but are importable via lucie, we return a dictionary, with keys representing filenames and values representing the associated Pandas dataframe. For example:

from lucie import fetch_ucirepo
diabetes = fetch_ucirepo(name='diabetes')
print(diabetes)

"""
output is:
('custom',
 {'diabetes_complete.tsv':
  0      04-21-1991   9:09  33  009
  1      04-21-1991   9:09  34  013
  2      04-21-1991  17:08  62  119
  3      04-21-1991  17:08  33  007
  ...
 }
)
"""

print(diabetes[1]['diabetes_complete.tsv'])

"""
output is:
0      04-21-1991   9:09  33  009
1      04-21-1991   9:09  34  013
2      04-21-1991  17:08  62  119
3      04-21-1991  17:08  33  007
4      04-21-1991  22:51  48  123
...    ...          ...   .. ...
[29329 rows x 4 columns]
"""

In some rare cases, we instead return a JSON dictionary representing the directory structure. However, in practice we did not encounter this in any of the top 250 datasets. If you would like to see how that API would work, we have created a bogus dataset to test this functionality. You can try it by running this script:

from lucie import extract_and_get_path

extract_and_get_path('bogus_sets/bogus_json.zip') # bogus json dataset

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lucie-1.0.2.tar.gz (225.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lucie-1.0.2-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file lucie-1.0.2.tar.gz.

File metadata

  • Download URL: lucie-1.0.2.tar.gz
  • Upload date:
  • Size: 225.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.12

File hashes

Hashes for lucie-1.0.2.tar.gz
Algorithm Hash digest
SHA256 449aa5e90c4149d7863a00f3a4ed3ececb4793d58e86e0573d5a22cba7b5ebe5
MD5 4da3fe60a7042ac1e7ea66225e3db0ef
BLAKE2b-256 d8085e92f79355a742c74eb5bcfb90b35fb7aa24ede217c88dcd61143add991c

See more details on using hashes here.

File details

Details for the file lucie-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: lucie-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.12

File hashes

Hashes for lucie-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bd62b38f721bf5182194f8872b0fda0336a745a4ffbba6c61a9b0ca9a88acbef
MD5 06e065736b58fc5b41835c01de313268
BLAKE2b-256 dd7a865bf8589f208fb47202c9c9adab357a8e7618a8b307ed589ad3fc016553

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page