상세 컨텐츠

본문 제목

[머신러닝기초]Basic Data Exploration

로봇-AI

by happynaraepapa 2025. 1. 8. 13:51

본문

souces :
https://www.kaggle.com/code/dansbecker/basic-data-exploration

Basic Data Exploration

Explore and run machine learning code with Kaggle Notebooks | Using data from multiple data sources

www.kaggle.com


#Pandas라는 라이브러리를 이용하여 데이터를 탐색해보자.

Using Pandas to Get Familiar With Your Data

The first step in any machine learning project is familiarize yourself with the data. You'll use the Pandas library for this. Pandas is the primary tool data scientists use for exploring and manipulating data. Most people abbreviate pandas in their code as pd. We do this with the command
머신러닝 프로젝트에서 가장 먼저 할 일은 데이터에 익숙해지는 일이다. Pandas는 데이터 사이언스에 사용되는 핵심 라이브러리로 대부분의 사람들이 파이썬코드에서 pd라는 별칭으로 이 라이브러리를 호출한다.
>>
import pandas as pd


The most important part of the Pandas library is the DataFrame. A DataFrame holds the type of data you might think of as a table. This is similar to a sheet in Excel, or a table in a SQL database.
여기서 가장 중요한 포인트는 Pandas 라이브러리의 데이터 프레임(DataFrame)이라는 자료 형태를 이해하는 것이다. 이는 엑셀의 테이블 구조를 이해하면 가장 쉽다.

Pandas has powerful methods for most things you'll want to do with this type of data.
Pandas는 이러한 데이터 구조(테이블 구조)를 다루기 위한 강력한 메소드를 제공한다.

As an example, we'll look at data about home prices in Melbourne, Australia. In the hands-on exercises, you will apply the same processes to a new dataset, which has home prices in Iowa.
이제 예시로 호주 멜번 지역의 주택 가격 데이터를 살펴 볼 건데, 나중에 실 연습(Hands-on)  프로젝트로 아이오와의 주택가격도 살펴볼 것이다.

The example (Melbourne) data is at the file path ../input/melbourne-housing-snapshot/melb_data.csv.
멜번 데이터는 다음 위치(path)에 있다.

We load and explore the data with the following commands:
이 데이터들은 다음 명령으로 불러 올 수 있다.
(중략)

Interpreting Data Description

The results show 8 numbers for each column in your original dataset. The first number, the count, shows how many rows have non-missing values.
이 결과는 각 컬럼(열; column)마다 8개 숫자를 보여준다. 첫 숫자는  결측치(비어있거나 무의미한 값 missing-values) 가 없는 로우(행; rows)가 몇 개인지 보여준다. (즉 유효한 데이터 값이 몇개인지 보여준다.)

Missing values arise for many reasons. For example, the size of the 2nd bedroom wouldn't be collected when surveying a 1 bedroom house. We'll come back to the topic of missing data.
결측치는 여러가지 이유로 발생한다. 예를들어, 2층 침실의 크기에 대한 데이터를 수집하면 1 층 집의 데이터에서는 수집이 안될 것이다. 결측치에 대해서는 나중에 다시 논의하자.

The second value is the mean, which is the average. Under that, std is the standard deviation, which measures how numerically spread out the values are.
두번째 값은 평균치 (mean; average)다.
그 밑에 std는 표준오차(standard deviation)이고 이는 얼마나 값이 넓게 분포하는가를 보여주는 값이다.

To interpret the min, 25%, 50%, 75% and max values, imagine sorting each column from lowest to highest value. The first (smallest) value is the min. If you go a quarter way through the list, you'll find a number that is bigger than 25% of the values and smaller than 75% of the values. That is the 25% value (pronounced "25th percentile"). The 50th and 75th percentiles are defined analogously, and the max is the largest number.

그다음 min, 25%, 50%, 75% max 값은 (각 컬럼마다) 전체 값을 오름차순 정렬(sorting)했을 때 min은 최소값 max는 최대값 , 50th percentile은 중간값,  25% 보다 작지 않은 바로 다음 값이 25th percentile, 75%보다 크지 않은 바로 아래 값이 75th percentile 이 된다.






관련글 더보기