일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 셀레니움
- 파이썬
- #비정형 데이터 #네이버 #지도 #크롤링
- #위도#경도#비정형데이터#크롤링
- #비정형#카카오api#api#크롤링
- 웹매크로 #세잔느
- 코딩
- 카카오APi
- #크롤링 #웹문서
- 구글 지오코드
- 숫자빼고 중복되는 코드동작법
- 웹크롤링
- #K-means #Clustering
- 위도경도
- 파이썬 셀레니움
- Today
- Total
목록All (143)
지방이의 Data Science Lab
(데이터 크기가 커질수록 lubridate함수로 관리하는 것보다 string으로 들고 있는 것이 억만배 가볍다. 월별 추출도 string단위로 긁어오는게 훨씬 빠른 속도를 보인다.) [2019.12.25 => 20191225] library(stringr) monthly$관리년월 = str_replace_all(monthly$관리년월, "[.]", "") monthly$yearmonth = str_sub(monthly$yearmonth,1,7) [201912 => 2019-12-01] '몇일' 변수를 꼭 추가해야 하는 경우가 있다. (시각화) 예를들어 x축에 날짜를 넣고 싶은 경우가 그렇다. 그럴때 보통 사용하는 코드가 이것: temp$yearmonth = as.Date(ymd(paste0(temp$ye..
방법1.(추천) temp2 = summarise(group_by(data, yearmonth, 원하는 컬럼))%>%arrange(yearmonth) temp3 = model.matrix(~원하는 컬럼, temp2)%>%data.frame() temp3[,1]=NULL 한 컬럼에 담겨진 character들을 여러 컬럼으로 더미화하고 싶을때 사용. 방법2.(비추) library(mlr) df
library(stringr) temp1$month = str_sub(temp1$yearmonth,5,6) temp1$month = as.numeric(temp1$month) seasons = function(x){ if(x %in% 2:4) return('Spring') if(x %in% 5:7) return('Summer') if(x %in% 8:10) return('Fall') if(x %in% c(11,12,1)) return('Winter') } temp1$season = sapply(temp1$month, seasons)

https://jlim0316.tistory.com/97 앞서 만들었던 vocab에서 스팸인 문자와 아닌문자 중 공통으로 들어가는 단어가 존재할 것이다. 예를들어, '하다'라는 단어가 있다고 치자. 스팸인 문자에서는 '하다'가 1번 나왔고 스팸아닌 문자에선 '하다'가 100번 나왔다고 생각해보자. common단어라 보기 어렵다. 스팸아닌데서만 하다가 나오는 경우가 훨씬 많기 때문에. 이런경우 min값을 출력하되 정렬을 큰 숫자부터 보고 75% 퀀타일로 잘라서 불용어로 보겠다. max값을 출력하되 정렬을 작은 숫자부터 정렬시키고 25% 퀀타일로 잘라서 불용어 처리 하겠다. 나온 결과는 다음과 같다: common = [min_common,max_common] common = sum(common, []) co..

https://jlim0316.tistory.com/97 smishing인 vocab에서 value값을 순서대로 나열해보자.

데이터는 이런식으로 생겼다. 이제, text컬럼의 자연어를 전처리해보자. 만들어진 아웃풋은 다음과 같다.
완전 기초분석으로 R을 처음 접하는 사람이 배우기에 좋다.
from sklearn.cluster import AgglomerativeClustering %time cluster = AgglomerativeClustering(n_clusters=7, affinity='euclidean', linkage='average') cluster.fit_predict(temp_data) pd.value_counts(pd.Series(cluster.labels_)) 불러오는 중입니다... from sklearn.cluster import KMeans km = KMeans(n_clusters=7) x_names = [x for x in total_activity.columns if x not in ['acc_id']] km.fit(total_activity[x_names]) p..