import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.neighbors import KNeighborsClassifier import numpy as np fish = pd.read_csv('https://bit.ly/fish_csv_data') fish.head() print(pd.unique(fish['Species'])) #species 열만 출력 #데이터 준비 fish_input = fish[['Weight', 'Length', 'Diagonal', 'Height', 'Width']].to_numpy() #원하는..
회귀 회귀는 예측하고자 하는 타겟값이 실수인 경우에 사용한다. 선형 회귀를 통한 대상의 길이 예측, 예상 거래량, 대상이 참일 확률 등과 같이 결과값이 연속성을 지닌 경우에 사용한다. 분류 분류는 예측하고자 하는 타겟값이 범주형 변수인 경우에 사용한다. 연속성을 지니지 않고 이산값을 가진다. 0 과 1로 처리할 수 있는 값을 의미하고, 참/거짓, 여러 대상 중 하나의 타겟으로 분류하는 등에 사용한다. 분류는 이진 분류와 다중 분류가 있는데 이진 분류는 0 or 1로 분류하는 것이고, 다중 분류는 여러 대상 중 하나로 분류하는 것이다.
#다중회귀, 길이,높이,두께 데이터를 모두 사용함. #판다스로 csv파일 가져오기 import pandas as pd df = pd.read_csv('https://raw.githubusercontent.com/rickiepark/hg-mldl/master/perch_full.csv') perch_full = df.to_numpy() print(perch_full) import numpy as np from sklearn.model_selection import train_test_split from sklearn.preprocessing import PolynomialFeatures #특성을 제곱한 항을 추가하고 특성끼리 서로 곱한 항을 추가 perch_weight = np.array([5.9, 32...
#무게를 예측하기(회귀) import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.neighbors import KNeighborsRegressor #회귀 알고리즘 from sklearn.metrics import mean_absolute_error #넘파이 배열로 만들기 perch_length = np.array([8.4, 13.7, 15.0, 16.2, 17.4, 18.0, 18.7, 19.0, 19.6, 20.0, 21.0, 21.0, 21.0, 21.3, 22.0, 22.0, 22.0, 22.0, 22.0, 22.5, 22.5, 22.7, 23.0..
#train, test set 만들어서 학습하고 이웃 구하기 from sklearn.neighbors import KNeighborsClassifier from sklearn.model_selection import train_test_split import numpy as np import matplotlib.pyplot as plt bream_length = [25.4, 26.3, 26.5, 29.0, 29.0, 29.7, 29.7, 30.0, 30.0, 30.7, 31.0, 31.0, 31.5, 32.0, 32.0, 32.0, 33.0, 33.0, 33.5, 33.5, 34.0, 34.0, 34.5, 35.0, 35.0, 35.0, 35.0, 36.0, 36.0, 37.0, 38.5, 38.5, 3..
from sklearn.neighbors import KNeighborsClassifier import numpy as np import matplotlib.pyplot as plt bream_length = [25.4, 26.3, 26.5, 29.0, 29.0, 29.7, 29.7, 30.0, 30.0, 30.7, 31.0, 31.0, 31.5, 32.0, 32.0, 32.0, 33.0, 33.0, 33.5, 33.5, 34.0, 34.0, 34.5, 35.0, 35.0, 35.0, 35.0, 36.0, 36.0, 37.0, 38.5, 38.5, 39.5, 41.0, 41.0] bream_weight = [242.0, 290.0, 340.0, 363.0, 430.0, 450.0, 500.0, 390.0..
- Total
- Today
- Yesterday
- 단순선형회귀
- 로지스틱회귀
- CAN-FD
- HTML
- 이상탐지
- cuckoo
- m2crypto
- porks
- AVB
- 차량용 이더넷
- PCA
- many-to-many
- libssl1.0-dev
- automotive ethernet
- automotive
- Ethernet
- 회귀
- SOME/IP
- 크로스 엔트로피
- AVTP
- many-to-one
- 차량 네트워크
- 딥러닝
- 케라스
- json2html
- AE
- one-to-many
- SVM
- 머신러닝
- Python
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |