Keras
-
R에 Keras 설치하기Keras 2019. 2. 21. 23:04
R과 Keras 연동하기(설치하기) 1. R/RStudio 설치하기 2. Anacona 설치하기2.1 RStudio -> Tools -> Global Options -> Packages -> Disable both "Use secure download method for HTTP" and "Use Internet Explorer library/proxy for HTTP" 3. Anaconda Prompt를 실행하여 다음을 실행한다.3.1 conda update --all3.2 conda create -n buillee python=3.7 anaconda 여기서 buillee는 각자에 맞게 변경하면 된다.3.3 conda activate3.4 activate buillee3.5 C:\R\R-3.5.2\bi..
-
LSTM과 CNN의 조합을 이용한 영화 리뷰 분류하기Keras 2018. 1. 10. 18:03
import matplotlib.pyplot as pltimport numpy as np import tensorflow as tffrom keras.datasets import imdb from keras.utils import np_utils from keras.models import Sequential from keras.layers import Dense, LSTM, Embedding from keras.layers import Conv1D, MaxPooling1D, Dropout from keras.preprocessing import sequence # seed 값 설정 seed = 0 np.random.seed(seed) tf.set_random_seed(seed) # 데이터 불러오기 (x..
-
LSTM을 이용해 로이터 뉴스 카테고리 분석하기Keras 2018. 1. 10. 17:02
# 패키지 불러오기import matplotlib.pyplot as plt import numpy as np import tensorflow as tffrom keras.datasets import reuters from keras.utils import np_utils from keras.models import Sequential from keras.layers import Dense, LSTM, Embedding from keras.preprocessing import sequence # seed 값 설정 seed = 0 np.random.seed(seed) tf.set_random_seed(seed) # 학습 데이터와 테스트 데이터로 나누기 (x_train, y_train), (x_test, y_..
-
iris 품종 예측하기Keras 2018. 1. 9. 18:11
import pandas as pdimport seaborn as sns import matplotlib.pyplot as plt from sklearn.preprocessing import LabelEncoder from keras.utils import np_utils from keras.models import Sequential from keras.layers import Dense # 데이터 불러오기 iris = pd.read_csv("d:/MachineLearning/dataset/iris.csv", names = ["SL", "SW", "PL", "PW", "Species"]) # 데이터 일부 보기 iris.head() # 데이터 구조 보기 iris.info() # 품종별 히스토그램/산점도 ..