스터디노트 5월 13일

Jenny·2024년 5월 14일

GIT 기본 문법 정리

git 설정하기

git config

# config options
--system
--global
--local

# config 
user.name myName
user.email myEmail@email.com
core.autocrlf input (or true or false) ## input: commit 할때만 LF로 변경
core.editor code
init.defaultBranch main

# config 확인
git config --l (or --list)
git config --list --show-origin
git config <key>
ex) git config user.name

샘플프로젝트 Airbnb 집 값 분석

시나리오 요약

: 숙박 서비스를 제공하기 위한 숙소의 가격 결정 요인을 분석해보기 위해 Airbnb의 데이터를 분석한다.

  • 데이터 살펴보기
ColumnDescription
id리스트 ID
name리스트의 이름
host_id호스트 ID
host_name호스트의 이름
neighbourhood_group위치
neighbourhood지역
latitude위도 좌표
longitude경도 좌표
room_type리스트 공간 유형
price가격 (달러 기준)
minimum_nights최소 숙박 수
number_of_reviews리뷰 수
last_review최근 리뷰 날짜
reviews_per_month월별 리뷰 수
calculated_host_listings_count호스트당 리스트 수
availability_365예약 가능한 일수(1년 기준)

Process 01 Data 전처리

  • 수집된 데이터의 기본 정보들을 확인
    (1) Data shape 확인
    (2) Data type 확인
    (3) Null값 확인
    (4) Outlier 확인
# 분석에 필요한 col 선택 및 null value 처리
df['reviews_per_month'].fillna(0, inplace=True)
  • numerical, categorical value 구분하여 값 확인
#...for문 중략...#
pd.DataFrame ( {'val' : [i], 'nunique' : df[i].nunique()) )

Process 02 Data readiness check & Feature engineering

Data readiness check
  • Target label 생성 및 Target ratio 확인
plt.style.use (['dark_background'])
display (pd.DataFrame (df['price'].describe())
sns.distplot (df['price'])

eda_df = df.groupby ('neighbourhood_grou')['price'].agg (price_mean=('mean')).reset_index()
  • 분석 방향성 결정
Feature engineering
  • Heatmap, scatter plot을 통해 correlation 확인
sns.heatmap (df_par.corr(), vmin=-1, vmax=+1, annot=True, cmap='coolwarm', mask=mask)
sns.scatterplot (data=df, x='availability_365', y='price')

Process 03 Modeling

  • Categorical value 들은 Label encoding 한다
  • 여러가지 회귀모델을 train해보고 test결과를 비교한다
  • 최종 선택된 모델의 중요 변수를 탐색한다👍


이 글은 제로베이스 데이터 분석 취업 스쿨의 강의 자료 일부를 발췌하여 작성되었습니다.

profile
I like to movie movie

0개의 댓글