혼자 공부하는 방

  • 홈
  • 방명록

Keras 2

keras : 단순선형회귀 모델

import tensorflow as tf from keras.models import Sequential from keras.layers import Dense from keras import optimizers import numpy as np # x_data, y_data 설정하고 상관계수 확인 x_data = [1.,2.,3.,4.,5.] y_data = [1.2,2.0,3.0,3.5,5.5] print('상관계수 : ', np.corrcoef([x_data, y_data])) # 모델 입력, 컴파일 model = Sequential() model.add(Dense(units = 1, input_dim = 1, activation = 'linear' )) model.compile(optimizer..

데이터분석/Tensorflow 2022.05.19

Tensorflow 와 Keras

# 선형회귀 분석전 실습 cost를 최소화 하는 과정을 시각화 Keras를 사용하지 않고 Tensorflow만 사용했다. import tensorflow as tf import matplotlib.pyplot as plt x = [1,2,3,4,5] y = [2,4,6,8,10] b = 0 hypothesis = w * x + b ( w : weight, b : bias) w_val = [] cost_val = [] for i in range(-30, 50): feed_w = i * 0.1 # 0.1 은 학습률(learning rate) hypothesis = tf.multiply(feed_w, x) + b # y = wx+b cost = tf.reduce_mean(tf.square(hypothesis ..

데이터분석/Tensorflow 2022.05.19
이전
1
다음
더보기
프로필사진

혼자 공부하는 방

  • 분류 전체보기
    • 공부
      • 알고리즘
      • 컴퓨터
    • 데이터분석
      • 데이터분석
      • Tensorflow
      • 예시코드

Tag

sklearn, 텐서플로, countvectorizer, 배깅, lstm, 앙상블, 프로그래머스, DBSCAN, 선형회귀모델, 분류모델, TfidfVectorizer, Keras, 빅데이터분석기사 실기, konlpy, Ensemble, sqld, TensorFlow, rnn, Logistic Regression, SVM,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/07   »
일 월 화 수 목 금 토
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

  • github

티스토리툴바