반응형

AI/DeepLearning 13

딥러닝 - 로지스틱 회귀(Logistic Regression)

로지스틱 회귀 머신러닝 로지스틱 회귀 개념을 다룰 때 ‘로지스틱 회귀’에 대한 개념 설명을 자세하게 설명했다. 로지스틱 회귀 개념, 모델링 과정 Logistic Regression 확률 문제를 선형회귀로 모델링 입력 : x = np.array([10, 20, 30, 40, 50, 60, 70, 80, 90, 100]).reshape(-1, 1) y = np.array([0, 0, 0, 0, 0, 1, 1, 1, 1, 1]).reshape(-1, 1) model = LinearRegression() model.fit(x,y) y_hat = x*m oaho.tistory.com breast_cancer 데이터 사용 target값 = 0 or 1 => 로지스틱 회귀 문제 입력: x.shape, y.shape ..

AI/DeepLearning 2023.03.01

멀티클래스 분류, 히든레이어 모델링

멀티클래스 분류 멀티 클래스 분류 : 여러개(3개 이상)의 아웃풋에서 가장 확률 높은 클래스를 고르는 것 => Input( shape=(4 , )) Dense(3, activation='softmax') 분류 문제 : softmax 회귀 문제 : activation 명시 안해도 됨 iris데이터사용 - 품종 분류 문제 1. x, y x = iris.data y = iris.target 2. 변수 개수 확인 x.shape, y.shape 출력 : ((150, 4), (150,)) 3. target 이름 확인 iris.target_names => 출력 : 4. train set / test set 분리 from sklearn.model_selection import train_test_split x_trai..

AI/DeepLearning 2023.03.01

딥러닝_선형회귀(Linear Regression), Sequential API, Functional API

선형회귀 => Input(shape=(3,)) Dense(1) 🌟 sequential API 사용 model.add( keras.layers.Input(shape=(3,))) model.add( keras.layers.Dense(1, activation='linear')) 🌟 Functional API 사용 input_layer(il) = keras.layers.Input(shape=(3,)) output_layer(ol) = keras.layers.Dense(1)(il) 1. 모듈 불러오기 import tensorflow as tf from tensorflow import keras import numpy as np 2. x, y 값 지정 x = np.array(range(20)) y = x * 2 -..

AI/DeepLearning 2023.02.28
반응형