Skip to content

Commit 04883ad

Browse files
committed
fix kwargs & bump version
1 parent 23d2f2d commit 04883ad

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MLJOpenML"
22
uuid = "cbea4545-8c96-4583-ad3a-44078d60d369"
33
authors = ["Anthony D. Blaom <[email protected]>"]
4-
version = "1.1.0"
4+
version = "2.0.0"
55

66
[deps]
77
ARFFFiles = "da404889-ca92-49ff-9e8b-0aa6b4d38dc8"

src/openml.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,13 @@ function load_Dataset_Description(id::Int; api_key::String="")
4545
end
4646

4747
"""
48-
MLJOpenML.load(id; verbosity = 1, parser = :csv, kwargs...)
48+
MLJOpenML.load(id; parser = :arff)
4949
5050
Load the OpenML dataset with specified `id`, from those listed by
5151
[`list_datasets`](@ref) or on the [OpenML site](https://www.openml.org/search?type=data).
52+
With `parser = :arff` (default) the ARFFFiles.jl parser is used.
53+
With `parser = :auto` the output of the ARFFFiles parser is coerced to
54+
automatically detected scientific types.
5255
5356
Returns a table.
5457
@@ -60,10 +63,15 @@ table = MLJOpenML.load(61);
6063
df = DataFrame(table);
6164
```
6265
"""
63-
function load(id::Int; verbosity = 1, parser = :csv, kwargs...)
66+
function load(id::Int; parser = :arff)
6467
response = load_Dataset_Description(id)
6568
arff_file = HTTP.request("GET", response["data_set_description"]["url"])
66-
return ARFFFiles.load(IOBuffer(arff_file.body))
69+
data = ARFFFiles.load(IOBuffer(arff_file.body))
70+
if parser == :auto
71+
return coerce(data, autotype(data))
72+
else
73+
return data
74+
end
6775
end
6876

6977

0 commit comments

Comments
 (0)