Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- wcss
- data
- 반복문
- analizer
- string
- len()
- del
- function
- IN
- numpy
- 덴드로그램
- nan
- Machine Learning
- hierarchical_clustering
- list
- sklearn
- append()
- 최댓값
- elbow method
- Dictionary
- pandas
- DataFrame
- matplotlib
- Python
- count()
- 분류 결과표
- 최솟값
- DataAccess
- insert()
- dendrogram
Archives
- Today
- Total
개발공부
레이블 인코딩된 값을 원 핫 인코딩으로 바꾸기 to_categorical() 본문
y는 0 - 9의 값으로 레이블 인코딩되어 있다.
>>> y_train
array([5, 0, 4, ..., 5, 6, 8], dtype=uint8)
이를 원핫 인코딩된 값으로 바꾸는 방법은 아래와 같다.
to_categorical(인코딩할 값, num_classes = 분류 개수)
from tensorflow.keras.utils import to_categorical
y_train = to_categorical(y_train, num_classes = 10)
'Python > Deep Learning' 카테고리의 다른 글
| JPG나 PNG와 같은 이미지 파일을 학습 데이터로 만드는 방법 (0) | 2022.06.15 |
|---|---|
| CNN 모델링 과정, 코드 예제 (0) | 2022.06.14 |
| 텐서플로우의 모델, 네트워크, 웨이트를 저장하고 불러오는 방법 (0) | 2022.06.14 |
| 텐서플로우의 콜백 클래스를 이용해서, 원하는 조건이 되면 학습을 멈추게 하는 코드 (0) | 2022.06.13 |
| 에포크에 따른 학습데이터/밸리데이션 데이터의 관계 (0) | 2022.06.13 |