일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- 파이썬코딩테스트
- 영어신문읽기
- 토플독학
- 영어표현
- 프로그래머스코딩테스트
- 파이썬
- 코린이
- 파이썬코딩
- 영문법
- SQL쿼리
- 프로그래머스
- SQL코딩테스트
- 영어
- 코딩테스트
- 프로그래머스SQL
- 의대정원확장
- 영어뉴스기사
- 미국석사
- 영어기사읽기
- 영어뉴스읽기
- 의대확장
- 토플공부법
- 의대정원
- 영어신문
- 영어뉴스
- 영어공부
- 프로그래머스파이썬
- 영어기사
- 토플준비
- sql
- Today
- Total
목록머신러닝/코드 뜯어보기 (4)
OFMY (Ony for me and you)

타깃값(0: 정상/ 1: 비정상) 에 따른 데이터 분포 확인 - Categorical (범주형 데이터) # 이상치 유무에 따른 차이를 보기 위한 데이터 분류 train_0 = train[train['Y_LABEL']==0] train_1 = train[train['Y_LABEL']==1] # 'COMPONENT_ARBITRARY' #Test Feature fig, ax = plt.subplots(1, 2, figsize=(16, 6)) sns.countplot(x = 'COMPONENT_ARBITRARY', data = train_0, ax = ax[0], order = train_0['COMPONENT_ARBITRARY'].value_counts().index) ax[0].tick_params(labe..

target 값의 분포를 파이차트로 확인하기 plt.subplots(figsize = (8,8)) plt.pie(train['Y_LABEL'].value_counts(), labels = train['Y_LABEL'].value_counts().index, autopct="%.2f%%", shadow = True, startangle = 90) plt.title('Anomaly Ratio', size=20) plt.show()

- numeric 데이터 -> Boxplot for col in numerical_features : plt.figure(figsize=(12, 8)) plt.boxplot(train[col], sym='r*') plt.title(col) plt.show()

모든 feature의 타입, 결측치, 고유값들을 정리해서 데이터프레임을 재가공 시키는 코드 # show dataframe for each features that we have dataFeatures = [] dataType = [] null = [] nullPCT = [] unique = [] minValue = [] maxValue = [] uniqueSample = [] for item in list(train): dataFeatures.append(item) #데이터 타입 for item in dataFeatures: dataType.append(train[item].dtype.name) #결측치 개수 for item in dataFeatures: null.append(len(train[train..