일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- aws jupyter notebook
- 코딩테스트
- queue
- 자료구조
- type hint
- 노마드코딩
- Matplotlib
- 알고리즘스터디
- 백준
- Algorithm
- javascript
- 알고리즘 스터디
- 선그래프
- 프로그래머스
- NumPy
- 가상환경
- dataframe
- 파이썬
- Stack
- pandas
- Selenium
- MySQL
- python
- 알고리즘
- 정보처리기사 c언어
- String Method
- 데이터시각화
- Join
- programmers
- openCV
- Today
- Total
목록AI/Machine Learning (4)
조금씩 꾸준히 완성을 향해

Logistic Regression # 데이터 준비 import pandas as pd fish = pd.read_csv('http://bit.ly/fish_csv_data') fish.head() z = a*무게 + b*길이 + c*대각선 + d*높이 + e두께 + f from sklearn.model_selection import train_test_split fish_input = fish[['Weight', 'Length', 'Diagonal', 'Height', 'Width']].to_numpy() fish_target = fish['Species'].to_numpy() train_input, test_input, train_target, test_target = train_test_split(..

선형 회귀 (Linear Regression) # 농어의 길이, 무게 확인 import matplotlib.pyplot as plt plt.scatter(perch_length, perch_weight) plt.xlabel('length') plt.ylabel('weight') plt.show() # 훈련, 테스트 세트 나누기 from sklearn.model_selection import train_test_split train_input, test_input, train_target, test_target = train_test_split( perch_length, perch_weight, random_state=42) # 1차원 배열 => 2차원 배열 train_input = train_input...

k-최근접 이웃 분류 vs 회귀 샘플에 가장 가까운 샘플 k개 선택한 후 이 수치들의 평균을 구하여 새로운 샘플의 타깃값 예측. 분류에서는 이웃의 label 개수를 확인해서 다수결로 타깃값을 예측했지만, 회귀에서는 이웃들의 평균을 계산한다는 점에서 차이. ▶ 농어의 길이로 무게 예측 예제 # 농어의 길이, 무게로 산점도 그리기 import matplotlib.pyplot as plt plt.scatter(perch_length, perch_weight) plt.xlabel('length') plt.ylabel('weight') plt.show() # 훈련, 테스트 세트 나누기 from sklearn.model_selection import train_test_split train_input, test_i..

최근접 이웃(K-Nearest Neighbor) 특별한 예측 모델 없이 가장 가까운 데이터 포인트를 기반으로 예측을 수행하는 방법 분류와 회귀 모두 지원 import pandas as pd import numpy as np import matplotlib.pyplot as plt ▶ 생선의 길이와 높이 데이터로 빙어인지, 도미인지 예측하는 분류 문제 # 데이터 준비 fish_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..