Problem using discretize function
조회 수: 8 (최근 30일)
이전 댓글 표시
I have a column "Net Pickups" in a table which contains integers from about -100 to 100. I want to discretize it to create a categorical variable "Demand" such that:
· Net Pickups < 0: ‘Low’
· 0 <= Net Pickups < 15: ‘Medium’
· Net Pickups >= 15: ‘High’
However, I'm getting the error that my 'values' vector should have the same length as my number of bins i.e. 3. What am I doing wrong? Here's a ballpark of the code I think should be used
values = [min(trainData.NetPickups) 0 15 max(trainData.NetPickups)]
discretize(trainData.NetPickups,3,values,"categorical",{'Low','Medium','High'})
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!