Iris Plants Dataset
This dataset contains 150 records of iris flowers, each with measurements of sepal length, sepal width, petal length, and petal width. The task is typically to classify these records into one of three iris species.
Classes |
3 |
Samples per class |
50 |
Samples total |
150 |
Dimensionality |
4 |
Features | real, positive |
Example for loading iris dataset
from sklearn.datasets import load_iris
import pandas as pd
# Load the Iris dataset
iris = load_iris()
# Creating a DataFrame from the dataset for easier manipulation
iris_df = pd.DataFrame(data=iris.data, columns=iris.feature_names)
iris_df['species'] = pd.Categorical.from_codes(iris.target, iris.target_names)
# Print the first few rows of the DataFrame
print(iris_df.head())
# Print a summary of the DataFrame
print(iris_df.describe())
# Print the target names and feature
Output:
sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) \
0 5.1 3.5 1.4 0.2
1 4.9 3.0 1.4 0.2
2 4.7 3.2 1.3 0.2
3 4.6 3.1 1.5 0.2
4 5.0 3.6 1.4 0.2
species
0 setosa
1 setosa
2 setosa
3 setosa
4 setosa
What is Toy Dataset – Types, Purpose, Benefits and Application
Toy datasets are small, simple datasets commonly used in the field of machine learning for training, testing, and demonstrating algorithms. These datasets are typically clean, well-organized, and structured in a way that makes them easy to use for instructional purposes, reducing the complexities associated with real-world data processing.
Contact Us