파이썬 와인 분류 - paisseon wain bunlyu

파이썬 사이킷런 내장 데이터 중에 load_wine 이라는 데이터가 있다. 이 데이터는 와인의 등급을 나눈 데이터이다. 데이터를 통해 와인의 등급을 Classification 해보도록 한다.

Classification(분류)

분류는 대표적인 지도학습 방법이다. 지도학습은 답이 주어진 데이터를 받아서 학습한 이후에 답이 주어지지 않은 데이터를 받았을 때 학습을 기반으로 답을 예측하는 것이다.

그러면 우선 파이썬으로 load_wine을 이용해서 와인 분류를 예측해보도록 하겠다.

from sklearn.datasets import load_wine from sklearn.tree import DecisionTreeClassifier from sklearn.model_selection import train_test_split import pandas as pd import numpy as np # 와인 데이터를 로드한다. wine = load_wine() # 와인 데이터에서 feature 로 되어있는 데이터를 갖고 온다. wine_data = wine.data # 와인 데이터에서 target 데이터를 갖고온다. wine_target = wine.target # wine 데이터의 feature, target로 Dataframe을 만든다. df_wine = pd.DataFrame(data = wine_data, columns=[wine.feature_names]) # feature 만 있는 데이터 프레임에 타겟 데이터를 추가한다. df_wine['target'] = wine.target df_wine

이렇게 하면 df_wine 의 값이 만들어져 나온다.

feature은 'alcohol', 'malic_acid', 'ash', 'alcalinity_of_ash', 'magnesium', 'total_phenols', 'flavanoids', 'nonflavanoid_phenols', 'proanthocyanins', 'color_intensity', 'hue', 'od280/od315_of_diluted_wines', 'proline'

target은 'class_0', 'class_1', 'class_2'로 구성되어 있고 0, 1, 2로 구분한다.

그 다음 학습용 데이터와 테스트 데이터를 만들어야 한다. 학습용 데이터와 테스트 데이터를 꼭 써야하는 이유는 학습용 데이터는 말 그대로 학습을 위한 데이터이다. 만약 학습용 데이터와 테스트 데이터가 같다면 정확도가 1이 나올 것이다. 이것은 예측 문제가 시험에 똑같이 나오는 것을 의미한다. 그러면 시험의 의미가 없다.

그래서 학습용 데이터로 학습을 시키고, 테스트 데이터로 얼마나 정보가 정확한지 테스트를 해줘야 한다.

사이킷런은 train_test_split()로 학습용 데이터, 테스트 데이터의 분류를 도와준다.

x_training, x_test, y_training, y_test = train_test_split(wine_data, wine_target, test_size=0.3)

train_test_split의 첫번째 데이터인 wine_data는 feature의 데이터이고

두번째 데이터인 wine_target은 target 데이터세트이다.

test_size는 전체 데이터 중에서 테스트 데이터의 비율이다. 현재는 0.3으로 해놨으니 0.7은 학습 데이터이고 0.3은 테스트 데이터이다.

dtc = DecisionTreeClassifier() dtc.fit(x_training, y_training)

DecisionTreeClassifier 객체를 행성한다. 생성된 DecisionTreeClassifier 객체의 fit() 을 이용해서 학습용 데이터의 feature 데이터, target 데이터를 이용하여서 학습을 수행한다.

학습을 수행하면 DecisionTreeClassifier 객체가 학습을 시켜서 예측을 수행 할 수 있다. 예측은 우리가 정해놨던 테스트 데이터로 하면 된다. 여기서 다시 한번 강조할 것은 학습용 데이터로 예측을 하면 안된다 ! 

predict = dtc.predict(x_test)

위에서처럼 x_test 데이터로 예측을 시행하였다. predict를 보면

[1 2 0 0 0 0 2 1 1 0 0 1 2 0 1 1 1 0 0 2 1 0 1 1 0 1 2 0 1 1 0 0 2 1 0 2 2 0 2 1 2 1 0 1 0 1 1 1 2 0 0 0 2 2]

이런식의 target 데이터를 볼 수 있다.

from sklearn.metrics import accuracy_score print(accuracy_score(y_test, predict))

예측 결과를 기반으로 예측 성능을 평가 할 수 있다. 일반적으로 정확도를 측정해보는데 사이킷런에서 제공하는 정확도 측정 함수 accuracy_score() 함수가 있다. accuracy_score()의 파라미터는 실제 target 데이터 세트, 예측 target 데이터 세트를 입력한다.

해당 결과의 예측 정확도는 0.7777 이 나왔다.

파이썬/PyTorch를 활용한 머신러닝, 딥러닝 철저 입문

2021. 1. 18. 11:06

와인데이터분류

61페이지 ----------- 목적 와인 분류하기¶

라이브러리 임포트 61페이지¶

파이토치의 구성요소¶

  1. torch : 텐서를 생성하는 라이브러리
  2. torch.autograd: 자동미분 기능을 제공하는 라이브러리
  3. torch.nn : 신경망을 생성하는 라이브러리
  4. torch.multiprocessing : 병렬처리 긴으을 제공하는 라이브러리
  5. torch.utils : 데이터 조작 등 유틸리티 기능 제공
  6. torch.legacy(./nn/optim) : Torch로부터 포팅해온 코드

라이브러리 설명¶

  1. jupyter : 개발 환경 기능을 제공하는 라이브러리
  2. Pillow : 이미지 처리 관련 함수를 제공하는 라이브러리
  3. Matplotlib : 그래프 작성용 함수를 제공하는 라이브러리
  4. Pandas : 데이터를 다루는 함수를 제공하는 라이브러ㅣ
  5. Scikit-learn : 머신러닝 관련 함수를 제공하는 라이브러리
  6. Konlpy : 자연어 처리용 함수를제공하는 라이브러리

In [1]:

# Pytorch 라이브러리 임포트 import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import DataLoader, TensorDataset

In [2]:

# scikit-learn 라이브러리 임포트 from sklearn.datasets import load_wine from sklearn.model_selection import train_test_split

In [3]:

#Pandas 라이브러리 임포트 import pandas as pd

In [4]:

# Numpy 라이브러리 임포트 import numpy as np

In [5]:

# time 라이브러리 임포트 import time

In [6]:

# 와인 데이터 읽기 wine = load_wine() wine

Out[6]:

{'data': array([[1.423e+01, 1.710e+00, 2.430e+00, ..., 1.040e+00, 3.920e+00, 1.065e+03], [1.320e+01, 1.780e+00, 2.140e+00, ..., 1.050e+00, 3.400e+00, 1.050e+03], [1.316e+01, 2.360e+00, 2.670e+00, ..., 1.030e+00, 3.170e+00, 1.185e+03], ..., [1.327e+01, 4.280e+00, 2.260e+00, ..., 5.900e-01, 1.560e+00, 8.350e+02], [1.317e+01, 2.590e+00, 2.370e+00, ..., 6.000e-01, 1.620e+00, 8.400e+02], [1.413e+01, 4.100e+00, 2.740e+00, ..., 6.100e-01, 1.600e+00, 5.600e+02]]), 'target': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]), 'frame': None, 'target_names': array(['class_0', 'class_1', 'class_2'], dtype='<U7'), 'DESCR': '.. _wine_dataset:\n\nWine recognition dataset\n------------------------\n\n**Data Set Characteristics:**\n\n :Number of Instances: 178 (50 in each of three classes)\n :Number of Attributes: 13 numeric, predictive attributes and the class\n :Attribute Information:\n \t\t- Alcohol\n \t\t- Malic acid\n \t\t- Ash\n\t\t- Alcalinity of ash \n \t\t- Magnesium\n\t\t- Total phenols\n \t\t- Flavanoids\n \t\t- Nonflavanoid phenols\n \t\t- Proanthocyanins\n\t\t- Color intensity\n \t\t- Hue\n \t\t- OD280/OD315 of diluted wines\n \t\t- Proline\n\n - class:\n - class_0\n - class_1\n - class_2\n\t\t\n :Summary Statistics:\n \n ============================= ==== ===== ======= =====\n Min Max Mean SD\n ============================= ==== ===== ======= =====\n Alcohol: 11.0 14.8 13.0 0.8\n Malic Acid: 0.74 5.80 2.34 1.12\n Ash: 1.36 3.23 2.36 0.27\n Alcalinity of Ash: 10.6 30.0 19.5 3.3\n Magnesium: 70.0 162.0 99.7 14.3\n Total Phenols: 0.98 3.88 2.29 0.63\n Flavanoids: 0.34 5.08 2.03 1.00\n Nonflavanoid Phenols: 0.13 0.66 0.36 0.12\n Proanthocyanins: 0.41 3.58 1.59 0.57\n Colour Intensity: 1.3 13.0 5.1 2.3\n Hue: 0.48 1.71 0.96 0.23\n OD280/OD315 of diluted wines: 1.27 4.00 2.61 0.71\n Proline: 278 1680 746 315\n ============================= ==== ===== ======= =====\n\n :Missing Attribute Values: None\n :Class Distribution: class_0 (59), class_1 (71), class_2 (48)\n :Creator: R.A. Fisher\n :Donor: Michael Marshall (MARSHALL%)\n :Date: July, 1988\n\nThis is a copy of UCI ML Wine recognition datasets.\n//archive.ics.uci.edu/ml/machine-learning-databases/wine/wine.data\n\nThe data is the results of a chemical analysis of wines grown in the same\nregion in Italy by three different cultivators. There are thirteen different\nmeasurements taken for different constituents found in the three types of\nwine.\n\nOriginal Owners: \n\nForina, M. et al, PARVUS - \nAn Extendible Package for Data Exploration, Classification and Correlation. \nInstitute of Pharmaceutical and Food Analysis and Technologies,\nVia Brigata Salerno, 16147 Genoa, Italy.\n\nCitation:\n\nLichman, M. (2013). UCI Machine Learning Repository\n[//archive.ics.uci.edu/ml]. Irvine, CA: University of California,\nSchool of Information and Computer Science. \n\n.. topic:: References\n\n (1) S. Aeberhard, D. Coomans and O. de Vel, \n Comparison of Classifiers in High Dimensional Settings, \n Tech. Rep. no. 92-02, (1992), Dept. of Computer Science and Dept. of \n Mathematics and Statistics, James Cook University of North Queensland. \n (Also submitted to Technometrics). \n\n The data was used with many others for comparing various \n classifiers. The classes are separable, though only RDA \n has achieved 100% correct classification. \n (RDA : 100%, QDA 99.4%, LDA 98.9%, 1NN 96.1% (z-transformed data)) \n (All results using the leave-one-out technique) \n\n (2) S. Aeberhard, D. Coomans and O. de Vel, \n "THE CLASSIFICATION PERFORMANCE OF RDA" \n Tech. Rep. no. 92-01, (1992), Dept. of Computer Science and Dept. of \n Mathematics and Statistics, James Cook University of North Queensland. \n (Also submitted to Journal of Chemometrics).\n', 'feature_names': ['alcohol', 'malic_acid', 'ash', 'alcalinity_of_ash', 'magnesium', 'total_phenols', 'flavanoids', 'nonflavanoid_phenols', 'proanthocyanins', 'color_intensity', 'hue', 'od280/od315_of_diluted_wines', 'proline']}

In [7]:

pd.DataFrame(wine.data, columns = wine.feature_names)

Out[7]:

alcoholmalic_acidashalcalinity_of_ashmagnesiumtotal_phenolsflavanoidsnonflavanoid_phenolsproanthocyaninscolor_intensityhueod280/od315_of_diluted_winesproline01234...173174175176177
14.23 1.71 2.43 15.6 127.0 2.80 3.06 0.28 2.29 5.64 1.04 3.92 1065.0
13.20 1.78 2.14 11.2 100.0 2.65 2.76 0.26 1.28 4.38 1.05 3.40 1050.0
13.16 2.36 2.67 18.6 101.0 2.80 3.24 0.30 2.81 5.68 1.03 3.17 1185.0
14.37 1.95 2.50 16.8 113.0 3.85 3.49 0.24 2.18 7.80 0.86 3.45 1480.0
13.24 2.59 2.87 21.0 118.0 2.80 2.69 0.39 1.82 4.32 1.04 2.93 735.0
... ... ... ... ... ... ... ... ... ... ... ... ...
13.71 5.65 2.45 20.5 95.0 1.68 0.61 0.52 1.06 7.70 0.64 1.74 740.0
13.40 3.91 2.48 23.0 102.0 1.80 0.75 0.43 1.41 7.30 0.70 1.56 750.0
13.27 4.28 2.26 20.0 120.0 1.59 0.69 0.43 1.35 10.20 0.59 1.56 835.0
13.17 2.59 2.37 20.0 120.0 1.65 0.68 0.53 1.46 9.30 0.60 1.62 840.0
14.13 4.10 2.74 24.5 96.0 2.05 0.76 0.56 1.35 9.20 0.61 1.60 560.0

178 rows × 13 columns

In [8]:

# 목적변수 데이터 출력 wine.target

Out[8]:

array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2])

In [9]:

#설명변수와 목적변수를 변수에 대입 wine_data = wine.data[0:130] wine_target = wine.target[0:130]

In [10]:

#데이터 집합을 훈련 데이터와 테스트 데이터로 분할 np.random.seed(100) train_x, test_x, train_y, test_y = train_test_split(wine_data, wine_target, test_size = 0.2) print(len(train_x)) print(len(test_x)) print(train_x) print(train_y)

104 26 [[1.339e+01 1.770e+00 2.620e+00 ... 9.200e-01 3.220e+00 1.195e+03] [1.229e+01 1.410e+00 1.980e+00 ... 1.230e+00 2.740e+00 4.280e+02] [1.196e+01 1.090e+00 2.300e+00 ... 9.900e-01 3.130e+00 8.860e+02] ... [1.237e+01 1.170e+00 1.920e+00 ... 1.120e+00 3.480e+00 5.100e+02] [1.350e+01 1.810e+00 2.610e+00 ... 1.120e+00 3.820e+00 8.450e+02] [1.483e+01 1.640e+00 2.170e+00 ... 1.080e+00 2.850e+00 1.045e+03]] [0 1 1 1 1 1 1 0 1 0 1 0 0 1 0 1 1 0 0 0 0 1 0 1 0 1 1 0 1 0 0 1 1 1 1 0 1 1 0 1 1 1 1 0 0 0 0 1 1 0 0 1 1 1 0 1 1 1 0 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 0 1 1 0 0 0 1 1 1 0 1 1 1 0 0 1 1 0 1 0 1 0 0 1 1 1 1 0 0]

In [11]:

# 텐서는 다차원 배열이라는 의미를 가진다. ## 파이토치 함수 # -> troch.from.numpy(ndarray) #훈련 데이터 텐서 변환 train_x = torch.from_numpy(train_x).float() train_y = torch.from_numpy(train_y).long() print(train_x) print(train_y) # 테스트 데이터 텐서 변환 test_x = torch.from_numpy(test_x).float() test_y = torch.from_numpy(test_y).long() # 텐서로 변환한 데이터 건수 확인 print(train_x.shape) print(train_y.shape)

tensor([[1.3390e+01, 1.7700e+00, 2.6200e+00, ..., 9.2000e-01, 3.2200e+00, 1.1950e+03], [1.2290e+01, 1.4100e+00, 1.9800e+00, ..., 1.2300e+00, 2.7400e+00, 4.2800e+02], [1.1960e+01, 1.0900e+00, 2.3000e+00, ..., 9.9000e-01, 3.1300e+00, 8.8600e+02], ..., [1.2370e+01, 1.1700e+00, 1.9200e+00, ..., 1.1200e+00, 3.4800e+00, 5.1000e+02], [1.3500e+01, 1.8100e+00, 2.6100e+00, ..., 1.1200e+00, 3.8200e+00, 8.4500e+02], [1.4830e+01, 1.6400e+00, 2.1700e+00, ..., 1.0800e+00, 2.8500e+00, 1.0450e+03]]) tensor([0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0]) torch.Size([104, 13]) torch.Size([104])

배치학습과 미니배치학습의 차이 (퍼셉트론의 역전파 과정)¶

배치학습¶

- > 배치학습은 가중치를 한 번 업데이트할 때 모든 데이터를 사용한다.¶

미니배치학습¶

-> 미니배치학습은 데이터를 여러 갈래로 나누어 한 갈래씩 사용해 가중치를 업데이트한다.¶

결론¶

일반적으로 미니배치학습을 사용하는 경우가 많다.¶

그 이유로 배치학습을 사용하면 경사하강법으로 최적해를 구하는 과정에서 국소최적해에 빠지는 경우가 있다.¶

미니배치학습은 데이터를 여러 갈래로 나누어 가중치를 업데이트 한 번에 한 갈래의 데이터만 사용하므로 국소 최적해에 빠지는 것을 방지한다.¶

데이터가 매번 달라지면서 오차곡선도 달라지기 때문이다. 이렇게 미니배치학습으로 최적해를 구하는 기법을 확률적 경사하강법(stochastic gradient descent, SGD)이라고 한다.¶

In [12]:

# 설명변수와 목적변수의 텐서를 합침 train = TensorDataset(train_x,train_y) # 텐서의 첫번째 데이터 내용 확인 print(train[0]) #미니 배치로 분할 train_loader = DataLoader(train,batch_size= 16, shuffle= True)

(tensor([1.3390e+01, 1.7700e+00, 2.6200e+00, 1.6100e+01, 9.3000e+01, 2.8500e+00, 2.9400e+00, 3.4000e-01, 1.4500e+00, 4.8000e+00, 9.2000e-01, 3.2200e+00, 1.1950e+03]), tensor(0))

파이토치 함수¶

torch.utils.data.DataTensorDataset(data_tensor, target_tensor)¶

: 설명변수와 목적변수를 합쳐 인덱스를 붙이고 하나의 데이터 집합으로 만든다.

torch.utils.data.DataLoader(dataset, batch_size =1 , shuffle= False)¶

:데이터 집합을 원하는 크기의 미니배치로 나누어 읽어 들인다. shuffle(Ture/False) : 각 에포크마다 데이터를 셔플링 할지 여부, 기본값은 False

신경망 구성¶

In [16]:

# 신경망 구성 class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.func1 = nn.Linear(13, 96) self.func2 = nn.Linear(96, 2) def forward(self, x): # 1층 x = self.func1(x) # 1층 활성화함수 x = F.relu(x) # 2층 x = self.func2(x) # 2층 활성화함수 (=출력함수) y = F.log_softmax(x, dim=1) return y # 인스턴스 생성 model = Net() ## 생성자 매서드에서 입력층과 중간층 상이의 결합, 중간층과 출력층 상이의 결합, 그리고 가 층의 노드 수를 정의함 ## forward 매서드에서는 활성화 함수를 정의하며, 중간층에는 ReLU 함수를 사용, 출력층은 소프트맥스 함수를 사용한다. ## 그다음 model이라는 이름으로 이 클래스의 인스턴스를 생성

torch.nn,Module¶

모든 신경망 모듈의 기본이 되는 클래스다. 이 클래스 안에는 각 층과 함수, 신경망의 구조를 정의한다.

torch.nn.Linear(in_features, out_features, bias = True)¶

입력 데이터에 대한 선형 변환(y=ax+b)를 계산한다.

in_features : 입력 데이터의 차원의 수¶

out_features :출력 데이터의 차원의 수¶

bias: 바이어스 학습 여부, 기본값은 True¶

torch.nn.functional.relu(input)¶

: ReLU를 구현한 함수

torch.nn.functional.softmax(input)¶

:로그 소프트맥스를 구현한 함수

모형 학습¶

In [20]:

%%time print("{} \t {}".format("epoch","total loss")) print("----\t---------------------------------") # 오차함수 객체 criterion = nn.CrossEntropyLoss() #최적화를 담당할 객체 optimizer = optim.SGD(model.parameters(), lr=0.01) # 7 iteration = 1 epoch # 350 iteration = 50 epoch for i in range(350): total_loss = 0 for train_x, train_y in train_loader: # 계산 그래프 구성 train_x, train_y = Variable(train_x), Variable(train_y) # gradient 초기화 optimizer.zero_grad() # forward 계산 output = model.forward(train_x) # loss 계산 loss = criterion(output, train_y) # 오차 역전파 loss.backward() # gradient update optimizer.step() # 누적 오차 계산 total_loss += loss.data # 10번째 epoch마다 loss 출력 if (i+1) % 70 == 0: print("{} \t {}".format((i+1)//7, total_loss))

epoch total loss ---- --------------------------------- 10 4.771245956420898 20 4.78312349319458 30 4.813862323760986 40 4.813140869140625 50 4.812633514404297 Wall time: 1.23 s

torch.nn.CrossEntropy¶

: 교차 엔트로피 함수

torch.optim.SGD(params, lr= 학습률)¶

: 확률적 경사하강법을 구현한 클래스

torch.autograd.Variable(data)¶

:텐서를 래핑하고, 계산 과정을 기록하는 역할을 한다. data는 입력할 텐서인다.

torch.autograd.backward(variables)¶

경사의 합을 구한다. variabes:입력변수

In [32]:

#계산 그래프 구성 test_x, test_y = Variable(test_x), Variable(test_y) #출력이 0 혹은 1이 되게 함 result = torch.max(model(test_x).data, 1)[1] #모형의 정확도 측정 (test_y와 결과가 같은 예측 값의 개수(맞춘 개수) 계산) accuracy = sum(test_y.data.numpy() == result.numpy())/len(test_y.data.numpy()) #모형의 정확도 출력 accuracy

Toplist

최신 우편물

태그