머신러닝 작업의 첫 번째 단계는 시스템으로 원본 데이터를 불러오는 것입니다. 원본 데이터는
로그 파일
log
file
이나 데이터셋 파일, 데이터베이스
database
, 아마존
Amazon
S3
와 같은 클라우드 스
토리지
cloud
storage
일 수 있습니다. 또한 여러 소스
source
에서 데이터를 추출해야 하는 경우가 많습
니다.
이 장에서는
CSV
파일,
SQL
데이터베이스 같은 다양한 소스에서 데이터를 적재하는 방법을
소개합니다. 실험에 필요한 특성을 가진 모의 데이터를 생성하는 방법도 다룹니다.
끝으로 파이썬 생태계에는 데이터를 적재할 수 있는 도구들이 많습니다. 여기에서는 외부 데이
터를 적재할 때는 판다스
pandas
라이브러리의 다양한 도구를 사용하고, 모의 데이터를 생성하는
데 파이썬의 오픈 소스 머신러닝 라이브러리인 사이킷런
scikit
-
learn
을 사용하겠습니다.
2.1
샘플 데이터셋 적재하기
과제
사이킷런 라이브러리에 내장된 샘플 데이터셋을 사용하고 싶습니다.
해결
사이킷런에는 잘 알려진 데이터셋이 포함되어 있습니다.
데이터 적재
2
CHAPTER
56
실무로 통하는
ML
문제 해결
with
파이썬
# 사이킷런의 데이터셋을 적재합니다.
fromsklearnimport datasets
# 숫자 데이터셋을 적재합니다.
digits ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.