본문 바로가기

연속형 변수를 binning(구간을 나누어 그룹)하여 범주형으로 변형 : Binning Records on a Continuous Variable with Pandas Cut and QCut 번역 https://towardsdatascience.com/binning-records-on-a-continuous-variable-with-pandas-cut-and-qcut-5d7c8e11d7b0 Binning Records on a Continuous Variable with Pandas Cut and QCut When, why, and how to transform a numeric feature into a categorical feature towardsdatascience.com 해당 글을 참고, 번역한 글입니다. 연속형 변수를 binning(구간을 나누어 그룹지음)하는 것에 대해서 생각해보자 Binning할 때 주의할 점 granularity(얼마나 자세히 분할되어 있는지)가 줄어든다. 당연히..
부스트캠프 AI Tech 3기 Pre-Course [6]-3 Numpy : comparison, where, I/O, Index Comparison import numpy as np a=np.arange(1,4) print(a2)) # 하나라도 True면 True다. #True print(np.all(a>2)) # 하나라도 False면 False다. #False broadcasting되어 각각 element와 2를 비교하게 된다(element wise operation). 결과로 boolean array가 나온다. any(or) : 하나라도 조건에 만족한다면 true all(and) : 모두가 조건에 만족한다면 true import numpy as np a=np.arange(1,4) print(a>0) #[ True True True] print(a0,a2) #[False False True] print(np.where(a>2, ..
부스트캠프 AI Tech 3기 Pre-Course [6]-2 Numpy : reshape, creation, operation, math, performance reshape array의 shape의 크기를 변경하는데, element의 갯수는 동일하다. import numpy as np a=np.array([[1,2,3,4],[2,3,4,5]]) print(a.shape) # (2,4) print(a.reshape(8,)) # >>[1 2 3 4 2 3 4 5] print(a.reshape(-1,2)) # [[1 2] # [3 4] # [2 3] # [4 5]] print(a.reshape(2,-1,2)) # [[[1 2] # [3 4]] # # [[2 3] # [4 5]]] 어차피 정해진 element수는 계속해서 같기 때문에 나머지 하나를 -1 로 두면 알아서 남은 만큼으로 만들어준다. 이 코드에서는 a=a.reshape~~ 이렇게 할당이 일어나지 않았기 때..
부스트캠프 AI Tech 3기 Pre-Course [6]-1 Numpy : 넘파이 개요, shape, dtype, nbytes Numpy : Numerical Python 파이썬의 고성능 과학 계산용 패키지 matrix, array 연산의 표준 특징 List에 비해 빠르고, 효율적이다. 반복몬 없이 데이터 배열에 대한 처리를 지원 선형대수 관련 다양한 기능 제공 ndarray numpy dimension array import numpy as np a=np.array([1,4,3], float) 그냥 대부분 alias(별칭)을 np로 다들 둔다. 리스트랑 같은 기능이지만 메모리에 저장하는 방식이 다르다. 리스트는 static하게 [1]이 있다면 1이라는 숫자가 저장되어 있는 주소를 가리키는 포인터를 저장하는 방식이지만, ndarray 는 메모리에 순서대로 저장되고 그 값도 따로 저장이 된다. 그래서 순서대로 저장되어 있기 때문에..
부스트캠프 AI Tech 3기 Pre-Course - 인공지능(AI) 맛보기 : [1]Historical Review 부스트캠프를 준비하며 들었던 부스트코스의 내용을 정리해 두려고 합니다. Reference : 부스트캠프 AI Tech 3기 Pre-Course - 딥러닝 기본 용어 설명 - Historical Review
[Kaggle] Riiid dataset 이해 : prior_question_elapsed_time 대회 main 페이지 학습로그를 보고 문제를 맞출지를 예측하는 대회이다. prior_question_elapsed_time과 prior_question_had_explanation이라는 열이 잘 이해가 되지 않아서 이 글을 쓰게 되었다. Data discription row_id: (int64) ID code for the row. 행 마다 순서대로 좌르르 붙혀지는 id timestamp: (int64) the time in milliseconds between this user interaction and the first event completion from that user. 헷갈리는 부분의 시작이다. 이 discussion 에 따르면 이라고 하는데 그니까 문제를 제출한 클릭한 그 시간에 time..
[ML] Auto ML : Regression 사용하기 Auto ML 설치는 이전 게시물을 참고하길 바랍니다. [ML] Colabolatory 에서 Auto ML 설치 (ERROR: pip's dependency resolver does not currently take into account all the packages !pip install --upgrade setuptools ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This datascience 0.10.6 requres folium==0.2.1, but you ha.. chae52.tistory.com 공식 사이트이다. auto-sklearn — Au..
[ML] Colabolatory 에서 Auto ML 설치 (ERROR: pip's dependency resolver does not currently take into account all the packages that are installed.) !pip install --upgrade setuptools ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This datascience 0.10.6 requres folium==0.2.1, but you have folium 0.8.3 which is incompatible. WARNING: The following packages were previously imported in this runtime: [pkg_recources] You must restart the runtime in order to use newly installed versions. ..