머신 러닝 실습 7. Iris

J. Hwang·2025년 4월 7일
0

ML practice

목록 보기
3/4

Iris 데이터는 붓꽃의 3가지 종류(setosa, versicolor, virginica)의 꽃잎의 길이, 꽃잎의 너비, 꽃받침의 길이, 꽃받침의 너비 정보가 있는 데이터이다.


(petal = 꽃잎, sepal = 꽃받침)

Iris 데이터는 scikit-learn에서 아주 간단하게 불러올 수 있다.

from sklearn.datasets import load_iris

iris = load_iris()

iris를 보기 편하게 pandas dataframe으로 변환해보자.

import pandas as pd

iris_df = pd.DataFrame(data=iris.data, columns=iris.feature_names)
iris_df['target'] = iris.target

만들어진 iris_df를 출력해보면 sepal length, sepal width, petal length, petal width의 4가지 feature와 붓꽃의 종류 target (0 = setosa, 1 = versicolor, 2 = virginica) 정보가 150개의 행으로 구성되어 있는 것을 확인할 수 있다.

References

https://bruders.tistory.com/82

profile
Let it code

0개의 댓글