AI 부트캠프 2기 - Day 6

Jeongwoo Lee·2021년 3월 11일
0

Codestates AI Bootcamp

목록 보기
6/19

이번주 부터는 Section 1의 Sprint 2가 시작
대부분 원래 알던 내용이거나 학교에서 배웠던 내용

[Today I Learned]

Warm-up

  • 통계학 이야기 - 통계학이 무엇인지 재밌게 설명되어 있다.
  • 귀무가설 : 기각하려는 가설
  • 대립/대안가설 : 내가 증명하고 싶은 가설

Session - n121

  • 기술 통계치
  • 추리 통계치
  • Sampling 기법 4가지
  • 가설 검정
  • 표준 오차
  • T-test & P-value
  • One-side test vs Two-side test
  • 1-sample t-test vs 2-sample t-test
  • Scipy
# 1-Sample T-tests
stats.ttest_1samp(chionanthus, 400)

# 2-Sample T-tests
stats.ttest_ind(zelkova, cherry)

# 버전 업그레이드 
!pip install --upgrade scipy

# Colab에서 alternative 옵션을 사용하기 위해서는 scipy 버젼 업그레이드가 필요
stats.ttest_ind(zelkova, cherry, alternative = 'greater', equal_var= False)

과제

<과제 하면서 새롭게 배운 내용>

  • np.random.choice를 이용해 샘플링할 때 replace 옵션으로 복원 추출, 비복원 추출 설정 가능
  • ANOVA test (분산분석)
# 일원 분산분석
stats.f_oneway(ginkgo, sycamore, zelkova)
  • 4가지 샘플링 방법 구현

    • Simple random sampling
    • Systematic sampling
    • Stratified random sampling
    • Cluster sampling
  • Inverse transform sampling (Inverse CDF method)

    • 확률변수 X의 누적분포함수(CDF)인 F(x)의 역함수를 계산할 수 있다면, 기본 난수 생성기인 균등분포를 이용해서 확률 변수 X에 대한 샘플링이 가능하다.
    • 누적분포함수의 역함수는 .ppf를 사용하면 구할 수 있다.
  • seaborn에 distplot 사용해 분포 그래프 그리기

Reference

1. P-value and Q-value

2. t-distribution

3. A/B test

profile
열심히 하자

0개의 댓글