목록Udemy Python Machine Learning A-Z (9)
David의 개발 이야기!
Simple Linear Regression 단순회귀를 적용하는 방법을 알아보고, 연차별 임금 예측 모형을 만들어보자! 1. 라이브러리 호출하기 Importing the libraries 2. 데이터셋 불러오기 Importing the dataset 3. 훈련세트와 테스트 세트로 나누기 Splitting the dataset into the Training set and Test set 4. 단순선형회귀모델에 학습시키기 Training the Simple Linear Regression model on the Training Set 5. 테스트 세트 결과 예측하기 Predicting the Test set results 6. 결과 시각화하기 Visualizing the Training set and th..
fit() -> "훈련해라", "머신러닝이 데이터에 머신러닝 모델을 맞추는 것(fit)" 학습데이터 세트에서 변환을 위한 기반 설정을 하는 함수이다! 데이터를 학습시키는 메서드라고 생각하면 된다. transform() -> fit 을 기준으로 얻은 mean, variance에 맞춰서 변형하는것! 1. fit을 통해 세운 기반으로 변형하는 함수! 2. 실제로 학습시킨 것을 적용하는 메서드라고 생각하면 된다! fit_transform() 이건 그냥 두개 합쳐 놓은 것이라 생각하면 됨! 그렇다면 왜 train dataset에서만 fit_transform 혹은 fit, transform을 할까? from sklearn.preprocessing import StandardScaler sc = StandardSca..
데이터 전처리 과정을 살펴보면, 1. 라이브러리를 불러온다. Importing the libraries 2. 데이터셋을 불러온다. Importing the dataset 3. 결측치를 어떻게 처리할 것인가? Taking care of missing data 4. 범주형 데이터를 처리해준다! Encoding the categorical data 5. 훈련데이터와 테스트데이터를 나눠준다 Spliting the dataset into the Training set and Test set 6. 표준화, 정규화를 해준다 Feature scaling 이렇게 해주어야한다. 각각에 해당하는 코드를 살펴보자. 1. Importing the libraries import numpy as np import pandas as..