인공지능/Machine Learning

[ML] EXPLORATORY DATA ANALYSIS (EDA, 탐색적 자료 분석) / 데이터 살펴보기

유일리 2022. 10. 13. 15:27
Exploratory Data Analysis 이란?

탐색적 데이터 분석은 데이터의 분포와 값을 다양한 각도에서 관찰하며 데이터가 표현하는 현상을 더 잘 이해할 수 있도록 도와주고 데이터를 다양한 기준에서 살펴보는 과정을 통해 문제 정의 단계에서 미처 발견하지 못한 다양한 패턴을 발견하고 이를 바탕으로 기존의 가설을 수정하거나 새로운 가설을 추가할 수 있도록 한다. 

 

common Exploratory Data Analysis (EDA) techniques
  • Understanding the shape & distribution of the data
  • Scanning for missing values
  • Learning which features are most relevant based on correlation
  • Familiarizing yourself with the overall contents of the dataset
Preview the Dataframe
  • Use the Pandas’ head() command to preview the dataframe in Jupyter Notebook.
  • The head() function must come after the variable name of the dataframe, which in this case is df.

.head() 함수는 불러온 데이터의 상위 5개의 행을 출력한다. .tail()의 경우 하위 5개의 행을 출력하며 괄호 () 안에 원하는 숫자를 넣으면 그 숫자만큼 행을 출력한다.

 

Find Row Item
  • To retrieve a specific row or a sequence of rows from the dataframe, we can use the iloc[] method

.iloc[행 인덱스, 열 인덱스]은 데이터 프레임의 행이나 칼럼의 순서를 나타내는 정수로 특정 값을 추출해온다.

 

Shape
  • A quick method to inspect the size of the dataframe is the shape method
  • Inspecting the shape(number of rows and columns) of the dataframe

Columns
  • Prints the dataframe’s column titles
  • This is useful for copying and pasting columns back into the code or clarifying the name of specific variables

Describe
  • The describe() method is convenient for generating a summary of the dataframe’s mean, standard deviation, and IQR (interquartile range) values

Heatmaps
  • Heatmaps are also useful for inspecting and understanding relationships between variables.
  • We can build a heatmap in Python using the corr (correlation) function from Pandas and then visualize the results using a Seaborn heatmap.

히트 맵은 색상으로 표현할 수 있는 다양한 정보를 일정한 이미지 위에 열분포 형태의 비주얼한 그래픽으로 출력하는 것이 특징이다.


https://github.com/erica00j/machinelearning/blob/main/mlstudy1.ipynb

 

GitHub - erica00j/machinelearning

Contribute to erica00j/machinelearning development by creating an account on GitHub.

github.com