๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

TIL/Colab

[Colab] Google Colab๊ณผ Kaggle ์—ฐ๋™ํ•˜๊ธฐ

!pip install kaggle
!pip install kaggle --update

๋จผ์ € ์บ๊ธ€์„ ์„ค์น˜ํ•ด์ฃผ๊ณ  ์—…๋ฐ์ดํŠธ ์‹œ์ผœ์ค๋‹ˆ๋‹ค.

 

 

My Account ์— ๋“ค์–ด๊ฐ€์…”์„œ "Create New API Token ์„ ๋ˆŒ๋Ÿฌ Kaggle.json ํŒŒ์ผ์„ ๋‹ค์šด๋ฐ›์Šต๋‹ˆ๋‹ค.

 

!pip install kaggle
from google.colab import files
files.upload()

 

 

์œ„ ์ฝ”๋“œ๋ฅผ ์ž…๋ ฅ ํ›„, ๋‹ค์šด ๋ฐ›์•˜๋˜ kaggle.json ํŒŒ์ผ์„ ์—…๋กœ๋“œ ํ•ด์ค๋‹ˆ๋‹ค.

ls -lha kaggle.json

ํŒŒ์ผ์ด ์ž˜ ์—…๋กœ๋“œ ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ด์ฃผ๊ณ ,

!mkdir -p ~/.kaggle
!cp kaggle.json ~/.kaggle/kaggle.json

#permission warning ๋ฐฉ์ง€
!chmod 600 ~/.kaggle/kaggle.json

ํŒŒ์ผ์˜ ์œ„์น˜๋ฅผ kaggle ํด๋” ์ƒ์„ฑ ํ›„, ๊ทธ ์•„๋ž˜์— ๋„ฃ์–ด์ค๋‹ˆ๋‹ค.

!kaggle competitions list

์บ๊ธ€ ๋Œ€ํšŒ ๋ชฉ๋ก์„ ํ™•์ธํ•ด๋ณด๊ณ ~

!kaggle competitions download -c competitive-data-science-predict-future-sales

 

๋‹ค์šด ๋ฐ›๊ณ  ์‹ถ์€ ๋Œ€ํšŒ์˜ ๋ฐ์ดํ„ฐ์…‹์ด ์žˆ๋‹ค๋ฉด,

! + ํ•ด๋‹น๋Œ€ํšŒ์˜ API

ํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค!

 

์ž˜ ๋‹ค์šด๋กœ๋“œ ๋˜์—ˆ๋‹ค๋ฉด , ์•„๋ž˜์™€ ๊ฐ™์ด ๋‚˜์˜ฌ ๊ฑฐ์˜ˆ์š”

 

๋‹ค์‹œ ํ•œ ๋ฒˆ ํ™•์ธ! ๊ตณ๊ตณ~