일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- NumPy
- 파이썬 크롤러
- python control statement
- python
- pandas
- Data pre-processing
- sklearn
- control statement
- ML
- 나이브베이즈
- 순회 크롤러
- KMeans Clustering
- K평균군집화
- 제어문
- 판다스
- 파이썬 크롤링
- dataframe
- Python crawler
- 배열
- 타이타닉 데이터
- 넘파이
- Machine Learning
- scikit-learn
- Titanic data set
- 파이썬
- 파이썬 객체 지향 프로그래밍
- 사이킷런
- Naive Bayes
- 파이썬 제어문
- 머신러닝
- Today
- Total
목록전체 글 (41)
Try to 개발자 EthanJ의 성장 로그

scikit-learn Machine Learning Logistic Regression: Predict Titanic Survived 사이킷런 머신러닝 로지스틱 회귀: 타이타닉 생존자 예측 In [1]: import pandas as pd # DataFrame float값을 소수점 두 번째 자리 까지만 표시 pd.options.display.float_format = '{:.2f}'.format 1. Data Collection¶ In [2]: # Kaggle # https://www.kaggle.com/competitions/titanic file_url = "https://raw.githubusercontent.com/dev-EthanJ/scikit-learn_Machine_Learn..

Titanic data pre-processing with pandas 판다스 타이타닉 데이터 전처리 In [1]: import pandas as pd import numpy as np import matplotlib.pyplot as plt Data 추출¶ In [2]: data = pd.read_csv('data/train.csv') In [3]: data.head() Out[3]: PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked 0 1 0 3 Braund, Mr. Owen Harris male 22.0 1 0 A/5 21171 7.2500 NaN S 1 2 1 1 Cumings, Mrs. J..

Data visualization with matplotlib 데이터 시각화¶ 0. Matplotlib¶ 파이썬 기반 데이터 분석 환경에서 가장 일반적으로 사용되는 시각화 라이브러리 하위 라이브러리인 pyplot을 통해 주요 기능을 사용 plotly, seaborn 등과 같은 라이브러리가 최근 경쟁력을 갖추고 있음 pandas 객체의 기본적인 시각화 도구 plot() method를 통해 데이터를 시각화 종류 라인 플롯(line plot) 바 차트(bar chart) 히스토그램(histogram) 박스 플롯(box plot) 스캐터 플롯(scatter plot) In [1]: import pandas as pd import numpy as np import matplotlib.pyplot as plt 1...

Pands Data analysis with Baseball player 판다스 야구 선수 데이터 분석 In [1]: import pandas as pd 1. 데이터 적재 및 통합¶ In [2]: bb_data = pd.read_excel('data/NC DINOS.xlsx', sheet_name=None) bb_data Out[2]: {'2013': Unnamed: 0 선수명 팀명 경기 타석 타수 안타 홈런 득점 타점 볼넷 삼진 도루 BABIP \ 0 0 모창민 NC 108 436 395 109 12 57 51 37 68 16 0.307 1 1 이호준 NC 126 508 442 123 20 46 87 60 109 2 0.324 2 2 김종호 NC 128 546 465 129..

Pandas Data pre-processing 판다스 데이터 전처리 1. Hierarchical Indexing 계층 색인¶ 행, 열의 각 축에 대해 다중 단계(계층)를 지정하여 데이터에 차원을 설정 index에 다차원 리스트를 전달하면 계층 색인을 지정할 수 있음 데이터 구조를 재배열하거나 pivot 테이블과 같은 group 기반 작업에 유용 재배열 method stack() : column을 row로 pivot unstack() : row를 column으로 pivo In [1]: import pandas as pd import numpy as np 1.1. Series Hierarchical Indexing 시리즈 계층 색인¶ index에 다차원 리스트(아이템 2개)를 전달 다차원리스트[0]: 상위..

scikit-learn Machine Learning Linear Regression 사이킷런 머신러닝 회귀분석 Machine Learning Process 데이터 수집: Data Collection 데이터 전처리: Data pre-processing 모델 학습: Training Model 모델 평가:Evaluating Model 모델 배포: Model Deployment In [1]: import pandas as pd 1. Data 수집¶ In [2]: url = f'https://raw.githubusercontent.com/dev-EthanJ/scikit-learn_Machine_Learning/main/data/insurance.csv' df = pd.read_csv(url) df..
Pandas Data Loading 판다스 데이터 적재¶ 1. *.csv file reading¶ pd.read_csv('file path') columns name이 존재하는 data columns name이 없는 data separator 설정 주석(comment)이 있는 data In [1]: import pandas as pd 절대경로(Absolute path) An absolute path is defined as the specifying the location of a file or directory from the root directory(/). 상대경로(Relative path) Relative path is defined as the path related to the present ..
Pandas DataFrame 판다스 데이터프레임¶ DataFrame¶ 2차원 배열과 유사한 자료형 다차원 list, dict 자료형으로 데이터 구성 가능 Similar data structure with relational database table, MS excel .xlsx, .csv file 하나의 column = 하나의 Series = 하나의 row 하나의 Dataframe = 한 개 이상의 Series 묶음 index 특징 row index: 행 인덱스: axis=0 RangeIndex int index대신 지정한 label index 사용해도, int index 병행 사용 가능 column index: 열 인덱스: axis=1 지정 label index 사용 시, RangeIndex int ..