Problem using discretize function
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Cell Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!