반응형 텐서플로2 [Tensorflow] 회귀(Regression) 신경망 실습 본 실습은 Sklearn Boston 데이터 셋을 활용했습니다 1. Import Library and Random seed import numpy as np import tensorflow as tf np.random.seed(0) tf.random.set_seed(0) 2. Load Dataset and check target # target check - continuous from sklearn import datasets raw_boston = datasets.load_boston() X = raw_boston.data y = raw_boston.target print(X.shape) print(set(y)) 3. Train / Test Split # Split from sklearn.model_.. 2022. 1. 7. [Tensorflow] 분류(Classification) 신경망 실습 본 실습은 크게 3가지 데이터 셋을 활용했습니다. 1. Iris Dataset 2. MNIST 3. MNIST Fashion Iris Classification 1. Load dataset from sklearn.datasets import load_iris iris = load_iris() X = iris.data y = iris.target 2. OnehotEncoding # One hot encoding from sklearn.preprocessing import OneHotEncoder enc = OneHotEncoder(sparse=False, handle_unknown='ignore') enc.fit(y.reshape(len(y), 1)) y_onehot = enc.transform(y.res.. 2022. 1. 7. 이전 1 다음 반응형