Titanic survival datawolfpack.hannam.ac.kr/Fall_2020/lecturenote/example_data.pdf · 2020. 11....

10
예제 데이터 Titanic survival data http://203.247.53.31/Stat_Notes/example_data/titanic_data.csv 타이타닉 사고 탑승객 정보[생존 여부] 승선구역: C = Cherbourg, Q = Queenstown, S = Southampton 미국 SMSA 시도별 사회인구경제 지표 http://203.247.53.31/Stat_Notes/example_data/SMSA_USA.csv 17열(도시 이름, southern 여부 포함), 59행 1309 × 14 pcla ss survi ved nam e sex age sibs p parc h ticke t fare cabi n emb arke d boat bod y hom e.de st 숫자 0/1 =문자 문자 숫자 숫자 숫자 문자 숫자 문자 문자 Incomplete 문자 요금 등급 생존 여부 이름 성별 나이 동반 자수 객실 등급 티켓 번호 요금 캐빈 번호 승선 구역 승선 보트 체격 도착 HNU Dept. of Statistics http://wolfpack.hnu.ac.kr / 1 10

Transcript of Titanic survival datawolfpack.hannam.ac.kr/Fall_2020/lecturenote/example_data.pdf · 2020. 11....

Page 1: Titanic survival datawolfpack.hannam.ac.kr/Fall_2020/lecturenote/example_data.pdf · 2020. 11. 19. · 예제 데이터 Titanic survival data 타이타닉 사고 탑승객 정보[생존

예제 데이터

Titanic survival data http://203.247.53.31/Stat_Notes/example_data/titanic_data.csv

타이타닉 사고 탑승객 정보[생존 여부]

승선구역: C = Cherbourg, Q = Queenstown, S = Southampton

미국 SMSA 시도별 사회인구경제 지표

http://203.247.53.31/Stat_Notes/example_data/SMSA_USA.csv

17열(도시 이름, southern 여부 포함), 59행

1309 × 14

pclass

survived

name sex age sibs

pparch

ticket fare cabi

n

embarked

boat body

home.dest

숫자0/1=생존

문자 문자 숫자 숫자 숫자 문자 숫자 문자 문자 Incomplete 문자

요금등급

생존여부 이름 성별 나이

동반자수

객실등급

티켓번호 요금

캐빈번호

승선구역

승선보트 체격

도착지

HNU Dept. of Statistics http://wolfpack.hnu.ac.kr /1 10

Page 2: Titanic survival datawolfpack.hannam.ac.kr/Fall_2020/lecturenote/example_data.pdf · 2020. 11. 19. · 예제 데이터 Titanic survival data 타이타닉 사고 탑승객 정보[생존

예제 데이터

Kaggle Data set. https://www.kaggle.com/datasets

구글 데이터 서치 https://datasetsearch.research.google.com/

HNU Dept. of Statistics http://wolfpack.hnu.ac.kr /2 10

Page 3: Titanic survival datawolfpack.hannam.ac.kr/Fall_2020/lecturenote/example_data.pdf · 2020. 11. 19. · 예제 데이터 Titanic survival data 타이타닉 사고 탑승객 정보[생존

예제 데이터

University of California,  https://archive.ics.uci.edu/ml/datasets.php

https://archive.ics.uci.edu/ml/datasets/Air+Quality [데이터 다운로드만 가능함]

Github Rdatasets https://vincentarelbundock.github.io/Rdatasets/index.html

https://vincentarelbundock.github.io/Rdatasets/datasets.html

https://vincentarelbundock.github.io/Rdatasets/csv/datasets/iris.csv

from google.colab import drive drive.mount('/content/drive')

!ls

cd /content/drive/My Drive

import pandas as pd df2=pd.read_csv('/content/drive/My Drive/SMSA.csv')

HNU Dept. of Statistics http://wolfpack.hnu.ac.kr /3 10

Page 4: Titanic survival datawolfpack.hannam.ac.kr/Fall_2020/lecturenote/example_data.pdf · 2020. 11. 19. · 예제 데이터 Titanic survival data 타이타닉 사고 탑승객 정보[생존

예제 데이터

Scikit 모듈 예제 데이터

https://scikit-learn.org/stable/datasets/index.html

Toy datasets

scikit-learn comes with a few small standard datasets that do not require to download any file from some external website. https://scikit-learn.org/stable/datasets/index.html#toy-datasets

Real world datasets

scikit-learn provides tools to load larger datasets, downloading them if necessary. https://scikit-learn.org/stable/datasets/index.html#real-world-datasets

from sklearn.datasets import load_boston boston = load_boston() import pandas as pd df=pd.DataFrame(boston.data) df.columns=boston.feature_names df['PRICE'] = boston.target df.info()

load_boston(*[, return_X_y]) Load and return the boston house-prices dataset (regression).

load_iris(*[, return_X_y, as_frame]) Load and return the iris dataset (classification).load_diabetes(*[, return_X_y, as_frame]) Load and return the diabetes dataset (regression).

load_digits(*[, n_class, return_X_y, as_frame]) Load and return the digits dataset (classification).

load_linnerud(*[, return_X_y, as_frame]) Load and return the physical excercise linnerud dataset.

load_wine(*[, return_X_y, as_frame]) Load and return the wine dataset (classification).load_breast_cancer(*[, return_X_y, as_frame])

Load and return the breast cancer wisconsin dataset (classification).

fetch_olivetti_faces(*[, data_home, …]) Load the Olivetti faces data-set from AT&T (classification).fetch_20newsgroups(*[, data_home, subset, …])

Load the filenames and data from the 20 newsgroups dataset (classification).

fetch_20newsgroups_vectorized(*[, subset, …])

Load the 20 newsgroups dataset and vectorize it into token counts (classification).

HNU Dept. of Statistics http://wolfpack.hnu.ac.kr /4 10

Page 5: Titanic survival datawolfpack.hannam.ac.kr/Fall_2020/lecturenote/example_data.pdf · 2020. 11. 19. · 예제 데이터 Titanic survival data 타이타닉 사고 탑승객 정보[생존

예제 데이터

미국 MLB 데이터 http://www.seanlahman.com/

http://www.seanlahman.com/baseball-archive/statistics/

https://github.com/chadwickbureau/baseballdatabank/archive/master.zip [csv 데이터 압축]

Fisher Iris Data http://203.247.53.31/Stat_Notes/example_data/iris.csv

150 cases (rows) and 5 variables (columns) Sepal(꽃받침 조각).Length, Sepal.Width, Petal(꽃잎).Length, Petal.Width, and Species.

One of the clusters contains Iris setosa, while the other cluster contains both Iris virginica and Iris versicolor and is not separable without the species information Fisher used.

fetch_lfw_people(*[, data_home, funneled, …])

Load the Labeled Faces in the Wild (LFW) people dataset (classification).

fetch_lfw_pairs(*[, subset, data_home, …])

Load the Labeled Faces in the Wild (LFW) pairs dataset (classification).

fetch_covtype(*[, data_home, …]) Load the covertype dataset (classification).

fetch_rcv1(*[, data_home, subset, …]) Load the RCV1 multilabel dataset (classification).fetch_kddcup99(*[, subset, data_home, …]) Load the kddcup99 dataset (classification).

fetch_california_housing(*[, data_home, …]) Load the California housing dataset (regression).

HNU Dept. of Statistics http://wolfpack.hnu.ac.kr /5 10

Page 6: Titanic survival datawolfpack.hannam.ac.kr/Fall_2020/lecturenote/example_data.pdf · 2020. 11. 19. · 예제 데이터 Titanic survival data 타이타닉 사고 탑승객 정보[생존

예제 데이터

Synthetic Aperture Personality Assessment (SAPA) https://vincentarelbundock.github.io/Rdatasets/doc/psych/bfi.html

성격진단 설문지 A1 Am indifferent to the feelings of others. (q_146)

A2 Inquire about others' well-being. (q_1162)

A3 Know how to comfort others. (q_1206)

A4 Love children. (q_1364)

A5 Make people feel at ease. (q_1419)

C1 Am exacting in my work. (q_124)

C2 Continue until everything is perfect. (q_530)

C3 Do things according to a plan. (q_619)

C4 Do things in a half-way manner. (q_626)

C5 Waste my time. (q_1949)

E1 Don't talk a lot. (q_712)

E2 Find it difficult to approach others. (q_901)

E3 Know how to captivate people. (q_1205)

E4 Make friends easily. (q_1410)

E5 Take charge. (q_1768)

N1 Get angry easily. (q_952)

N2 Get irritated easily. (q_974)

N3 Have frequent mood swings. (q_1099

N4 Often feel blue. (q_1479)

N5 Panic easily. (q_1505)

O1 Am full of ideas. (q_128)

O2 Avoid difficult reading material.(q_316)

O3 Carry the conversation to a higher level. (q_492)

O4 Spend time reflecting on things. (q_1738)

O5 Will not probe deeply into a subject. (q_1964)

gender Males = 1, Females =2

education 1 = HS, 2 = finished HS, 3 = some college, 4 = college graduate 5 = graduate degree

age age in years

https://sedac.ciesin.columbia.edu/ 나사 제공 데이터

세계 사회경제지표 관련 데이터

HNU Dept. of Statistics http://wolfpack.hnu.ac.kr /6 10

Page 7: Titanic survival datawolfpack.hannam.ac.kr/Fall_2020/lecturenote/example_data.pdf · 2020. 11. 19. · 예제 데이터 Titanic survival data 타이타닉 사고 탑승객 정보[생존

예제 데이터

https://data.worldbank.org/ 월드뱅크 데이터

https://microdata.worldbank.org/index.php/home

세계 경제경영 데이터 마이크로데이터

주가 데이터 가져오기

!pip install -U finance-datareader import FinanceDataReader as fdr df_krx = fdr.StockListing('KRX')

name=input('주식 코드 기업명 ?') #find 종목코드 및 정보 df_krx[df_krx['Name'].str.contains(name)]

import datetime as dt cid='000660' #company id start_date='2018-06-01' end_date=dt.date.today()-dt.timedelta(days=1) df=fdr.DataReader(cid,start_date,end_date) c_name=df_krx[df_krx['Symbol']==cid]['Name'].item() c_name, df.columns

HNU Dept. of Statistics http://wolfpack.hnu.ac.kr /7 10

Page 8: Titanic survival datawolfpack.hannam.ac.kr/Fall_2020/lecturenote/example_data.pdf · 2020. 11. 19. · 예제 데이터 Titanic survival data 타이타닉 사고 탑승객 정보[생존

예제 데이터

코로나 관련 데이터 가져오기

https://www.ecdc.europa.eu/en/publications-data/download-todays-data-geographic-distribution-

covid-19-cases-worldwide

LPGA2008.csv 미국 LPGA 골프선수들의 능력 측정 변수 (비거리, 페어웨이 안착율, 샌드(벙커) 세이버, 그린 적중률, 버팅 수), 상금, 출전 라운드 수를 조사한 데이터이다. (157명 선수, 변수 9개)

http://203.247.53.31/Stat_Notes/example_data/lpga2008.csv

import pandas as pd

df=pd.read_csv('https://opendata.ecdc.europa.eu/covid19/casedistribution/csv')

df['dateRep'] =pd.to_datetime(df.dateRep)

df.info()

import pandas as pd df=pd.read_csv('http://wolfpack.hnu.ac.kr/Stat_Notes/example_data/lpga2008.csv') df.columns=['golfer','drive','fairway','green','putting','sand_no','sand_save','money','play_no'] df.info()

HNU Dept. of Statistics http://wolfpack.hnu.ac.kr /8 10

Page 9: Titanic survival datawolfpack.hannam.ac.kr/Fall_2020/lecturenote/example_data.pdf · 2020. 11. 19. · 예제 데이터 Titanic survival data 타이타닉 사고 탑승객 정보[생존

예제 데이터

국가공공데이터포털 https://www.data.go.kr/

오픈 API [위키피디아 정의]

오픈 API(Open Application Programming Interface, Open API, 공개 API)는 누구나 사용할 수 있도록 공개된 API를 말하며, 개발자에게 사유 응용 소프트웨어나 웹 서비스에 프로그래밍적인 권한을 제공한다.

이것은 "하나의 웹 사이트에서 자신이 가진 기능을 이용할 수 있도록 공개한 프로그래밍 인터페이스가 오픈 API이다"라고 정의할수있다.

네이버 지도, 구글맵, 오픈스트리트맵 등이 대표적인 예이다. 지도 서비스 및 다양한 서비스들에서 시도되고 있으며 누구나 접근하여 사용할 수 있다는 장점이 있다. 메타블로그도 오픈 API를 사용하여 만든 예이다. 최근에 코로나 사태로 라이브코로나, 코로나 맵 등의 서비스가 생겼는데, 네이버클라우드플랫폼의 API 지원을 받고 있다.

API 파이썬으로 불러오기 [will be shown soon]

HNU Dept. of Statistics http://wolfpack.hnu.ac.kr /9 10

Page 10: Titanic survival datawolfpack.hannam.ac.kr/Fall_2020/lecturenote/example_data.pdf · 2020. 11. 19. · 예제 데이터 Titanic survival data 타이타닉 사고 탑승객 정보[생존

예제 데이터

한국데이터산업진흥원 https://www.kdata.or.kr/

https://www.kdata.or.kr/busi/busi_07_01.html

HNU Dept. of Statistics http://wolfpack.hnu.ac.kr /10 10