CSV datasets for machine-learning practice

Nine CSV tables for practicing data cleaning, exploratory analysis, classification and regression.

Repository standards Read the documentation

Use these files with Python, R or a spreadsheet tool. The repository provides practice inputs; it includes no trained models, notebooks, generators or evaluation results. Dataset provenance and licensing are unrecorded, so confirm source and reuse rights before redistribution.

Start here

Choose Iris for a first classification exercise or Salary for regression. Use Purchase and Titanic to explore missing values, then try the larger customer, sales, review and sensor tables. Follow the quick-start example below to load a local CSV. The schema and quality reference lists exact fields and known limitations.

Dataset catalog

Dataset Rows Columns Suggested exercise / target
Iris.csv 150 5 Flower classification: species
Salary.csv 205 2 Experience/salary regression: salary
Purchase.csv 10 4 Missing-value handling; toy classification: Purchased
Titanic.csv 891 12 Missing values and classification: Survived
College.csv 777 19 Institutional EDA; optional classification: Private
customer_data.csv 1,000 9 Missing values, category cleanup; optional regression: Purchase_Amount
sales_data.csv 1,000 8 Outliers and missing values; optional classification: Is_Fraudulent
reviews_data.csv 1,000 6 Text preprocessing; sentiment classification: Sentiment
sensor_data.csv 1,000 5 Timestamp parsing and missing sensor readings

Counts exclude the header. The first College column is unnamed and contains college names; it is included in the 19-column count. See the schema and quality reference for exact fields and empty-cell counts.

Quick start

Clone the repository and load one local file:

git clone https://github.com/gcfernando/machine-learning-practice-datasets.git
cd machine-learning-practice-datasets
python -m pip install pandas
import pandas as pd

iris = pd.read_csv("Iris.csv")
print(iris.shape)  # (150, 5)
print(iris.columns.tolist())

Prerequisites and installation

The CSV files require no runtime installation. For the examples above, use Python with pandas installed in your chosen environment. Python and pandas versions are not pinned in this repository. Spreadsheet tools and R can also import the tables; preserve exact filename case when scripting on case-sensitive systems.

Usage

Inspect missing values and load college names as an index:

import pandas as pd

titanic = pd.read_csv("Titanic.csv")
college = pd.read_csv("College.csv", index_col=0)
print(titanic.shape)         # (891, 12)
print(college.shape)         # (777, 18): name column is now the index
print(titanic.isna().sum())

For experiments, split training and evaluation data before fitting imputers, scalers or encoders. For sensor time-series exercises, first inspect ordering, duplicate timestamps and sampling intervals; the presence of a timestamp column alone does not establish suitability for forecasting. Avoid using identifiers, names, email addresses or phone numbers as default predictive features.

Development and testing

There are no committed data generators, data pipelines or automated data tests; the Repository standards workflow checks metadata only. A safe local verification with Python’s standard library is:

import csv
from pathlib import Path

for path in sorted(Path(".").glob("*.csv")):
    with path.open(encoding="utf-8-sig", newline="") as stream:
        rows = list(csv.reader(stream))
    header, records = rows[0], rows[1:]
    assert all(len(row) == len(header) for row in records), path.name
    print(path.name, len(records), len(header))

The documentation review parsed every record to verify widths, counts, headers, empty cells, exact duplicate rows, selected numeric bounds, date formats and customer-ID references. The quality reference records three duplicate Iris rows, College values above 100 and the different date formats. It did not train models or verify original dataset sources.

Troubleshooting and limitations

  • Unnamed College column: use index_col=0, or assign an explicit name after import.
  • Missing values: Purchase, Titanic, customer, sales and sensor tables contain empty cells. Define a preprocessing policy before modeling.
  • Duplicate measurements and numeric bounds: Iris contains exact repeated rows; College contains PhD and Grad.Rate values above 100. Inspect these before fitting or cleaning rather than assuming every nonempty value is valid.
  • Small sample: Purchase has only ten rows and is unsuitable for reliable model evaluation.
  • Unknown origin: apparent generated patterns do not prove that data is synthetic. No real-world representativeness or label quality is established.
  • Reuse rights: a familiar dataset name does not establish the source or license of this particular copy.

Contributing

For a dataset addition or correction, record its source URL, author, license, collection/generation method, schema, units and known quality limitations. Do not add personal or confidential records. Update counts and the data dictionary when changing a CSV. Follow CONTRIBUTING.md and the repository standards; report sensitive findings through the security policy.

Support and license

Source and reuse notes

No license file or per-dataset provenance record is present in this checkout. Confirm the origin and applicable reuse rights before redistributing any file; this repository’s availability does not itself grant a license.

Use repository issues for schema corrections or missing source information.

Schema and quality reference · Python machine-learning examples