SlideShare a Scribd company logo
1 of 19
Download to read offline
R에서의
데이터 허드렛일 줄이기
권정민 (cojette@gmail.com)
R 언어의 사용 형태
● 다양한 국가, 다양한 분야
● 중심이 없는 분산된 네트워크 형태의 커뮤니티
● 하위문화집단의 다양성과 각 집단의 가치를 존중하고 이를
공유하는 것을 장려함
● 다양한 배경의, 다양한 데이터 분석에 대한 방법과 가치,
의미를 공유할 수 있도록 함.
머신 러닝과 데이터
머신 러닝 데이터셋의 조건
● 잡음 없는 깔끔한 데이터
● 일관성
● 유형의 단순성
● 명확한 예측 변수와 종속 변수
● 척도화된 이산적 데이터
대부분의 데이터의 현실
● 가공되지 않은 지저분한 파일들 (좋게 말해서 원석)
● 비슷한 데이터가 다양한 소스에서 나옴
● 데이터셋은 큼 (크다고 다 좋을까)
● 명확하게 정의되지 않은 많은 데이터 항목들
● 서로 다른 범주 및 메타데이터
● 정리되지 않은 비정형 데이터
● 오타, 데이터 누락, 정돈되지 않은 포맷, 잘못 들어간 데이터
● 기타 등등… (자세한 내용은 생략한다)
Tidy datasets are all alike
but every messy dataset is messy in its own way
Tidyverse
데이터의 대부분의
처리 과정을 지원하는
R 패키지 컬렉션
● 텍스트 패턴 처리
● 텍스트로 이루어진 데이터 클렌징
● R에서 여러 가지 타입 모두 지원
○ PCRE: perl=TRUE 옵션 명기
Regular Expression
패턴 처리를 활용한
데이터 클렌징
Out of the Box
최대한 사용 가능한 문제
전환
● 회귀 문제를 분류로 (반대도 가능)
● 수치형 변수를 범주형 변수로
(반대도 가능)
● 글자 데이터(범주형)를 문서
형태로
● 기타 등등 최대한 짜내어 본다
보통의 구매 데이터
Usage
● Recommendation System
○ Similar products
○ Shops you may like
● Customer Anaysis
● Marketing
● Etc.
음식 명명법의 다양함
● 후라이드치킨
○ 크리스피치킨
○ 후라이드 치킨
○ 마일드치킨(Mild)
○ 오리지널치킨
○ 닭강정✮
○ 써프라이드 - 보통맛
○ 소이갈릭스
○ 1. 치즐링
○ A. 순살후라이드
○ 마라치킨(⿇辣)
○ ….
(그림 및 유사 내용 출처: https://www.wired.com/story/how-grubhub-analyzed-4000-dishes-to-predict-your-next-order/)
N:N 관계의 데이터
식당
● 한 식당에는 여러 종류의 음식을 판다
● 식당의 주 메뉴와 맛있는 메뉴는 다를 수 있다
고객
● 대부분의 사람은 여러 종류의 음식을
먹는다
TF-IDF를 사용해서 추천 엔진을 만들어보자
단어 정제
● 정규표현식과 규칙들을 적용해서 메뉴명을 통일성 있게 만들어본다
구매 데이터를 문서로
식당 문서
● 깔끔해진 음식명을 활용해서 고객과 식당(아이템)의 데이터를 문서로 만든다
구매 문서의 텍스트 마이닝
Tidytext
● 'dplyr', 'ggplot2' 등의 다양한
R의 패키지 기능을 활용해서
R에서 손쉽게 텍스트 마이닝을 할
수 있도록 도와주는 패키지
예제
유사도 행렬을 이용한 추천
ALS 알고리즘
● 고객과 식당(Item) 매칭
정리
머신 러닝 데이터
머신 러닝에는 일반 데이터 분석보다 더욱 정제된 데이터가
필요하고, 그런 데이터는 어떻게 만들어 볼 수는 있다.
R로 데이터 만들어보기
Tidyverse + 정규 표현식 + 문제 비틀기
The Era of Data Wrangling
is coming….
R에서 데이터 허드렛일 줄이기

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

R에서 데이터 허드렛일 줄이기

  • 2. R 언어의 사용 형태 ● 다양한 국가, 다양한 분야 ● 중심이 없는 분산된 네트워크 형태의 커뮤니티 ● 하위문화집단의 다양성과 각 집단의 가치를 존중하고 이를 공유하는 것을 장려함 ● 다양한 배경의, 다양한 데이터 분석에 대한 방법과 가치, 의미를 공유할 수 있도록 함.
  • 4. 머신 러닝 데이터셋의 조건 ● 잡음 없는 깔끔한 데이터 ● 일관성 ● 유형의 단순성 ● 명확한 예측 변수와 종속 변수 ● 척도화된 이산적 데이터
  • 5.
  • 6. 대부분의 데이터의 현실 ● 가공되지 않은 지저분한 파일들 (좋게 말해서 원석) ● 비슷한 데이터가 다양한 소스에서 나옴 ● 데이터셋은 큼 (크다고 다 좋을까) ● 명확하게 정의되지 않은 많은 데이터 항목들 ● 서로 다른 범주 및 메타데이터 ● 정리되지 않은 비정형 데이터 ● 오타, 데이터 누락, 정돈되지 않은 포맷, 잘못 들어간 데이터 ● 기타 등등… (자세한 내용은 생략한다) Tidy datasets are all alike but every messy dataset is messy in its own way
  • 7.
  • 8. Tidyverse 데이터의 대부분의 처리 과정을 지원하는 R 패키지 컬렉션
  • 9. ● 텍스트 패턴 처리 ● 텍스트로 이루어진 데이터 클렌징 ● R에서 여러 가지 타입 모두 지원 ○ PCRE: perl=TRUE 옵션 명기 Regular Expression 패턴 처리를 활용한 데이터 클렌징
  • 10. Out of the Box 최대한 사용 가능한 문제 전환 ● 회귀 문제를 분류로 (반대도 가능) ● 수치형 변수를 범주형 변수로 (반대도 가능) ● 글자 데이터(범주형)를 문서 형태로 ● 기타 등등 최대한 짜내어 본다
  • 11. 보통의 구매 데이터 Usage ● Recommendation System ○ Similar products ○ Shops you may like ● Customer Anaysis ● Marketing ● Etc. 음식 명명법의 다양함 ● 후라이드치킨 ○ 크리스피치킨 ○ 후라이드 치킨 ○ 마일드치킨(Mild) ○ 오리지널치킨 ○ 닭강정✮ ○ 써프라이드 - 보통맛 ○ 소이갈릭스 ○ 1. 치즐링 ○ A. 순살후라이드 ○ 마라치킨(⿇辣) ○ …. (그림 및 유사 내용 출처: https://www.wired.com/story/how-grubhub-analyzed-4000-dishes-to-predict-your-next-order/)
  • 12. N:N 관계의 데이터 식당 ● 한 식당에는 여러 종류의 음식을 판다 ● 식당의 주 메뉴와 맛있는 메뉴는 다를 수 있다 고객 ● 대부분의 사람은 여러 종류의 음식을 먹는다
  • 13. TF-IDF를 사용해서 추천 엔진을 만들어보자 단어 정제 ● 정규표현식과 규칙들을 적용해서 메뉴명을 통일성 있게 만들어본다
  • 14. 구매 데이터를 문서로 식당 문서 ● 깔끔해진 음식명을 활용해서 고객과 식당(아이템)의 데이터를 문서로 만든다
  • 15. 구매 문서의 텍스트 마이닝 Tidytext ● 'dplyr', 'ggplot2' 등의 다양한 R의 패키지 기능을 활용해서 R에서 손쉽게 텍스트 마이닝을 할 수 있도록 도와주는 패키지 예제
  • 16. 유사도 행렬을 이용한 추천 ALS 알고리즘 ● 고객과 식당(Item) 매칭
  • 17. 정리 머신 러닝 데이터 머신 러닝에는 일반 데이터 분석보다 더욱 정제된 데이터가 필요하고, 그런 데이터는 어떻게 만들어 볼 수는 있다. R로 데이터 만들어보기 Tidyverse + 정규 표현식 + 문제 비틀기
  • 18. The Era of Data Wrangling is coming….