# Example Datasets¶

The package contains a few static datasets that are intended to serve as toy examples.

Warning

This section may be subject of larger changes. It is possible that in the future the datasets will instead be provided by JuliaML/MLDatasets.jl instead.

## Fisher’s Iris data set¶

The Iris data set has become one of the most recognizable machine learning example datasets. It was originally published by Ronald Fisher [FISHER1936] and contains the 4 different kind of measurements (that we call features) for 150 observations of a plant called Iris. The interesting property of the dataset is that it includes these measurements for 3 different species of Iris (50 observations each) and is thus a dataset that is commonly used to showcase classification or clustering algorithms.

load_iris([n]) → Tuple

Loads the first n observations from the Iris flower data set introduced by Ronald Fisher (1936).

Parameters: n (Int) – default 150. Specifies how many of the total 150 observations should be returned (in their native order). A tuple of three arrays as the following code snipped shows. The 4 by n matrix X contains the numeric measurements, in which each individual column denotes an observation. The vector y contains the class labels as strings. The optional vector names contains the names of the features (i.e. rows of X)X, y, names = load_iris(n) 

 [FISHER1936] Fisher, Ronald A. “The use of multiple measurements in taxonomic problems.” Annals of eugenics 7.2 (1936): 179-188.

## Noisy Line Example¶

This refers to a static pre-defined toy dataset. In order to generate a noisy line using some parameters take a look at noisy_function().

load_line() → Tuple

Loads an artificial example dataset for a noisy line. It is particularly useful to explain under- and overfitting.

Returns: The vector x contains 11 equally spaced points between 0 and 1. The vector y contains x ./ 2 + 1 plus some gaussian noise. The optional vector names contains descriptive names for x and y.x, y, names = load_line() 

## Noisy Sin Example¶

This refers to a static pre-defined toy dataset. In order to generate a noisy sin using some parameters take a look at noisy_sin().

load_sin() → Tuple

Loads an artificial example dataset for a noisy sin. It is particularly useful to explain under- and overfitting.

Returns: The vector x contains equally spaced points between 0 and 2π. The vector y contains sin(x) plus some gaussian noise. The optional vector names contains descriptive names for x and y.x, y, names = load_sin() 

## Noisy Polynome Example¶

This refers to a static pre-defined toy dataset. In order to generate a noisy polynome using some parameters take a look at noisy_poly().

load_poly() → Tuple

Returns: It is particularly useful to explain under- and overfitting. The vector x contains 50 points between 0 and 4. The vector y contains 2.6 * x^2 + .8 * x plus some gaussian noise. The optional vector names contains descriptive names for x and y.x, y, names = load_poly()
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5117390155792236, "perplexity": 1860.8661162484204}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178350846.9/warc/CC-MAIN-20210225065836-20210225095836-00452.warc.gz"}