Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Python
- Data Visualization
- GMM
- 과학서적
- 군집분석
- Train-Test Split
- scatter()
- logistic regression
- iris데이터
- 김범준교수
- confusion matrix
- pyplot
- 통계물리학
- scikit-learn
Archives
- Today
- Total
Basin of Attraction
iris데이터 scatter plot 연습 본문
본 예제는 Python 언어와 Scikit-learn 라이브러리를 이용하여 iris 데이터를 scatter plot으로 시각화하는 방법을 다루고 있습니다
1. 필요한 라이브러리 설치 및 불러오기
!pip install scikit-learn matplotlib
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
2. 데이터 불러오기
Scikit-learn에서 제공하는 iris 데이터를 불러옵니다.
iris = load_iris()
X, y = iris.data, iris.target
3. 데이터 시각화
불러온 iris 데이터를 scatter plot으로 시각화합니다.
plt.scatter(X[:, 0], X[:, 1], c=y, cmap='viridis')
plt.xlabel(iris.feature_names[0])
plt.ylabel(iris.feature_names[1])
plt.show()
반응형
Comments