1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
48
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
//! Built-in dataset implementations for machine learning.
//!
//! `dataset-ml` provides ready-to-use loaders for classic ML datasets built on top
//! of [`dataset_core::Dataset`]. Each module is a worked example showing how to wrap
//! `Dataset<T, E>` for a concrete data source: downloading from a URL, verifying a
//! SHA-256 hash, parsing CSV records (or extracting raw documents from an archive),
//! and exposing typed accessors backed by [`ndarray`].
//!
//! # Datasets
//!
//! | Module | Samples | Features | Task Type |
//! |-------------------------------------------------------|---------|----------|----------------|
//! | [`abalone`] | 4,177 | 8 | Regression |
//! | [`adult`] | 32,561 | 14 | Classification |
//! | [`bank_marketing`] | 45,211 | 16 | Classification |
//! | [`iris`] | 150 | 4 | Classification |
//! | [`breast_cancer`] | 569 | 30 | Classification |
//! | [`boston_housing`] | 506 | 13 | Regression |
//! | [`california_housing`] | 20,640 | 8 | Regression |
//! | [`car_evaluation`] | 1,728 | 6 | Classification |
//! | [`covtype`] | 581,012 | 54 | Classification |
//! | [`diabetes`] | 442 | 10 | Regression |
//! | [`digits`] | 1,797 | 64 | Classification |
//! | [`heart_disease`] | 303 | 13 | Classification |
//! | [`ionosphere`] | 351 | 34 | Classification |
//! | [`kddcup99`] | 494,021 / 4,898,431 | 41 | Classification |
//! | [`linnerud`] | 20 | 3 | Regression (multi-output) |
//! | [`mushroom`] | 8,124 | 22 | Classification |
//! | [`titanic`] | 891 | 11 | Classification |
//! | [`palmer_penguins`] | 344 | 7 | Classification |
//! | [`sms_spam`] | 5,574 | text | Classification |
//! | [`wine_recognition`] | 178 | 13 | Classification |
//! | [`wine_quality::red_wine_quality`] | 1,599 | 11 | Regression |
//! | [`wine_quality::white_wine_quality`] | 4,898 | 11 | Regression |
//! | [`youtube_spam`] | 1,956 | text | Classification |
//! | [`sentiment_sentences`] | 3,000 | text | Classification |
//! | [`newsgroups20`] | 11,314 / 18,846 | text | Classification |
//! | [`movie_review_polarity`] | 2,000 | text | Classification |
//!
//! # Example
//!
//! ```no_run
//! use dataset_ml::iris::Iris;
//!
//! let iris = Iris::new("./data");
//! let (features, labels) = iris.data().unwrap();
//! assert_eq!(features.shape(), &[150, 4]);
//! ```
//!
//! All loaders are lazy: the first call downloads and parses the file, every
//! subsequent call returns a cached reference. See the individual module docs
//! for features, target, sample count, and source.
/// Abalone dataset module.
///
/// Contains the Abalone dataset (UCI, Nash et al. 1994) for **regression**:
/// predicting an abalone's `rings` (age in years is `rings + 1.5`) from 8 mixed
/// (1 categorical `sex` + 7 numeric) physical measurements. Unlike the other
/// mixed-type loaders (which are classification), its target is an
/// `Array1<f64>` regression target via `targets()`.
/// Adult / Census Income dataset module.
///
/// Contains the Adult dataset (also called "Census Income") for binary
/// classification: predicting whether a person earns over $50K/year from 14 mixed
/// (8 categorical + 6 numeric) demographic and employment features. Extracted from
/// the 1994 US Census; uses the canonical `adult.data` training partition.
/// Bank Marketing dataset module.
///
/// Contains the Bank Marketing dataset for binary classification: predicting
/// whether a client subscribes a term deposit from 16 mixed (9 categorical +
/// 7 numeric) client, contact, and campaign features. Recorded from a Portuguese
/// bank's phone campaigns; uses the full `bank-full.csv` partition. Sourced from a
/// ZIP archive (like `digits`).
/// Boston Housing dataset module.
///
/// Contains the Boston Housing dataset for predicting median house values
/// in Boston suburbs based on various features like crime rate, room count,
/// and accessibility to highways.
/// Breast Cancer Wisconsin (Diagnostic) dataset module.
///
/// Contains the Breast Cancer Wisconsin dataset for binary classification of
/// tumors as malignant or benign based on 30 features computed from digitized
/// images of cell nuclei.
/// California Housing dataset module.
///
/// Contains the California Housing dataset for predicting median house values
/// in California districts. Reproduces scikit-learn's `fetch_california_housing`
/// eight derived features. A modern replacement for Boston Housing.
/// Car Evaluation dataset module.
///
/// Contains the Car Evaluation dataset (UCI, Bohanec 1988) for multi-class
/// classification: predicting a car's overall acceptability (`unacc`, `acc`,
/// `good`, `vgood`) from 6 categorical price and technical attributes. Like
/// [`mushroom`], it is **all-categorical** — `features()` returns a single
/// `Array2<String>`.
/// Forest Cover Type dataset module.
///
/// Contains the scikit-learn Forest CoverType dataset (`fetch_covtype`) for
/// multi-class classification: predicting one of seven forest cover types from 54
/// cartographic features of 30×30 metre cells. Sourced from a gzip-compressed file,
/// it is the first loader to decompress its source with `gunzip`.
/// Diabetes dataset module.
///
/// Contains the scikit-learn diabetes dataset (`load_diabetes`) for regression:
/// predicting disease progression from 10 standardized physiological features.
/// Optical Recognition of Handwritten Digits dataset module.
///
/// Contains the scikit-learn digits dataset (`load_digits`) for multi-class
/// classification: recognizing handwritten digits (`0`–`9`) from 8×8 grayscale
/// images flattened into 64 integer pixel intensities.
/// Heart Disease (Cleveland) dataset module.
///
/// Contains the Cleveland Heart Disease dataset (UCI, Janosi et al. 1988) for
/// classification: predicting the presence of heart disease (`num`, `0`–`4`) from
/// 13 clinical features. The `?` missing values in `ca`/`thal` are mapped to
/// `NaN` (like [`titanic`]/[`palmer_penguins`]); the target is an `Array1<u8>`.
/// Ionosphere dataset module.
///
/// Contains the Ionosphere dataset (UCI, Sigillito et al. 1989) for binary
/// classification: predicting whether a radar return shows structure in the
/// ionosphere (`good`) or passes through it (`bad`) from 34 continuous
/// autocorrelation features. A compact pure-numeric benchmark like
/// [`breast_cancer`].
/// Iris flower dataset module.
///
/// Contains the classic Iris dataset for classifying iris flowers into
/// three species (setosa, versicolor, virginica) based on sepal and petal
/// measurements.
/// KDD Cup 1999 network-intrusion dataset module.
///
/// Contains the scikit-learn KDD Cup 1999 dataset (`fetch_kddcup99`) for
/// multi-class classification: detecting network intrusions from 41 mixed
/// (3 categorical + 38 numeric) connection features. `Kddcup99::new` loads the
/// default 10% subset (494,021 samples) and `Kddcup99::new_full` the full set
/// (4,898,431 samples). Like `covtype`, it is sourced from a gzip-compressed file
/// and decompressed with `gunzip`.
/// Linnerud dataset module.
///
/// Contains the scikit-learn Linnerud dataset (`load_linnerud`) for multi-output
/// regression: predicting three physiological variables (`Weight`, `Waist`,
/// `Pulse`) from three exercise variables (`Chins`, `Situps`, `Jumps`) measured
/// on 20 middle-aged men.
/// Movie Review Polarity dataset module.
///
/// Contains the Cornell Movie Review Polarity dataset (Pang & Lee 2004, polarity
/// dataset v2.0) for binary **text** classification: labelling 2,000 full IMDb
/// movie reviews as `positive` or `negative` (1,000 each). Like [`sms_spam`] it
/// is a text-modality loader (document accessor `texts()`, not `features()`) and
/// complements the sentence-level [`sentiment_sentences`] with full-document
/// reviews. Sourced from a `.tar.gz` archive (decompressed with `untar_gz`).
/// Mushroom dataset module.
///
/// Contains the Mushroom dataset (UCI `agaricus-lepiota`) for binary
/// classification: predicting whether a mushroom is edible or poisonous from 22
/// categorical attributes. The first **all-categorical** loader — every feature is
/// a single-letter string code, so `features()` returns a single `Array2<String>`.
/// 20 Newsgroups dataset module.
///
/// Contains the classic 20 Newsgroups dataset (Lang 1995; the `bydate` version)
/// for multi-class **text** classification: labelling ~18,846 Usenet posts with
/// one of 20 newsgroups. The framework-agnostic analogue of scikit-learn's
/// `fetch_20newsgroups` and the crate's first **multi-class** text loader. Like
/// [`sms_spam`] it is a text-modality loader (document accessor `texts()`, not
/// `features()`); `new`/`new_test`/`new_all` mirror scikit-learn's train/test/all
/// subsets. Sourced from a `.tar.gz` archive (decompressed with `untar_gz`).
/// Palmer Penguins dataset module.
///
/// Contains the Palmer Penguins dataset for classifying penguins into three
/// species (Adelie, Chinstrap, Gentoo) based on bill and flipper measurements,
/// body mass, and categorical island/sex features. A modern alternative to Iris.
/// Sentiment Labelled Sentences dataset module.
///
/// Contains the Sentiment Labelled Sentences dataset (UCI, Kotzias et al. 2015)
/// for binary **text** classification: labelling 3,000 review sentences from
/// three sites (Amazon, IMDb, Yelp) as `positive` or `negative`. Like
/// [`sms_spam`]/[`youtube_spam`] it is a text-modality loader (document accessor
/// `texts()`, not `features()`), but it also carries per-sample **metadata** —
/// which site each sentence came from — via a `sources()` accessor, making
/// `SentimentSentencesData` a `(texts, sources, labels)` triple. Sourced from a
/// ZIP archive of three per-site files.
/// SMS Spam Collection dataset module.
///
/// Contains the SMS Spam Collection dataset (UCI, Almeida & Hidalgo 2011) for
/// binary **text** classification: labelling 5,574 SMS messages as `ham` or
/// `spam`. The crate's first text-modality loader — there is no feature matrix,
/// so the document accessor is `texts()` (an `Array1<String>` of raw messages)
/// rather than `features()`. Sourced from a ZIP archive.
/// Titanic dataset module.
///
/// Contains data about Titanic passengers for predicting survival based
/// on features like passenger class, sex, age, and fare.
/// Wine Quality dataset module.
///
/// Contains wine quality assessment data for predicting quality scores
/// based on physicochemical properties like acidity, sugar content, and
/// alcohol percentage.
/// Wine Recognition dataset module.
///
/// Contains the scikit-learn Wine recognition dataset for classifying wines
/// into three cultivars based on 13 chemical constituents. Distinct from
/// [`wine_quality`], which is a regression task on quality scores.
/// YouTube Spam Collection dataset module.
///
/// Contains the YouTube Spam Collection dataset (UCI, Alberto, Lochter & Almeida
/// 2017) for binary **text** classification: labelling 1,956 comments from five
/// popular music videos as `ham` or `spam`. Like [`sms_spam`] (a sibling by the
/// same authors) it is a text-modality loader — there is no feature matrix, so
/// the document accessor is `texts()` (an `Array1<String>` of raw comments)
/// rather than `features()`. Sourced from a ZIP archive of five per-video CSVs.
pub use Abalone;
pub use Adult;
pub use BankMarketing;
pub use BostonHousing;
pub use BreastCancer;
pub use CaliforniaHousing;
pub use CarEvaluation;
pub use Covtype;
pub use Diabetes;
pub use Digits;
pub use HeartDisease;
pub use Ionosphere;
pub use Iris;
pub use Kddcup99;
pub use Linnerud;
pub use MovieReviewPolarity;
pub use Mushroom;
pub use Newsgroups20;
pub use PalmerPenguins;
pub use SentimentSentences;
pub use SmsSpam;
pub use Titanic;
pub use ;
pub use WineRecognition;
pub use YoutubeSpam;