Skip to Content
9가지 사례로 익히는 고급 스파크 분석(2판): 현실 세계 빅데이터로 배우는 데이터 과학과 머신러닝
book

9가지 사례로 익히는 고급 스파크 분석(2판): 현실 세계 빅데이터로 배우는 데이터 과학과 머신러닝

by 박상은, 권한철, 서양주, 샌디 라이자, 유리 레이저슨, 션 오언, 조시 윌스
March 2018
Beginner to intermediate
332 pages
6h 1m
Korean
Hanbit Media, Inc.
Content preview from 9가지 사례로 익히는 고급 스파크 분석(2판): 현실 세계 빅데이터로 배우는 데이터 과학과 머신러닝
59
2
장
스칼라와 스파크를 활용한 데이터 분석
이제
matchSummary
와
missSummary
데이터프레임을 비교하여 레코드 일치 여부에 따른
변수들의 분포 변화를 확인할 수 있다. 데이터셋이 큰 편은 아니지만, 그래도 지루한 작업이다.
사실 우리가 하려는 것은
matchSummary
와
missSummary
데이터프레임을 행과 열이 바뀌
도록 변형하여, 변형된 데이터프레임을 변수로 조인하여 요약 통계를 분석해보는 것이다. 이러
한 일을 대부분의 데이터 과학자는 데이터셋의 ‘축 회전
Pivoting
’
또는 ‘형태변환
Reshaping
’이라고 한
다. 다음 절에서 스파크에서 이러한 변환을 수행하는 방법을 보여줄 것이다.
2.10
데이터프레임의 축 회전과 형태변환
요약 통계를 변형하기 위해 해야 할 첫 번째 일은
matchSummary
와
missSummary
를 메트
릭의 행과 변수의 열이 있는 ‘넓은
wide
’ 모양에서 메트릭과 변수 쌍의 값 형태로 각 행에 하나의
변수와 하나의 메트릭만 들어 있는 ‘긴
long
’ 모양으로 바꾸는 것이다. 그다음에 긴 모양의 데이터
프레임을 또 다른 넓은 모양의 데이터프레임으로 바꾸면 변형이 마무리되는데, 이 데이터프레
임에서는 변수는 행에, 메트릭은 열에 대응될 것이다.
넓은 모양에서 긴 모양으로 변환하기 위해서
RDD
.
flatMap
의 래퍼 함수인
DataFrame
의
flatMap
함수를 사용할 것이다.
flatMap
은 스파크에서 가장 유용한 변환 중 하나다. 이 함수
는 각각의 입력을 처리하는 함수 인수를 ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’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
QuotationMarkI 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
QuotationMarkI’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
QuotationMarkI'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.
Mark W.
Embedded Software Engineer

You might also like

프로그래밍 스칼라: 실용적인 스칼라 활용법을 익히는 가장 확실한 실전 바이블 (2.11.x 버전 기반)

프로그래밍 스칼라: 실용적인 스칼라 활용법을 익히는 가장 확실한 실전 바이블 (2.11.x 버전 기반)

오현석, 딘 왐플러, 알렉스 페인

Publisher Resources

ISBN: 9791162240526