7 Mon
현업 실무자에게 배우는 Kaggle 머신러닝 입문
K-Fold Cross Validation
>>> import numpy as np
>>> from sklearn.model_selection import KFold
>>> X = np.array([[1, 2], [3, 4], [1, 2], [3, 4]])
>>> y = np.array([1, 2, 3, 4])
>>> kf = KFold(n_splits=2)
>>> kf.get_n_splits(X)
2
>>> print(kf)
KFold(n_splits=2, random_state=None, shuffle=False)
>>> for train_index, test_index in kf.split(X):
... print("TRAIN:", train_index, "TEST:", test_index)
... X_train, X_test = X[train_index], X[test_index]
... y_train, y_test = y[train_index], y[test_index]
TRAIN: [2 3] TEST: [0 1]
TRAIN: [0 1] TEST: [2 3]Feature Engineering - Feature Selection
상관 분석(Correlation Analysis) & regplot()
Regression 알고리즘으로 보스턴 부동산 가격 예측해보기 (EDA & Feature Selection)
보스턴 부동산 데이터의 특징들(Features)
전체 특징(Feature)를 사용한 Linear Regression
상관분석(Correlation Analysis)

regplot으로 보는 상관관계

유의미한 Feature들만을 남기는 Feature Selection
Feature Selection 결과 with K-fold
결론
Feature Engineering - Feature Normalization
Feature Engineering - Feature Generation
Ridge & Lasso & ElasticNet Regression






보스턴 부동산 가격 예측 성능 향상시켜보기 (Feature Generation & Advanced Estimator)
Last updated