일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Python crawler
- Naive Bayes
- python control statement
- sklearn
- 제어문
- Machine Learning
- 넘파이
- dataframe
- 파이썬
- Titanic data set
- 사이킷런
- 머신러닝
- 파이썬 객체 지향 프로그래밍
- NumPy
- 판다스
- ML
- scikit-learn
- control statement
- python
- 배열
- 파이썬 제어문
- Data pre-processing
- 순회 크롤러
- 파이썬 크롤링
- 파이썬 크롤러
- K평균군집화
- pandas
- 나이브베이즈
- KMeans Clustering
- 타이타닉 데이터
- Today
- Total
목록python (23)
Try to 개발자 EthanJ의 성장 로그

scikit-learn Machine Learning k-NN algorithm 사이킷런 머신러닝 k-NN 알고리즘 In [1]: import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns Data Collection¶ In [2]: # https://archive.ics.uci.edu/ml/datasets/wine # https://www.kaggle.com/datasets/akhil0007/wine-data file_url = 'https://raw.githubusercontent.com/dev-EthanJ/scikit-learn_Machine_Learning/main/data/'..

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...

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]: 상위..
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 ..
Pandas Series 판다스 시리즈¶ Pandas¶ 데이터 처리 및 분석을 위한 library 대용량 Data를 안정적이면서도 간편하게 처리 서로 다른 data type으로 column 단위들을 구성할 수 있음 c.f. Numpy: 전체 배열 원소를 '동일한 타입'으로 제한 주요 기능 데이터 입출력: .csv, .xlsx, RDB, JSON 등 다양한 format의 data 처리 가능 데이터 가공: 분리, 결합, 계층, 피봇 등 통계 분석 처리 등 In [1]: #pandas library, Series, DataFrame namespace 불러오기 import pandas as pd Series¶ 1차원 배열과 유사한 자료형 색인 index : 행 번호 각각의 데이터에 부여하는 속성, default..