Config
This is the reference to the functions contained in
config
. For now, they are all accesible directly
through machine-learning-datasets
and you don't
need to use the config
namespace.
Initialize Dataset Configuration Functions
init(new_dssave_path=None, new_dsconfig_path=None)
Initializes the paths and configuration for the dataset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
new_dssave_path |
Optional[str]
|
The new path to save the dataset. Defaults to None. |
None
|
new_dsconfig_path |
Optional[str]
|
The new path to the dataset configuration file. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
Tuple[str, int, Dict]
|
Tuple[str, int, Dict]: A tuple containing the dataset configuration path, the dataset count, and the dataset configuration. |
Source code in machine_learning_datasets/config.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
load(name=None, **kwargs)
Load a dataset from a source.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
Optional[str]
|
The name of the dataset to load. If not provided, all keyword arguments will be used as parameters. |
None
|
**kwargs |
Any
|
Additional keyword arguments that will be used as parameters if
|
{}
|
Returns:
Name | Type | Description |
---|---|---|
Any |
Any
|
The loaded dataset. |
Raises:
Type | Description |
---|---|
Warning
|
If the dataset specified by |
Warning
|
If the |
Note
This function assumes that the dsconfig
variable is defined and contains a JSON
object with a datasets
key, which is a list of dataset configurations.
Example
dataset = load(name='my_dataset', source='Kaggle', file_path='data.csv')
Source code in machine_learning_datasets/config.py
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 |
|