본문 바로가기

자격증/빅데이터분석기사-실기12

빅데이터분석기사 실기 3유형 - 검정 (T검정/카이제곱검정) https://github.com/lovedlim/bigdata_analyst_cert/blob/main/part3/ch3/ch3_chi_square.ipynb T 검정stats.ttest_1sampstats.ttest_relstats.ttest_indfrom scipy import stats# 단일표본t_statistic, p_value = stats.ttest_1samp(data, popmean, alternative)print(t_statistic, p_value)# 대응표본 ** 문제에 따라 a,b 입력 순서에 따라 alternative설정이 'greater,less,two-sided')t_statistic, p_value = stats.ttest_rel(data_a, data_b, alterna.. 2024. 11. 18.
빅데이터분석기사 실기 3유형 - 회귀분석/로지스틱회귀분석 # 라이브러리 임포트from statsmodels.formula.api import logit,ols# 회귀식 정의formumla='y~x1+x2+x3'# fit하기 **유의사항 :fit할때 괄호열고닫는거 잊지말것!!model=ols(formula,data=df).fit() #선형회귀분석model=logit(formula,data=df).fit() #로지스틱회귀분석# 결과보기print(model.summary()) #유의사항 summary() 괄호열고닫는거 까먹지말것! 이것때문에 결과값안나올수있음.# 신규값 예측 new_data=pd.DataFrame({'x1':[100],'x2':[30]})pred=model.predict(new_data)# 오즈비 - 로지스틱회귀 모델한정, 모델.파람스!import .. 2024. 11. 17.
빅데이터분석기사 실기 2유형 (마스터코드) 0. 분석환경설정#빅데이터분석기사 환경셋팅-그냥 통암기#행과열 전부 출력pd.set_option('display.max_rows', None) # 모든 행 출력pd.set_option('display.max_columns', None) # 모든 열 출력#지수->float실수화pd.options.display.float_format = '{:.2f}'.format1. 데이터 불러오기2. 데이터 탐색## infotrain.info()test.info()## null check 결측값 확인train.isnull().sum()test.isnull().sum()## describe train.describe()test.describe()train.describe(include="O")test.describe(.. 2024. 11. 16.
빅데이터분석기사 실기 3유형 - T검정 https://youtu.be/kyULq3rEulw?si=qWCGlOjKjEVx6piB 1. T-TESTT-Test모집단모집단 특성 단일 표본검정모집단 1개한 그룹예) 영화관에서 판매하는 팝콘의 평균 무게가 120g인지 검정대응 표본검정 (쌍체검정)모집단 1개 (같은 그룹을 두번 측정)같은 그룹 독립 표본검정모집단 2개다른 그룹   단일 표본검정(정규성 만족)from scipy import statst_statistic, p_value = stats.ttest_1samp( data, popmean, alternative)print(t_statistic, p_value)- data : 모집단에서 추출한 표본 데이터- popmean : 검증하려고 하는 모집단의 평균 또는 기댓값- alternative : 대.. 2024. 11. 15.