์ ์ฒด ๊ธ59 (AI) openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors. ๐ถ ์๋ฌโ๏ธ ์์ ํ๊ฒฝ - Window (PowerShell) - VSCode - Python 3.10โ๏ธ ์์ ๋ด์ฉ (OpenAI API ํ ์คํธ) 1. API Key ์์ฑ 2. ํ๊ฒฝ๋ณ์ ์ค์ setx OPENAI_API_KEY "your_api_key_here" 3. OpenAI API ์ค์นpip install openaiโ 4. ์์ค ์ฝ๋ ์์ฑ (text_example.py)from openai import OpenAIclient = OpenAI()completion = client.chat.completions.create( model="gpt-4o-mini", messages=[ {"role": "system", "content": "You are a h.. 2025. 1. 31. (AI) openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable ๐ถ ์๋ฌโ๏ธ ์์ ํ๊ฒฝ - Window (PowerShell) - VSCode - Python 3.10โ๏ธ ์์ ๋ด์ฉ (OpenAI API ํ ์คํธ) 1. API Key ์์ฑ 2. ํ๊ฒฝ๋ณ์ ์ค์ setx OPENAI_API_KEY "your_api_key_here" 3. OpenAI API ์ค์นpip install openaiโ 4. ์์ค ์ฝ๋ ์์ฑ (text_example.py)from openai import OpenAIclient = OpenAI()completion = client.chat.completions.create( model="gpt-4o-mini", messages=[ {"role": "system", "content": "You are a h.. 2025. 1. 31. ๐ถ๊ณฐ๋์ด์ ์ธ์ ๊ณํ ๋ณดํธ๋์ด ์๋ ๊ธ ์ ๋๋ค. 2025. 1. 30. [TIL] ๋ด์ผ๋ฐฐ์์บ ํ AI 9๊ธฐ - 18ํ ๐ถ ํ์ต ๋ฒ์ํ์ต๋ฐ ๊ณผ์ (์ฅ๊ณ )ํ์ด์ฌ ์ฌํ ๊ฐ์ข ์์๋จธ์ ๋ฌ๋ ๊ณผ์ ํ์ด ํน๊ฐ์ฝ๋์นดํ ๐ถ ๊ณต๋ถ ๋ด์ฉโจ ํ์ต๋ฐ ๊ณผ์ - Django Relationship โ๏ธ 1:1 : models.OneToOneField - ๋ ํ ์ด๋ธ ๊ฐ์ 1:1 ๊ด๊ณ๋ฅผ ์ ์ - ํ๋์ ๋ ์ฝ๋๋ ๋ค๋ฅธ ํ ์ด๋ธ์ ๋ ์ฝ๋ ํ๋๋ง ์ฐ๊ฒฐ๋จ - ํ๋์ ๋ชจ๋ธ์ ๋๋ฌด ๋ง์ ํ๋๊ฐ ์์ ๊ฒฝ์ฐ ๋ฐ์ดํฐ ๊ตฌ์กฐ๋ฅผ ๋ถ๋ฆฌํ๋๋ฐ ์ ์ฉ# ํ์ฌclass Company(models.Model): name = models.CharField(max_length=50) # ํ์ฌ ์ด๋ฆ founded_date = models.DateField() # ์ค๋ฆฝ์ผ website = models.URLField(blank=True) # ์น์ฌ์ดํธ# ์ฃผ์cl.. 2025. 1. 9. [TIL] ๋ด์ผ๋ฐฐ์์บ ํ AI 9๊ธฐ - 17ํ ๐ถ ํ์ต ๋ฒ์ํ์ต๋ฐ ๊ณผ์ (ํ์ด์ฌ)ํ์ด์ฌ ๊ธฐ์ด ๊ฐ์ข ์๊ฐ๋จธ์ ๋ฌ๋ ํ์ต์ฝ๋์นดํ ๐ถ ๊ณต๋ถ ๋ด์ฉโจ ํ์ต๋ฐ ๊ณผ์ - ์ฅ๊ณ ForeignKey# [blog App] - models.py - Post ์์ฑ## author(์์ฑ์) ForeignKey ์ ์ฉ (1:N ๊ด๊ณ๋ก ๋ฐ์ดํฐ๋ฅผ ์ฐธ์กฐํ๊ธฐ ์ํด ์ฌ์ฉ)# - settings.AUTH_USER_MODEL (โป Django ํด๋น ์ค์ ๊ถ์ฅ)# > ์ค์ X:: Django๋ ๊ธฐ๋ณธ ์ฌ์ฉ์ ๋ชจ๋ธ(auth.User) ์ฌ์ฉ - # (django.conf.global_settings.py์ ์ ์)# > ์ค์ O:: ์ปค์คํ ์ฌ์ฉ์ ๋ชจ๋ธ ์ฌ์ฉ# โป Django ํด๋น ์ค์ ๊ถ์ฅ# # - on_delete=models.CASCADE# > autho.. 2025. 1. 8. (AI) ValueError: Input X contains NaN ๐ถ ์๋ฌํน์ ์ปฌ๋ผ์ ๋ํ ๊ฒฐ์ธก์น ๋์ฒด๊ฐ์ ์๊ด๊ด๊ณ ๋์ ๋ณ์๋ก ์์ธกํ์ฌ ๋ฃ๋ ๊ณผ์ ์์ ๋ค์๊ณผ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํ๋ค.โ๏ธ ์ ๋ ฅ ์์# LSTAT ๊ฒฐ์ธก๊ฐ์ด ์๋ ํ๊ณผ ์๋ ํ ๋ถ๋ฆฌ df_with_na = df[df["LSTAT"].isnull()] df_without_na = df[df["LSTAT"].notnull()] # ์๊ด๊ด๊ณ ๋์ ๋ณ์ ์ ํ correlated_features = ["MEDV", "INDUS", "NOX", "AGE", "TAX"] # ํ๊ท ๋ชจ๋ธ ํ์ต model = LinearRegression() X_train = df_without_na[correlated_features] y_train = df_without_na["LSTAT"] model.fit(X_train, y_tra.. 2024. 12. 27. ์ด์ 1 2 3 4 5 6 ยทยทยท 10 ๋ค์