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!