์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- Absolute
- AGI
- ai
- AI agents
- AI engineer
- AI researcher
- ajax
- algorithm
- Algorithms
- aliases
- Array ๊ฐ์ฒด
- ASI
- bayes' theorem
- Bit
- Blur
- BOM
- bootstrap
- canva
- challenges
- ChatGPT
- Today
- In Total
A Joyful AI Research Journey๐ณ๐
[9] 241111 ML, DL [Goorm All-In-One Pass! AI Project Master - 4th Session, Day 9] ๋ณธ๋ฌธ
[9] 241111 ML, DL [Goorm All-In-One Pass! AI Project Master - 4th Session, Day 9]
yjyuwisely 2024. 11. 11. 11:37241111 Mon 9th class
์ค๋ ๋ฐฐ์ด ๊ฒ ์ค ๊ธฐ์ตํ ๊ฒ์ ์ ๋ฆฌํ๋ค.
ํ๋ก์ ํธ ๋ฐํ
์ต์ ๋ชจ๋ธ ๋น๊ต
RAG Lanchain
ํ์ค ๋์์ธ์ผ๋ก ์ ์ฉ
ํ์ธํ๋ (์ฑ๋ฅ ์ฌ๋ฆผ)
ํ๋ก์ ํธ๋ก ๊ฐ๋ฅ์ฑ์ ๋ณด์ฌ์ค๋ค.
์ค๋ฌด, ์ค์ง์ ์ธ ๊ฒ์ผ๋ก ๊ณต๋ถ
์์ ์ฑ ์ ์ฐ๋ค.
๋ชจ๋ฅด๋ฉด ๋ ธ๊ฐ๋ค
์ฑ๋ฅ ์ฌ๋ฆฌ๋ ๊ฒ ๋์ด๋ ๋์, ํ๊ณO
ํ๋์ ์ ๋ฌธ ๋ถ์ผ ํ์
๊ฐ๊ณ ์ํ๋ ๋ถ์ผ๋ฅผ ๊ตฌ์ฒด์ ์ผ๋ก ์ ํ๊ณ , ์ ๋ฌธ๊ฐ๊ฐ ๋๋ค.
ex) ๊ต์ก, ์ด์ค๊ธ์ ๋ง์ถ์, ๊ณ์ ๊ฐ์์ค
๊ธฐ๋ณธ์ ๋ชจ๋ฅด๊ณ ํ๋ฉดX
์ฑ ์ 1๊ถ ๋ด์ผํ๋ค. ๋งจ๋ LLMํ ์๋ X
๋น ๋ฐ์ดํฐ๊ธฐ์ฌ
๊ธฐ๋ณธ์ ์๋ ์ฌ๋๊ณผ ๋ชจ๋ฅด๋ ์ฌ๋์ ์ฐจ์ด๊ฐ ํฌ๋ค
AI ์๊ณ ํ์ฉํ๋ ์ฌ๋, ์ ํ๋ ์ฌ๋ ์ฐจ์ด๊ฐ ํฌ๋ค
๋ณํ์ ์๊ธฐ์ ๋์ ์ญ๋์ ํค์ด๋ค
๊ณ์ ๊ณต๋ถ, ๋ฐ์ ์์ผ ๋๊ฐ๋ค -> ์ฑ์ฅ, ๋ฐ์
AI๊ฐ ์ผ์๋ฆฌ ์๊ฒ ํจ
ํ์ง๋ง ๊ทธ ๋ณํ ์์์ AI ์๊ณ ์ดํดํ๋ ์ฌ๋์ ์๋ฆฌ๋ ์๊ธด๋ค.
์ค๋น -> ์๊ธฐ -> Try
๋ณํ์ ์๊ธฐ, ๋ ํฐ ๊ธฐํO
ํ๋ก์ ํธ ์ ์ ๊ฐ๋ฅ (์์์ผ)
https://github.com/LDJWJ/ML_Basic_Class
GitHub - LDJWJ/ML_Basic_Class
Contribute to LDJWJ/ML_Basic_Class development by creating an account on GitHub.
github.com
https://github.com/LDJWJ/DL_Basic
GitHub - LDJWJ/DL_Basic
Contribute to LDJWJ/DL_Basic development by creating an account on GitHub.
github.com
https://rowan-sail-868.notion.site/0fc66cdf182c4e24be0dc0e09a91d5dc
๋จธ์ ๋ฌ๋ ์ด๋ณด ์ฒซ๊ฑธ์ | Notion
Notion ํ: ํ์ด์ง๋ฅผ ์์ฑํ ๋๋ ๋ช ํํ ์ ๋ชฉ๊ณผ ๊ด๋ จ๋ ๋ด์ฉ์ด ํ์ํฉ๋๋ค. ์ธ์ฆ๋ ์ ๋ณด๋ฅผ ์ฌ์ฉํ๊ณ , ํ์ด์ง ์ฃผ์ ๋ฅผ ํ์คํ ํ๊ณ , ์ฃผ์ ์ด์์ ๋ํ ์๊ฒฌ์ ๊ณต์ ํ์ธ์.
rowan-sail-868.notion.site
https://colab.research.google.com/drive/1nEuXxqNNHSVMlE4-Y2syZjFZSifOonHm#scrollTo=rMLqPtwDixg7
Google Colab Notebook
Run, share, and edit Python notebooks
colab.research.google.com

์ธ๊ณต์ง๋ฅ > ๋จธ์ ๋ฌ๋ > ๋ฅ๋ฌ๋
๋ฅ๋ฌ๋ ์ฌ์ฉ ๋ง์ด ๋จ, ์ปค์ง



๊ฐ๋ฐ (๋) -> ์ปฌ๋ผ
target
๊ณต์ y=f(x)
x๋ฅผ ๋
๋ฆฝ๋ณ์, y๋ฅผ ์ข
์๋ณ์
Yes, in the context of machine learning, y is typically referred to as the target or label.



๋จธ์ ๋ฌ๋: y ๊ฐ ์์ธก
๋ฐ์ดํฐ ๋ง์ด๋: y ๊ฐ ์์ธก์ ์ํฅ ๋ผ์น๋ ๊ฒ ๊ถ๊ธ
์ ํ ํ๊ท(็ทๅๅๆญธ, ์์ด: linear regression)๋ ์ข
์ ๋ณ์ y์ ํ ๊ฐ ์ด์์ ๋
๋ฆฝ ๋ณ์ (๋๋ ์ค๋ช
๋ณ์) X์์ ์ ํ ์๊ด ๊ด๊ณ๋ฅผ ๋ชจ๋ธ๋งํ๋ ํ๊ท๋ถ์
y-tip = total_bill + size

x๊ฐ 3๊ฐ, 4์ฐจ์, ์ดํ๋ฉด
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np # Generate some example data np.random.seed(0) x1 = np.random.rand(50) * 10 # Random values for x1 x2 = np.random.rand(50) * 10 # Random values for x2 x3 = np.random.rand(50) * 10 # Random values for x3 y = x1 * 0.3 + x2 * 0.5 + x3 * 0.2 # Example relation for y # Plotting the 3D space fig = plt.figure(figsize=(10, 7)) ax = fig.add_subplot(111, projection='3d') sc = ax.scatter(x1, x2, x3, c=y, cmap='viridis', s=50) # Labeling the axes ax.set_xlabel('X1') ax.set_ylabel('X2') ax.set_zlabel('X3') plt.colorbar(sc, label="Y (Target Value)") # Display the plot plt.title("3D Space Representation with X1, X2, X3 and Y") plt.show()

Label Encoding
- ๊ฐ ๊ณ ์ ํ ๋ฌธ์ ๊ฐ์ ์ซ์ ๊ฐ์ผ๋ก ๋งคํํฉ๋๋ค. ์๋ฅผ ๋ค์ด, ['male', 'female']์ ๊ฐ๊ฐ 0๊ณผ 1๋ก ๋ณํํฉ๋๋ค.
- ์นดํ ๊ณ ๋ฆฌํ ๋ฐ์ดํฐ๊ฐ ์์ด ๊ด๊ณ๊ฐ ์์ ๋ ์ฌ์ฉํฉ๋๋ค.
from sklearn.preprocessing import LabelEncoder encoder = LabelEncoder() df['sex'] = encoder.fit_transform(df['sex']) # 'male' -> 1, 'female' -> 0
One-Hot Encoding
- ๊ฐ ์นดํ ๊ณ ๋ฆฌ ๊ฐ๋ง๋ค **๋ณ๋์ ์ด(column)**์ ์ถ๊ฐํ๊ณ , ๊ฐ์ด ์๋ ๊ฒฝ์ฐ 1, ๊ทธ๋ ์ง ์์ผ๋ฉด 0์ ํ ๋นํฉ๋๋ค.
- ์๋ฅผ ๋ค์ด, ['Monday', 'Tuesday', 'Wednesday']๋ ๊ฐ๊ฐ์ ์์ผ์ ์ด๋ก ๋ง๋ค์ด [1, 0, 0], [0, 1, 0], [0, 0, 1]์ฒ๋ผ ํํํฉ๋๋ค.
- ์ฃผ๋ก ์์ด์ด ์๋ ๋ฒ์ฃผํ ๋ฐ์ดํฐ์ ์ฌ์ฉ๋ฉ๋๋ค.
import pandas as pd df = pd.get_dummies(df, columns=['day'])
Embedding
- ํ ์คํธ์ ๊ฐ์ ๋ณต์กํ ๋ฐ์ดํฐ๋ฅผ ๋ฒกํฐ๋ก ํํํ๊ธฐ ์ํด ์ฌ์ฉ๋ฉ๋๋ค. ๊ฐ ๋จ์ด๋ ๋ฌธ์ฅ์ ๊ณ ์ฐจ์ ๋ฒกํฐ ๊ณต๊ฐ์ ์ซ์ ํํ๋ก ๋ณํํฉ๋๋ค.
- ๋ฅ๋ฌ๋์์ ์ฃผ๋ก ์ฌ์ฉํ๋ ๋ฐฉ์์ผ๋ก, ์๋ ์๋ฒ ๋ฉ(Word Embedding) ๊ธฐ๋ฒ์๋ Word2Vec, GloVe, BERT ๋ฑ์ด ์์ต๋๋ค.
Ordinal Encoding
- ๋ฌธ์๊ฐ ํน์ ์์๋ ํฌ๊ธฐ๋ฅผ ํํํ ๋ ์ฌ์ฉํฉ๋๋ค. ์๋ฅผ ๋ค์ด, ['low', 'medium', 'high']๋ฅผ [0, 1, 2]๋ก ๋ณํํ ์ ์์ต๋๋ค.
print( tips['sex'].unique() ) print( tips['smoker'].unique() ) print( tips['day'].unique() ) print( tips['time'].unique() ) print( tips['size'].unique() )
mapval = {'Female':0, 'Male':1} tips['sex_mapped'] = tips['sex'].map(mapval) tips
7-2 ์ค์ต 2- smoker๊ณผ day๋ฅผ ๋ณ์์ ์ถ๊ฐํด์ ๋ชจ๋ธ์ ๊ตฌ์ถํด ๋ณด๊ธฐ.



๋ฐ์ดํฐ ํน์์ฑ ์ค๋ช ํ ์ ์์ด์ผ ํจ
[๋จธ์ ๋ฌ๋] K-์ต๊ทผ์ ์ด์ ํ๊ท (K-NN Regression) ๊ฐ๋ ๋ฐ ์ค์ต
[๋ชฉ์ฐจ] 1. K-NN Regression 2. KNeighborsRegressor Class 3. K-NN Regression ์ค์ต 4. ๊ณผ๋์ ํฉ vs ๊ณผ์์ ํฉ 5. K-NN Regression์ ํ๊ณ 1. K-NN Regression ์ด์ ์๋ ์์ ์ด ๋๋ฏธ์ ์ํ๋์ง ๋น์ด์ ์ํ๋์ง '๋ถ๋ฅ'ํ๋ ๋ฌธ์ ๋ฅผ
rebro.kr