이터레이터는 소모된다. 따라서 제너레이터 객체를 만들어서 일부 처리를 수행하다가 나중 단계에서
실패하면 제너레이터를 다시 만들어야 한다. 원본은 이미 사라졌다.
●
이터레이터는 게으르다. 잘 수행되고 있는지 확인(평가)해야 한다.
pipe
() 함수 인수에 많은 함수가 있는 경우 어디에서 잘못되었는지 파악하기가 어렵다. 작은
스트림으로 잘못된 부분을 찾을 때까지 첫 번째(왼쪽)부터 순차적으로 파이프에 함수를 추가한
다. 또한 특정 스트림에
map
(
do
(
print
)) 함수(
toolz
.
curried
모듈의
map
()과
do
())를 삽입
하여 스트리밍하는 동안 각 요소를 출력해본다.
8.5.1
연습문제 : 스트리밍 데이터와
PCA
사이킷-런 라이브러리의
IncrementalPCA
클래스는 전체 데이터셋을 메모리에 로딩하지 않
고 데이터셋에서 주성분 분석
Principal
Components
Analysis
,
PCA
8
을 실행할 수 있다. 그러나 데이터를 직
접 청크해야 하므로 코드가 어려워진다. 데이터 샘플 스트림을 받아서 주성분 분석을 수행하
는 함수를 만들어보자. 그리고 주성분 분석 함수를 사용하여 ...
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.