본문 바로가기

빅데이터분석기사_실기

(33)
제 2유형 [회귀 Regression] 자전거 수요 예측 이대로만 하면 2유형 40점 만점!https://www.kaggle.com/code/agileteam/t2-6-bike-regressor T2-6. Bike-RegressorExplore and run machine learning code with Kaggle Notebooks | Using data from Bike Sharing Demandwww.kaggle.com import pandas as pdtrain = pd.read_csv("/kaggle/input/bike-sharing-demand/train.csv")test = pd.read_csv("/kaggle/input/bike-sharing-demand/test.csv")#target: count컬럼#EDA# print(train.info()..
제 2유형 [회귀 Regression] Insurance 이대로만 하면 2유형 40점 만점https://www.kaggle.com/code/agileteam/insurance-starter-tutorial Insurance_Starter (Tutorial)Explore and run machine learning code with Kaggle Notebooks | Using data from multiple data sourceswww.kaggle.com #X_train, y_train, X_test# EDA# print(X_train.info())# print(X_test.info())# print(y_train.info())# print(X_train.head())# print(y_train.head())'''결측치 없고라벨인코딩은 필요독립변수에서 삭제 할..
제 2유형 [회귀 Regression] House Prices 이대로만 하면 2유형 40점 만점!https://www.kaggle.com/code/agileteam/t2-4-house-prices-regression T2-4. House Prices (Regression)Explore and run machine learning code with Kaggle Notebooks | Using data from multiple data sourceswww.kaggle.com #X_train, y_train, X_test(제출용 예측 데이터)#EDA# print(X_train.info())# print(X_test.info())# print(X_train.head())# print(X_test.head())# print(y_train.info())# print(y_tra..
제 2유형 [분류 Classification] 성인 인구소득 (범주형) 이대로만 하면 2유형 40점 만점!https://www.kaggle.com/code/agileteam/t2-3-adult-census-income-tutorial T2-3. Adult Census Income TutorialExplore and run machine learning code with Kaggle Notebooks | Using data from multiple data sourceswww.kaggle.com#X_train, y_train, X_test(제출 테스트 데이터)#데이터 정보 확인# print(X_train.head())# print(y_train.head())# print(X_train.info())# print(X_test.info())# print(y_train.info()..
제 2유형 [분류 Classification] 당뇨병 이대로만 하면 2유형 40점 만점!https://www.kaggle.com/code/agileteam/t2-2-pima-indians-diabetes T2-2. Pima Indians Diabetes(피마 인디언 당뇨병)Explore and run machine learning code with Kaggle Notebooks | Using data from multiple data sourceswww.kaggle.com #X_train, y_train, X_test(결과제출 시 활용)#데이터 로드 및 확인# print(X_train.info())# print(X_test.info())# print(y_train.info())# print()# print(X_train.head())# print(X_tes..
제 2유형 [분류 Classification] 타이타닉 이대로만 하면 2유형 40점 만점! https://www.kaggle.com/code/agileteam/t2-1-titanic-simple-baseline T2-1. 타이타닉(Titanic) Simple BaselineExplore and run machine learning code with Kaggle Notebooks | Using data from multiple data sourceswww.kaggle.com  #데이터로드 및 확인import pandas as pdprint(X_train.info())print(X_test.info())print(y_train.info())print(X_train.isnull().sum())print(X_test.isnull().sum())print(y_trai..
평활화 Smoothing 평활화데이터의 분포를 매끄럽게 함으로써 데이터에서 중요하지 않은 것(잡음 등)을 제거하고 패턴을 알아내는 방법목적: 값의 변화를 매끄럽게 하여 데이터의 추세(경향)을 알기 쉽게 하는 것이동평균 (MA, Moving Average)이동평균은 이전 n개 데이터의 비가중/가중 평균단순이동평균, 누적이동평균, 가중이동평균 등이 있음평활화 실습실습 데이터 준비: 1821년부터 1934년까지 캐나다 시라소니의 수에 대한 시계열 데이터 lynx.csvimport numpy as npimport pandas as pdimport matplotlib.pyplot as pltfile_path = 'https://raw.githubusercontent.com/YoungjinBD/dataset/main/lynx.csv'df ..
이상치 Outlier 처리 이상값데이터의 범위에서 크게 벗어난 (정상범위 밖에 있는) 값사분위범위 / 정규분포를 이용해서 식별, 식별된 이상치는 제거 여부 판단이상치 처리 실습실습용 데이터 준비import numpy as npimport pandas as pdimport matplotlib.pyplot as plt#평균 50, 표준편차 10의 정규분포를 따르는 200개의 랜덤 숫자 데이터 생성data = 10 * np.random.randn(200) + 50df = pd.DataFrame({"값" : data})임의의 이상치 (매우 작거나 큰 데이터) 삽입df.loc[200] = 2df.loc[201] = 100df.loc[202] = 10df.loc[203] = 110히스토그램을 이용한 분포 시각화plt.hist(df["값"],..