반응형

Python 72

[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은 이 과정을 단순화하는 도구로써 다음과 같은 몇 가지 주요 이점이 있다. 파이프라인을 사용하면 데이터 사전 처리 및 분류의 모든..

[checkIO]Element 02.Easy Unpack

our mission here is to create a function that gets a tuple and returns a tuple with 3 elements - the first, third and second to the last for the given array. Input: A tuple, at least 3 elements long. Output: A tuple. Example: easy_unpack((1, 2, 3, 4, 5, 6, 7, 9)) == (1, 3, 7) easy_unpack((1, 1, 1, 1)) == (1, 1, 1) easy_unpack((6, 3, 7)) == (6, 7, 3) * 튜플에서 첫번째, 세번째 그리고 뒤에서 두번째 값을 output - 풀이 def..

반응형