Info
此问题已关闭。 请重新打开它进行编辑或回答。
Need help with importing database with text field in Regressiontree
1 次查看(过去 30 天)
显示 更早的评论
i have database car and i have field michenicname and location how can i use carname ?
I have tried X=[michenicname location Horsepower Weight]
load carsmall % contains Horsepower, Weight, MPG X = [Horsepower Weight]; rtree = fitrtree(X,MPG)
http://www.mathworks.co.uk/help/stats/classification-trees-and-regression-trees.html#bsw6p25 can anyone help please
0 个评论
回答(1 个)
Tom Lane
2014-8-23
You don't say what your data looks like and what problem you are having.
I'm guessing the michenicname variable is text and that's why you're having a problem. You can't concatenate that with numeric variables. Your best bet may be to code the unique string values as group numbers. The grp2idx function may be helpful.
0 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!