반응형

나는야 데이터사이언티스트/PYTHON 45

[Python]데이터 시각화, matplotlib & seaborn - line Plot(선 그래프)

데이터는 Kaggle에 있는 bostan marathon 데이터를 참고했다. https://www.kaggle.com/rojour/boston-results Finishers Boston Marathon 2015, 2016 & 2017 This data has the names, times and general demographics of the finishers www.kaggle.com In [29]: import pandas as pd pd.set_option('display.max_columns',500) #생략없이 출력 가능 In [63]: #tistory 관련 코드(필요없음) from IPython.core.display import display, HTML display(HTM..

[Python]pandas.cut - 데이터 범주화하기 / if문 쓰지않고 데이터 나누기

In [1]: import pandas as pd In [2]: #Tistory 관련 모듈이라 상관 없음. from IPython.core.display import display, HTML display(HTML("")) In [16]: #데이터 가져오기 https://www.kaggle.com/rojour/boston-results marathon_2017 = pd.read_csv("C://Users//82106//Desktop//boston-results//marathon_results_2017.csv") In [5]: marathon_2017.head() Out[5]: Unnamed: 0 Bib Name Age M/F City State Country Citizen Unnamed: 9 ... 25..

[Python]데이터 시각화, matplotlib & seaborn - Bar Plot(막대그래프)

In [1]: import pandas as pd pd.set_option('display.max_columns',500) #생략없이 모두 출력 In [2]: marathon_2015 = pd.read_csv("C://Users//82106//Desktop//boston-results//marathon_results_2015.csv") marathon_2016 = pd.read_csv("C://Users//82106//Desktop//boston-results//marathon_results_2016.csv") marathon_2017 = pd.read_csv("C://Users//82106//Desktop//boston-results//marathon_results_2017.csv") b..

[Python]파이썬 데이터 전처리 기초 정리

데이터는 Kaggle에 있는 bostan marathon 데이터를 참고했다. 데이터 불러오기부터 저장까지 아주아주아주아주아주아주 기초가 되는 전처리 방법 정리 https://www.kaggle.com/rojour/boston-results Finishers Boston Marathon 2015, 2016 & 2017 This data has the names, times and general demographics of the finishers www.kaggle.com In [1]: import pandas as pd In [12]: #load the csv file marathon_2015 = pd.read_csv("C://Users//User//Desktop//boston-results/marath..

[Python] sklearn.pipeline, 파이프라인(Pipeline)이란 ?

대부분의 기계 학습 데이터는 최종 모델을 만드는데 있어서 이상적인 형식이 아니다. 범주형 변수를 조작하거나 스케일링 및 정규화와 같은 많은 데이터 변환이 수행되어야 한다. Scikit-Learn은 전처리 기능에 일반적으로 사용되는 대부분의 기능을 내장하고 있다. 그러나 일반적인 기계 학습 워크플로우에서는 이러한 모든 변환을 두 번 이상 적용해야 한다. 모델을 교육할 때 한 번 그리고 예측하고자 하는 모든 새로운 데이터에 대해 다시 한 번하기 때문이다. 물론 재사용하는 기능을 쓸 수 있지만 먼저 실행하고 나서 모델을 따로 불러야 할 것이다. Scikit-Learn pipeline은 이 과정을 단순화하는 도구로써 다음과 같은 몇 가지 주요 이점이 있다. 파이프라인을 사용하면 데이터 사전 처리 및 분류의 모든..

반응형