@@ -28,34 +28,35 @@ function load_Dataset_Description(id::Int; api_key::String="")
28
28
println (" No access granted. This dataset is not shared with you." )
29
29
end
30
30
catch e
31
- println (" Error occurred : $e " )
31
+ println (" Error occurred. Check if there exists a dataset with id $id ." )
32
+ println (" See e.g. OpenML.list_datasets()\n " )
33
+ println (e)
32
34
return nothing
33
35
end
34
36
return nothing
35
37
end
36
38
37
39
"""
38
- OpenML.load(id; parser = :arff )
40
+ OpenML.load(id)
39
41
40
42
Load the OpenML dataset with specified `id`, from those listed by
41
43
[`list_datasets`](@ref) or on the [OpenML site](https://www.openml.org/search?type=data).
42
- With `parser = :arff` (default) the ARFFFiles.jl parser is used.
43
- With `parser = :auto` the output of the ARFFFiles parser is coerced to
44
- automatically detected scientific types.
45
44
46
- Datasets are saved as julia artifacts so that they persist locally once loaded.
45
+ Datasets are saved as julia artifacts so that they persist locally once loaded.
47
46
48
47
Returns a table.
49
48
50
49
# Examples
51
50
52
51
```julia
53
52
using DataFrames
54
- table = OpenML.load(61);
55
- df = DataFrame(table);
53
+ table = OpenML.load(61)
54
+ df = DataFrame(table) # transform to a DataFrame
55
+ using ScientificTypes
56
+ df2 = coerce(df, autotype(df)) # corce to automatically detected scientific types
56
57
```
57
58
"""
58
- function load (id:: Int ; parser = :arff )
59
+ function load (id:: Int )
59
60
if VERSION > v " 1.3.0"
60
61
dir = first (Artifacts. artifacts_dirs ())
61
62
toml = joinpath (dir, " OpenMLArtifacts.toml" )
@@ -73,12 +74,7 @@ function load(id::Int; parser = :arff)
73
74
filename = tempname ()
74
75
download (url, filename)
75
76
end
76
- data = ARFFFiles. load (filename)
77
- if parser == :auto
78
- return coerce (data, autotype (data))
79
- else
80
- return data
81
- end
77
+ ARFFFiles. load (filename)
82
78
end
83
79
84
80
@@ -321,7 +317,14 @@ julia> OpenML.describe_dataset(6)
321
317
cited above for more details.
322
318
```
323
319
"""
324
- describe_dataset (id) = Markdown. parse (load_Dataset_Description (id)[" data_set_description" ][" description" ])
320
+ function describe_dataset (id)
321
+ description = load_Dataset_Description (id)[" data_set_description" ][" description" ]
322
+ if isa (description, AbstractString)
323
+ Markdown. parse (description)
324
+ else
325
+ " No description found."
326
+ end
327
+ end
325
328
326
329
# Flow API
327
330
0 commit comments