datasets
OpenMLDataFeature
¶
Data Feature (a.k.a. Attribute) object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index
|
int
|
The index of this feature |
required |
name
|
str
|
Name of the feature |
required |
data_type
|
str
|
can be nominal, numeric, string, date (corresponds to arff) |
required |
nominal_values
|
list(str)
|
list of the possible values, in case of nominal attribute |
required |
number_missing_values
|
int
|
Number of rows that have a missing value for this feature. |
required |
ontologies
|
list(str)
|
list of ontologies attached to this feature. An ontology describes the concept that are described in a feature. An ontology is defined by an URL where the information is provided. |
None
|
Source code in openml/datasets/data_feature.py
OpenMLDataset
¶
Bases: OpenMLBase
Dataset object.
Allows fetching and uploading datasets to OpenML.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the dataset. |
required |
description
|
str
|
Description of the dataset. |
required |
data_format
|
str
|
Format of the dataset which can be either 'arff' or 'sparse_arff'. |
'arff'
|
cache_format
|
str
|
Format for caching the dataset which can be either 'feather' or 'pickle'. |
'pickle'
|
dataset_id
|
int
|
Id autogenerated by the server. |
None
|
version
|
int
|
Version of this dataset. '1' for original version. Auto-incremented by server. |
None
|
creator
|
str
|
The person who created the dataset. |
None
|
contributor
|
str
|
People who contributed to the current version of the dataset. |
None
|
collection_date
|
str
|
The date the data was originally collected, given by the uploader. |
None
|
upload_date
|
str
|
The date-time when the dataset was uploaded, generated by server. |
None
|
language
|
str
|
Language in which the data is represented. Starts with 1 upper case letter, rest lower case, e.g. 'English'. |
None
|
licence
|
str
|
License of the data. |
None
|
url
|
str
|
Valid URL, points to actual data file. The file can be on the OpenML server or another dataset repository. |
None
|
default_target_attribute
|
str
|
The default target attribute, if it exists. Can have multiple values, comma separated. |
None
|
row_id_attribute
|
str
|
The attribute that represents the row-id column, if present in the dataset. |
None
|
ignore_attribute
|
str | list
|
Attributes that should be excluded in modelling, such as identifiers and indexes. |
None
|
version_label
|
str
|
Version label provided by user. Can be a date, hash, or some other type of id. |
None
|
citation
|
str
|
Reference(s) that should be cited when building on this data. |
None
|
tag
|
str
|
Tags, describing the algorithms. |
None
|
visibility
|
str
|
Who can see the dataset. Typical values: 'Everyone','All my friends','Only me'. Can also be any of the user's circles. |
None
|
original_data_url
|
str
|
For derived data, the url to the original dataset. |
None
|
paper_url
|
str
|
Link to a paper describing the dataset. |
None
|
update_comment
|
str
|
An explanation for when the dataset is uploaded. |
None
|
md5_checksum
|
str
|
MD5 checksum to check if the dataset is downloaded without corruption. |
None
|
data_file
|
str
|
Path to where the dataset is located. |
None
|
features_file
|
dict
|
A dictionary of dataset features, which maps a feature index to a OpenMLDataFeature. |
None
|
qualities_file
|
dict
|
A dictionary of dataset qualities, which maps a quality name to a quality value. |
None
|
dataset
|
str | None
|
Serialized arff dataset string. |
None
|
parquet_url
|
str | None
|
This is the URL to the storage location where the dataset files are hosted. This can be a MinIO bucket URL. If specified, the data will be accessed from this URL when reading the files. |
None
|
parquet_file
|
str | None
|
Path to the local file. |
None
|
Source code in openml/datasets/dataset.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 |
|
features: dict[int, OpenMLDataFeature]
property
¶
Get the features of this dataset.
id: int | None
property
¶
Get the dataset numeric id.
qualities: dict[str, float] | None
property
¶
Get the qualities of this dataset.
get_data(target=None, include_row_id=False, include_ignore_attribute=False, dataset_format='dataframe')
¶
Returns dataset content as dataframes or sparse matrices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target
|
(string, List[str] or None(default=None))
|
Name of target column to separate from the data. Splitting multiple columns is currently not supported. |
None
|
include_row_id
|
boolean(default=False)
|
Whether to include row ids in the returned dataset. |
False
|
include_ignore_attribute
|
boolean(default=False)
|
Whether to include columns that are marked as "ignore" on the server in the dataset. |
False
|
dataset_format
|
string(default='dataframe')
|
The format of returned dataset.
If |
'dataframe'
|
Returns:
Name | Type | Description |
---|---|---|
X |
ndarray, dataframe, or sparse matrix, shape (n_samples, n_columns)
|
Dataset |
y |
(ndarray or Series, shape(n_samples) or None)
|
Target column |
categorical_indicator |
boolean ndarray
|
Mask that indicate categorical features. |
attribute_names |
List[str]
|
List of attribute names. |
Source code in openml/datasets/dataset.py
741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 |
|
get_features_by_type(data_type, exclude=None, exclude_ignore_attribute=True, exclude_row_id_attribute=True)
¶
Return indices of features of a given type, e.g. all nominal features. Optional parameters to exclude various features by index or ontology.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_type
|
str
|
The data type to return (e.g., nominal, numeric, date, string) |
required |
exclude
|
list(int)
|
List of columns to exclude from the return value |
None
|
exclude_ignore_attribute
|
bool
|
Whether to exclude the defined ignore attributes (and adapt the return values as if these indices are not present) |
True
|
exclude_row_id_attribute
|
bool
|
Whether to exclude the defined row id attributes (and adapt the return values as if these indices are not present) |
True
|
Returns:
Name | Type | Description |
---|---|---|
result |
list
|
a list of indices that have the specified data type |
Source code in openml/datasets/dataset.py
retrieve_class_labels(target_name='class')
¶
Reads the datasets arff to determine the class-labels.
If the task has no class labels (for example a regression problem) it returns None. Necessary because the data returned by get_data only contains the indices of the classes, while OpenML needs the real classname when uploading the results of a run.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_name
|
str
|
Name of the target attribute |
'class'
|
Returns:
Type | Description |
---|---|
list
|
|
Source code in openml/datasets/dataset.py
attributes_arff_from_df(df)
¶
Describe attributes of the dataframe according to ARFF specification.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df
|
(DataFrame, shape(n_samples, n_features))
|
The dataframe containing the data set. |
required |
Returns:
Name | Type | Description |
---|---|---|
attributes_arff |
list[str]
|
The data set attributes as required by the ARFF format. |
Source code in openml/datasets/functions.py
check_datasets_active(dataset_ids, raise_error_if_not_exist=True)
¶
Check if the dataset ids provided are active.
Raises an error if a dataset_id in the given list
of dataset_ids does not exist on the server and
raise_error_if_not_exist
is set to True (default).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_ids
|
List[int]
|
A list of integers representing dataset ids. |
required |
raise_error_if_not_exist
|
bool(default=True)
|
Flag that if activated can raise an error, if one or more of the given dataset ids do not exist on the server. |
True
|
Returns:
Type | Description |
---|---|
dict
|
A dictionary with items {did: bool} |
Source code in openml/datasets/functions.py
create_dataset(name, description, creator, contributor, collection_date, language, licence, attributes, data, default_target_attribute, ignore_attribute, citation, row_id_attribute=None, original_data_url=None, paper_url=None, update_comment=None, version_label=None)
¶
Create a dataset.
This function creates an OpenMLDataset object. The OpenMLDataset object contains information related to the dataset and the actual data file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the dataset. |
required |
description
|
str
|
Description of the dataset. |
required |
creator
|
str
|
The person who created the dataset. |
required |
contributor
|
str
|
People who contributed to the current version of the dataset. |
required |
collection_date
|
str
|
The date the data was originally collected, given by the uploader. |
required |
language
|
str
|
Language in which the data is represented. Starts with 1 upper case letter, rest lower case, e.g. 'English'. |
required |
licence
|
str
|
License of the data. |
required |
attributes
|
list, dict, or 'auto'
|
A list of tuples. Each tuple consists of the attribute name and type.
If passing a pandas DataFrame, the attributes can be automatically
inferred by passing |
required |
data
|
(ndarray, list, dataframe, coo_matrix, shape(n_samples, n_features))
|
An array that contains both the attributes and the targets. When
providing a dataframe, the attribute names and type can be inferred by
passing |
required |
default_target_attribute
|
str
|
The default target attribute, if it exists. Can have multiple values, comma separated. |
required |
ignore_attribute
|
str | list
|
Attributes that should be excluded in modelling, such as identifiers and indexes. Can have multiple values, comma separated. |
required |
citation
|
str
|
Reference(s) that should be cited when building on this data. |
required |
version_label
|
str
|
Version label provided by user. Can be a date, hash, or some other type of id. |
None
|
row_id_attribute
|
str
|
The attribute that represents the row-id column, if present in the
dataset. If .. versionadded: 0.8
Inference of |
None
|
original_data_url
|
str
|
For derived data, the url to the original dataset. |
None
|
paper_url
|
str
|
Link to a paper describing the dataset. |
None
|
update_comment
|
str
|
An explanation for when the dataset is uploaded. |
None
|
Returns:
Name | Type | Description |
---|---|---|
class |
`openml.OpenMLDataset`
|
|
Dataset description.
|
|
Source code in openml/datasets/functions.py
682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 |
|
delete_dataset(dataset_id)
¶
Delete dataset with id dataset_id
from the OpenML server.
This can only be done if you are the owner of the dataset and no tasks are attached to the dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_id
|
int
|
OpenML id of the dataset |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the deletion was successful. False otherwise. |
Source code in openml/datasets/functions.py
edit_dataset(data_id, description=None, creator=None, contributor=None, collection_date=None, language=None, default_target_attribute=None, ignore_attribute=None, citation=None, row_id_attribute=None, original_data_url=None, paper_url=None)
¶
Edits an OpenMLDataset.
In addition to providing the dataset id of the dataset to edit (through data_id), you must specify a value for at least one of the optional function arguments, i.e. one value for a field to edit.
This function allows editing of both non-critical and critical fields. Critical fields are default_target_attribute, ignore_attribute, row_id_attribute.
- Editing non-critical data fields is allowed for all authenticated users.
- Editing critical fields is allowed only for the owner, provided there are no tasks associated with this dataset.
If dataset has tasks or if the user is not the owner, the only way to edit critical fields is to use fork_dataset followed by edit_dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_id
|
int
|
ID of the dataset. |
required |
description
|
str
|
Description of the dataset. |
None
|
creator
|
str
|
The person who created the dataset. |
None
|
contributor
|
str
|
People who contributed to the current version of the dataset. |
None
|
collection_date
|
str
|
The date the data was originally collected, given by the uploader. |
None
|
language
|
str
|
Language in which the data is represented. Starts with 1 upper case letter, rest lower case, e.g. 'English'. |
None
|
default_target_attribute
|
str
|
The default target attribute, if it exists. Can have multiple values, comma separated. |
None
|
ignore_attribute
|
str | list
|
Attributes that should be excluded in modelling, such as identifiers and indexes. |
None
|
citation
|
str
|
Reference(s) that should be cited when building on this data. |
None
|
row_id_attribute
|
str
|
The attribute that represents the row-id column, if present in the
dataset. If .. versionadded: 0.8
Inference of |
None
|
original_data_url
|
str
|
For derived data, the url to the original dataset. |
None
|
paper_url
|
str
|
Link to a paper describing the dataset. |
None
|
Returns:
Type | Description |
---|---|
Dataset id
|
|
Source code in openml/datasets/functions.py
915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 |
|
fork_dataset(data_id)
¶
Creates a new dataset version, with the authenticated user as the new owner. The forked dataset can have distinct dataset meta-data, but the actual data itself is shared with the original version.
This API is intended for use when a user is unable to edit the critical fields of a dataset through the edit_dataset API. (Critical fields are default_target_attribute, ignore_attribute, row_id_attribute.)
Specifically, this happens when the user is: 1. Not the owner of the dataset. 2. User is the owner of the dataset, but the dataset has tasks.
In these two cases the only way to edit critical fields is: 1. STEP 1: Fork the dataset using fork_dataset API 2. STEP 2: Call edit_dataset API on the forked version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_id
|
int
|
id of the dataset to be forked |
required |
Returns:
Type | Description |
---|---|
Dataset id of the forked dataset
|
|
Source code in openml/datasets/functions.py
get_dataset(dataset_id, download_data=None, version=None, error_if_multiple=False, cache_format='pickle', download_qualities=None, download_features_meta_data=None, download_all_files=False, force_refresh_cache=False)
¶
Download the OpenML dataset representation, optionally also download actual data file.
This function is by default NOT thread/multiprocessing safe, as this function uses caching. A check will be performed to determine if the information has previously been downloaded to a cache, and if so be loaded from disk instead of retrieved from the server.
To make this function thread safe, you can install the python package oslo.concurrency
.
If oslo.concurrency
is installed get_dataset
becomes thread safe.
Alternatively, to make this function thread/multiprocessing safe initialize the cache first by
calling get_dataset(args)
once before calling get_dataset(args)
many times in parallel.
This will initialize the cache and later calls will use the cache in a thread/multiprocessing
safe way.
If dataset is retrieved by name, a version may be specified.
If no version is specified and multiple versions of the dataset exist,
the earliest version of the dataset that is still active will be returned.
If no version is specified, multiple versions of the dataset exist and
exception_if_multiple
is set to True
, this function will raise an exception.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_id
|
int or str
|
Dataset ID of the dataset to download |
required |
download_data
|
bool(default=True)
|
If True, also download the data file. Beware that some datasets are large and it might
make the operation noticeably slower. Metadata is also still retrieved.
If False, create the OpenMLDataset and only populate it with the metadata.
The data may later be retrieved through the |
None
|
version
|
(int, optional(default=None))
|
Specifies the version if |
None
|
error_if_multiple
|
bool(default=False)
|
If |
False
|
cache_format
|
str(default='pickle') in {'pickle', 'feather'}
|
Format for caching the dataset - may be feather or pickle Note that the default 'pickle' option may load slower than feather when no.of.rows is very high. |
'pickle'
|
download_qualities
|
bool(default=True)
|
Option to download 'qualities' meta-data in addition to the minimal dataset description.
If True, download and cache the qualities file.
If False, create the OpenMLDataset without qualities metadata. The data may later be added
to the OpenMLDataset through the |
None
|
download_features_meta_data
|
bool(default=True)
|
Option to download 'features' meta-data in addition to the minimal dataset description.
If True, download and cache the features file.
If False, create the OpenMLDataset without features metadata. The data may later be added
to the OpenMLDataset through the |
None
|
download_all_files
|
bool
|
EXPERIMENTAL. Download all files related to the dataset that reside on the server. Useful for datasets which refer to auxiliary files (e.g., meta-album). |
False
|
force_refresh_cache
|
bool(default=False)
|
Force the cache to refreshed by deleting the cache directory and re-downloading the data.
Note, if |
False
|
Returns:
Name | Type | Description |
---|---|---|
dataset |
:class:`openml.OpenMLDataset`
|
The downloaded dataset. |
Source code in openml/datasets/functions.py
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 |
|
get_datasets(dataset_ids, download_data=True, download_qualities=True)
¶
Download datasets.
This function iterates :meth:openml.datasets.get_dataset
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_ids
|
iterable
|
Integers or strings representing dataset ids or dataset names. If dataset names are specified, the least recent still active dataset version is returned. |
required |
download_data
|
bool
|
If True, also download the data file. Beware that some datasets are large and it might
make the operation noticeably slower. Metadata is also still retrieved.
If False, create the OpenMLDataset and only populate it with the metadata.
The data may later be retrieved through the |
True
|
download_qualities
|
(bool, optional(default=True))
|
If True, also download qualities.xml file. If False it skip the qualities.xml. |
True
|
Returns:
Name | Type | Description |
---|---|---|
datasets |
list of datasets
|
A list of dataset objects. |
Source code in openml/datasets/functions.py
list_datasets(data_id=None, offset=None, size=None, status=None, tag=None, output_format='dict', **kwargs)
¶
Return a list of all dataset which are on OpenML. Supports large amount of results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_id
|
list
|
A list of data ids, to specify which datasets should be listed |
None
|
offset
|
int
|
The number of datasets to skip, starting from the first. |
None
|
size
|
int
|
The maximum number of datasets to show. |
None
|
status
|
str
|
Should be {active, in_preparation, deactivated}. By default active datasets are returned, but also datasets from another status can be requested. |
None
|
tag
|
str
|
|
None
|
output_format
|
Literal['dataframe', 'dict']
|
The parameter decides the format of the output. - If 'dict' the output is a dict of dict - If 'dataframe' the output is a pandas DataFrame |
'dict'
|
kwargs
|
dict
|
Legal filter operators (keys in the dict): data_name, data_version, number_instances, number_features, number_classes, number_missing_values. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
datasets |
dict of dicts, or dataframe
|
|
Source code in openml/datasets/functions.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|
list_qualities()
¶
Return list of data qualities available.
The function performs an API call to retrieve the entire list of data qualities that are computed on the datasets uploaded.
Returns:
Type | Description |
---|---|
list
|
|
Source code in openml/datasets/functions.py
status_update(data_id, status)
¶
Updates the status of a dataset to either 'active' or 'deactivated'. Please see the OpenML API documentation for a description of the status and all legal status transitions: https://docs.openml.org/#dataset-status
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_id
|
int
|
The data id of the dataset |
required |
status
|
(str)
|
'active' or 'deactivated' |
required |