DataScience
article thumbnail
728x90

 

basic1.csv
0.00MB

주어진 데이터에서 'f5'컬럼을 min-max 스케일 변환한 후, 상위 5%와 하위 5% 값의 합을 구하시오

library(dplyr)
library(caret)
df=read.csv('../input/bigdatacertificationkr/basic1.csv')
p=preProcess(df,"range")
ans<-df%>%mutate(pre_f5=predict(p,df)$f5)%>%summarise(sum=sum(quantile(pre_f5,0.95),quantile(pre_f5,0.05)))
print(ans)

#정답 : 1.024874

 

암기

quantile(컬럼,비율)

quantile(컬럼,1/4) # 4분위수

profile

DataScience

@Ninestar

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!