8ed133ec4a5c2780c324ee171cd20ddb5368dc95,openml/datasets/functions.py,,create_dataset,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,356
Before Change
try:
// check if arff is valid
decoder = arff.ArffDecoder()
decoder.decode(arff_dataset, encode_nominal=True)
except arff.ArffException:
raise ValueError("The arguments you have provided \
do not construct a valid arff file")
After Change
// Determine ARFF format from the dataset
else:
if isinstance(data, list) or isinstance(data, np.ndarray):
if isinstance(data[0], list) or isinstance(data[0], np.ndarray):
d_format = "arff"
elif isinstance(data[0], dict):
d_format = "sparse_arff"
else:
raise ValueError(
"When giving a list or a numpy.ndarray, "
"they should contain a list/ numpy.ndarray "
"for dense data or a dictionary for sparse "
"data. Got {!r} instead."
.format(data[0])
)
elif isinstance(data, coo_matrix):
d_format = "sparse_arff"
else:
raise ValueError(
"Invalid data type. The data type can be a list, "
"a numpy ndarray or a scipy.sparse.coo_matrix"
)
arff_object = {
"relation": name,
"description": description,
"attributes": attributes,
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
Instances Project Name: openml/openml-python
Commit Name: 8ed133ec4a5c2780c324ee171cd20ddb5368dc95
Time: 2018-10-17
Author: arlindkadra@gmail.com
File Name: openml/datasets/functions.py
Class Name:
Method Name: create_dataset
Project Name: estnltk/estnltk
Commit Name: 97f9d00c54118f6bd0bdb2f161a9a4b66fb0631e
Time: 2014-11-12
Author: brainscauseminds@gmail.com
File Name: estnltk/core.py
Class Name:
Method Name: as_unicode
Project Name: tensorflow/models
Commit Name: 8b31db60e284a411856e9c05eb14d23b16be1966
Time: 2017-10-27
Author: rathodv@google.com
File Name: research/object_detection/builders/input_reader_builder.py
Class Name:
Method Name: build
Project Name: pantsbuild/pants
Commit Name: 44c274109eaed0a0b4a5cf795539119dbaba9dd7
Time: 2019-07-26
Author: ericarellano@me.com
File Name: tests/python/pants_test/testutils/git_util.py
Class Name:
Method Name: git_version