Python에서 로그 정규화
이제 wine 데이터셋의 Proline 열에 분산이 매우 크다는 것을 알았으니, 로그 정규화를 적용해 보겠습니다.
numpy는 np로 임포트되어 있습니다.
이 연습은 강의의 일부입니다
Python으로 배우는 Machine Learning 전처리
연습 안내
- 참고용으로
Proline열의 분산을 출력하세요. np.log()함수를Proline열에 적용해 로그 정규화된 새 열Proline_log를 만드세요.- 차이를 확인할 수 있도록
Proline_log열의 분산을 출력하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# Print out the variance of the Proline column
print(____)
# Apply the log normalization function to the Proline column
wine[____] = np.____(____)
# Check the variance of the normalized Proline column
print(____)