Skip to content

Commit

Permalink
Merge pull request #590 from JuliaAI/dev
Browse files Browse the repository at this point in the history
For a 0.18.13 release
  • Loading branch information
ablaom authored Jun 29, 2021
2 parents d5d1e6e + 8dd1044 commit 95642c9
Show file tree
Hide file tree
Showing 7 changed files with 453 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MLJBase"
uuid = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
authors = ["Anthony D. Blaom <[email protected]>"]
version = "0.18.12"
version = "0.18.13"

[deps]
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
Expand Down
290 changes: 290 additions & 0 deletions data/sunspots.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
sunspot_number
5.0
11.0
16.0
23.0
36.0
58.0
29.0
20.0
10.0
8.0
3.0
0.0
0.0
2.0
11.0
27.0
47.0
63.0
60.0
39.0
28.0
26.0
22.0
11.0
21.0
40.0
78.0
122.0
103.0
73.0
47.0
35.0
11.0
5.0
16.0
34.0
70.0
81.0
111.0
101.0
73.0
40.0
20.0
16.0
5.0
11.0
22.0
40.0
60.0
80.9
83.4
47.7
47.8
30.7
12.2
9.6
10.2
32.4
47.6
54.0
62.9
85.9
61.2
45.1
36.4
20.9
11.4
37.8
69.8
106.1
100.8
81.6
66.5
34.8
30.6
7.0
19.8
92.5
154.4
125.9
84.8
68.1
38.5
22.8
10.2
24.1
82.9
32.0
130.9
118.1
89.9
66.6
60.0
46.9
41.0
21.3
16.0
6.4
4.1
6.8
14.5
34.0
45.0
43.1
7.5
42.2
28.1
10.1
8.1
2.5
0.0
1.4
5.0
12.2
13.9
35.4
45.8
41.1
30.1
23.9
15.6
6.6
4.0
1.8
8.5
16.6
36.3
49.6
64.2
67.0
70.9
47.8
27.5
8.5
13.2
56.9
121.5
138.3
103.2
85.7
64.6
36.7
24.2
10.7
15.0
40.1
61.5
98.5
124.7
96.3
66.6
64.5
54.1
39.0
20.6
6.7
4.3
22.7
54.8
93.8
95.8
77.2
59.1
44.0
47.0
30.5
16.3
7.3
37.6
74.0
139.0
111.2
101.6
66.2
44.7
17.0
11.3
12.4
3.4
6.0
32.3
54.3
59.7
63.7
63.5
52.2
25.4
13.1
6.8
6.3
7.1
35.6
73.0
85.1
78.0
64.0
41.8
26.2
26.7
12.1
9.5
2.7
5.0
24.4
42.0
63.5
53.8
62.0
48.5
43.9
18.6
5.7
3.6
1.4
9.6
47.4
57.1
103.9
80.6
63.6
37.6
26.1
14.2
5.8
16.7
44.3
63.9
69.0
77.8
64.9
35.7
21.2
11.1
5.7
8.7
36.1
79.7
114.4
109.6
88.8
67.8
47.5
30.6
16.3
9.6
33.2
92.6
151.6
136.3
134.7
83.9
69.4
31.5
13.9
4.4
38.0
141.7
190.2
184.8
159.0
112.3
53.9
37.5
27.9
10.2
15.1
47.0
93.8
105.9
105.5
104.5
66.6
68.9
38.0
34.5
15.5
12.6
27.5
92.5
155.4
154.7
140.5
115.9
66.6
45.9
17.9
13.4
29.2
100.2
6 changes: 3 additions & 3 deletions src/MLJBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ export HANDLE_GIVEN_ID, @more, @constant, @bind, color_on, color_off
export average, UnivariateFiniteArray, UnivariateFiniteVector

# datasets.jl:
export load_boston, load_ames, load_iris,
export load_boston, load_ames, load_iris, load_sunspots,
load_reduced_ames, load_crabs, load_smarket,
@load_boston, @load_ames, @load_iris,
@load_boston, @load_ames, @load_iris, @load_sunspots,
@load_reduced_ames, @load_crabs, @load_smarket

# sources.jl:
Expand All @@ -167,7 +167,7 @@ export DeterministicNetwork, ProbabilisticNetwork, UnsupervisedNetwork


# resampling.jl:
export ResamplingStrategy, Holdout, CV, StratifiedCV,
export ResamplingStrategy, Holdout, CV, StratifiedCV, TimeSeriesCV,
evaluate!, Resampler, PerformanceEvaluation

# -------------------------------------------------------------------
Expand Down
14 changes: 14 additions & 0 deletions src/data/datasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ const COERCE_SMARKET = (
:Today=>Continuous,
:Direction=>Multiclass{2})

const COERCE_SUNSPOTS = (
(:sunspot_number=>Continuous),)

"""
load_dataset(fpath, coercions)
Expand Down Expand Up @@ -195,6 +198,10 @@ function load_smarket()
return merge(data1, (Year=Dates.Date.(data1.Year),))
end

"""Load a well-known sunspot time series (table with one column).
[https://www.sws.bom.gov.au/Educational/2/3/6]](https://www.sws.bom.gov.au/Educational/2/3/6)
"""
load_sunspots() = load_dataset("sunspots.csv", COERCE_SUNSPOTS)

"""Load a well-known public regression dataset with `Continuous` features."""
macro load_boston()
Expand Down Expand Up @@ -228,6 +235,13 @@ macro load_iris()
end
end

"""Load a well-known sunspot time series (single table with one column)."""
macro load_sunspots()
quote
load_sunspots()
end
end

"""Load a well-known crab classification dataset with nominal features."""
macro load_crabs()
quote
Expand Down
Loading

0 comments on commit 95642c9

Please sign in to comment.