39
39
_test (data; ignore= true , kwargs... ) = _test ([], data; ignore, kwargs... )
40
40
41
41
42
- # # SINGLE TARGET CLASSIFICATION
42
+ # # BABY DATA SETS
43
+
44
+ """
45
+ make_binary()
43
46
44
- function _make_binary ()
47
+ Return data `(X, y)` for the crabs dataset, restricted to the two features `:FL`,
48
+ `:RW`. Target is `Multiclass{2}`.
49
+
50
+ """
51
+ function make_binary ()
45
52
data = MLJ. load_crabs ()
46
53
y_, X = unpack (data, == (:sp ), col-> col in [:FL , :RW ])
47
54
y = coerce (y_, MLJ. OrderedFactor)
48
55
return X, y
49
56
end
50
57
58
+ """
59
+ make_multiclass()
60
+
61
+ Return data `(X, y)` for the unshuffled iris dataset. Target is `Multiclass{3}`.
62
+
63
+ """
64
+ make_multiclass () = MLJ. @load_iris
65
+
66
+ """
67
+ make_regression()
68
+
69
+ Return data `(X, y)` for the Boston dataset, restricted to the two features `:LStat`,
70
+ `:Rm`. Target is `Continuous`.
71
+
72
+ """
73
+ function make_regression ()
74
+ data = MLJ. load_boston ()
75
+ y, X = unpack (data, == (:MedV ), col-> col in [:LStat , :Rm ])
76
+ return X, y
77
+ end
78
+
79
+ """
80
+ make_regression()
81
+
82
+ Return data `(X, y)` for the Boston dataset, restricted to the two features `:LStat`,
83
+ `:Rm`, with the `Continuous` target converted to `Count` (integer).
84
+
85
+ """
86
+ function make_count ()
87
+ X, y_ = make_regression ()
88
+ y = map (η -> round (Int, η), y_)
89
+ return X, y
90
+ end
91
+
92
+
93
+ # # SINGLE TARGET CLASSIFICATION
94
+
95
+
51
96
"""
52
97
MLJTestIntegration.test_single_target_classifiers(; keyword_options...)
53
98
@@ -62,17 +107,11 @@ $DOC_AS_ABOVE
62
107
63
108
"""
64
109
test_single_target_classifiers (args... ; kwargs... ) =
65
- _test (args... , _make_binary (); kwargs... )
110
+ _test (args... , make_binary (); kwargs... )
66
111
67
112
68
113
# # SINGLE TARGET REGRESSION
69
114
70
- function _make_baby_boston ()
71
- data = MLJ. load_boston ()
72
- y, X = unpack (data, == (:MedV ), col-> col in [:LStat , :Rm ])
73
- return X, y
74
- end
75
-
76
115
"""
77
116
MLJTestIntegration.test_single_target_regressors(; keyword_options...)
78
117
@@ -87,17 +126,11 @@ $DOC_AS_ABOVE
87
126
88
127
"""
89
128
test_single_target_regressors (args... ; kwargs... ) =
90
- _test (args... , _make_baby_boston (); kwargs... )
129
+ _test (args... , make_regression (); kwargs... )
91
130
92
131
93
132
# # SINGLE TARGET COUNT REGRESSORS
94
133
95
- function _make_count ()
96
- X, y_ = _make_baby_boston ()
97
- y = map (η -> round (Int, η), y_)
98
- return X, y
99
- end
100
-
101
134
"""
102
135
MLJTestIntegration.test_single_count_regressors(; keyword_options...)
103
136
@@ -114,12 +147,12 @@ $DOC_AS_ABOVE
114
147
115
148
"""
116
149
test_single_target_count_regressors (args... ; kwargs... ) =
117
- _test (args... , _make_count (); kwargs... )
150
+ _test (args... , make_count (); kwargs... )
118
151
119
152
120
153
# # CONTINUOUS TABLE TRANSFORMERS
121
154
122
- _make_transformer () = (first (_make_baby_boston ()),)
155
+ _make_transformer () = (first (make_regression ()),)
123
156
124
157
"""
125
158
test_continuous_table_transformers(; keyword_options...)
0 commit comments