Abalone#

Physical measurements of 4177 abalones, with the number of rings of the shell as target. Counting the rings under a microscope is slow, so the easier measurements are used to predict them, and the number of rings plus 1.5 gives the age of the abalone in years. The source offers the target as a continuous value or as a classification problem. The dataset is a good place to practise regression with a categorical feature.

Overview#

Loader

load_abalone()

Task

Regression

Samples

4177

Features

8

Targets

1 continuous target, rings

Missing values

None

License

CC BY 4.0

Features#

The features are stored in this order: sex, length, diameter, height, whole_weight, shucked_weight, viscera_weight and shell_weight.

sex is categorical and stored as integer codes: F is 0, I (infant) is 1 and M is 2. The names are in data.info.categorical and data.categorical_features gives the column. The other seven features are continuous.

The variable table of UCI gives mm as the unit of length, diameter and height and grams as the unit of the weights. The source also says that the ranges of the continuous values were scaled for use with an artificial neural network by dividing by 200. The values are stored as the source gives them. Examples with missing values were removed from the original data, so nothing is missing.

Target#

y is the number of rings, stored as float64 with whole-number values from 1 to 29. The most common value is 9 rings (689 abalones). For classification, convert it with data.y.astype(int).

Source and citation#

  • Source: UCI Machine Learning Repository

  • Obtained from: UCI Machine Learning Repository, dataset 1, downloaded with the ucimlrepo package: all 4177 examples with 8 inputs. The ucimlrepo version is recorded in the file.

  • Creators: Warwick Nash, Tracy Sellers, Simon Talbot, Andrew Cawthorn, Wes Ford

  • DOI: https://doi.org/10.24432/C55C7W

Please cite the dataset as:

Nash, W., Sellers, T., Talbot, S., Cawthorn, A., & Ford, W. (1994). Abalone [Dataset]. UCI Machine Learning Repository. https://doi.org/10.24432/C55C7W

See also:

  • Nash, W. J., Sellers, T. L., Talbot, S. R., Cawthorn, A. J., & Ford, W. B. (1994). The Population Biology of Abalone (Haliotis species) in Tasmania. I. Blacklip Abalone (H. rubra) from the North Coast and Islands of Bass Strait. Sea Fisheries Division, Technical Report No. 48 (ISSN 1034-3288).

  • Waugh, S. (1995). Extending and benchmarking Cascade-Correlation. PhD thesis, Computer Science Department, University of Tasmania.

License#

CC BY 4.0, as stated by the source. The license was checked at the source on 2026-10-24. See License and citation.

Changes made#

  • Converted to the NumPy NPZ format. Features and the target are stored as float64.

  • The column Sex is stored as integer codes, in the order of the category names listed for it. The names of the columns are written in lower case, for example Whole_weight is stored as whole_weight. The target is the number of rings.

  • The continuous values are stored as the source gives them, with the scaling that the notes describe.

Note

The source says that examples with missing values were removed from the original data, most of them because the number of rings was missing, and that the ranges of the continuous values were scaled for use with an artificial neural network by dividing by 200. Keep this in mind when you use the units mm and grams that the variable table of UCI lists.

Note

The data comes from a study that was not made for machine learning, by the Marine Resources Division of the Department of Primary Industry and Fisheries, Tasmania. The dataset was donated to UCI by Sam Waugh of the University of Tasmania.

Note

The sex is M, F or I (infant).

Note

The number of rings plus 1.5 gives the age of the abalone in years.

Example#

>>> import numpy as np
>>> from pyml_datasets import load_abalone
>>> data = load_abalone()
>>> data.X.shape, data.y.shape
((4177, 8), (4177,))
>>> data.has_missing
False
>>> data.categorical_features
(0,)
>>> data.info.categorical["sex"]
('F', 'I', 'M')
>>> float(data.y.min()), float(data.y.max())
(1.0, 29.0)
>>> round(float(data.y.mean()), 3)
9.934
>>> int(np.bincount(data.y.astype(int))[9])
689