Re: [问题] Question about hw2

楼主: wazowski (ludan)   2006-03-03 03:33:00
※ 引述《Yyh (我爱批踢踢)》之铭言:
: Here is a naive solution.
: A for loop can be used to scan these 40 binary attributes,
: and then set the "40-value attribute" as
: "attribute number" of none-zero value.
: Is there any better solution?
How about this:
Soil.Type <- as.factor(as.matrix(covtype.tr[,15:54]) %*% 1:40)
: btw, the 40 binary attributes from left to right is 1~40, right?
I would guess the order doesn't really matter,
since we're dealing with 40-value attribute as it's nominal.
(speaking in R, that's unordered factor)
By the way,
is anybody running into the same problem that
construction of decision tree with the 40-value attribute takes an
incredibly large amount of CPU time? (I'm using rpart)
It's been several hours and my machine is still desperately
building the tree :(

Links booklink

Contact Us: admin [ a t ] ucptt.com