<aside> 💡 1번 10 2번 10 3번 10 4번 10 5번 10 다음부터는 답을 선택한 이유도 함께 적어주시면 더 좋을 것 같아요!

</aside>

[이론문제]

문제 1

4번

문제 2

3번, 5번

[실습문제]

# 필요한 라이브러리와 데이터 로드
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np

from sklearn.datasets import load_iris
iris_raw = load_iris(as_frame=True)

iris_data = iris_raw['data']
iris_target = iris_raw['target']

iris_data.columns

문제 3

fig0, ax0 = plt.subplots()
fig1, ax1 = plt.subplots()

ax0.scatter(iris_data['sepal length (cm)'], iris_data['sepal width (cm)'], color='red')
ax0.set_xlabel('sepal length (cm)')
ax0.set_ylabel('sepal width (cm)')

ax1.scatter(iris_data['petal length (cm)'], iris_data['petal width (cm)'], color='blue')
ax1.set_xlabel('petal length (cm)')
ax1.set_ylabel('petal width (cm)')

Untitled

Untitled

문제 4

mean = np.mean(iris_data, axis=0)
std = np.std(iris_data, axis=0)

iris_std = (iris_data - mean) / std

fig0, ax0 = plt.subplots()
fig1, ax1 = plt.subplots() 
ax0.scatter(iris_std['sepal length (cm)'], iris_std['sepal width (cm)'], color='red')
ax0.set_xlabel('sepal length')
ax0.set_ylabel('sepal width')

ax1.scatter(iris_std['petal length (cm)'], iris_std['petal width (cm)'], color='blue')
ax1.set_xlabel('petal length')
ax1.set_ylabel('petal width')

Untitled