R 언어:SMOTE 사용 중 오류 발생
1369 단어 R 언어
나의 원래 코드:
balanceData
오류 원인 은 tibble 데이터 구 조 를 DMwR:SMOTE()에 전 송 했 기 때 문 입 니 다.as.data.frame()을 사용 하여 데 이 터 를 un-tible 화하 면 됩 니 다.수 정 된 코드 는 다음 과 같 습 니 다.
balanceData
참고 자료:
https://stackoverflow.com/questions/38616260/smote-length-of-dimnames-2-not-equal-to-array-extent
오류 2、"T 에 오류 가 있 습 니 다[,]:subscript out of bounds 추가:경고 메시지:1:In FUN(newX[,i],...): no non-missing arguments to max; returning -Inf 2: In FUN(newX[, i], ...) : no non-missing arguments to max; returning -Inf 3: In FUN(newX[, i], ...) : no non-missing arguments to max; returning -Inf 4: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf 5: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf 6: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf”
str(as.data.frame(selecData)를 사용 하면 볼 수 있 습 니 다.
'data.frame': 141 obs. of 4 variables:
$ status : num 0 1 0 0 0 0 0 0 0 0 ...
status 는 num 형 입 니 다.Factor 형 으로 바 꿔 야 합 니 다.SMOTE()를 사용 하기 전에 먼저:
selecData$status = as.factor(selecData$status)
참고 자료:
https://arulvelkumar.wordpress.com/2017/04/30/smote-function-in-r-error-in-ti-subscript-out-of-bounds/
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
R 언어와 시간 시퀀스 학습 노트(1)R 언어에도 통계 패키지의sunspots와 같은 많은 데이터 집합이 있는데, 함수 데이터 (sunspots) 를 통해 그것들을 호출할 수 있다. AR(2)모델 x(t)=x(t-1)--0.9x(t-2)+e(t) 그리고...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.