{"rsdb":{"rid":"179525","subhead":"","postdate":"0","aid":"130294","fid":"91","uid":"1","topic":"1","content":"
\n
\n

\u672c\u6587\u65e8\u5728\u6f14\u793arpart\u5305\u7684\u51b3\u7b56\u6811\u5206\u7c7b\u7528\u6cd5\uff0c\u4ee5\u53ca\u5229\u7528rpart.plot\u5bf9\u7ed3\u679c\u8fdb\u884c\u53ef\u89c6\u5316\u3002\u51b3\u7b56\u6811\uff08\u5206\u7c7b\u6811\uff09\u662f\u4e00\u79cd\u5341\u5206\u5e38\u7528\u7684\u5206\u7c7b\u65b9\u6cd5\uff0c\u662f\u4e00\u79cd\u76d1\u7ba1\u5b66\u4e60\uff1b\u6240\u8c13\u76d1\u7ba1\u5b66\u4e60\u5c31\u662f\u7ed9\u5b9a\u4e00\u5806\u6837\u672c\uff0c\u6bcf\u4e2a\u6837\u672c\u90fd\u6709\u4e00\u7ec4\u5c5e\u6027\u548c\u4e00\u4e2a\u7c7b\u522b\uff0c\u8fd9\u4e9b\u7c7b\u522b\u662f\u4e8b\u5148\u786e\u5b9a\u7684\uff0c\u90a3\u4e48\u901a\u8fc7\u5b66\u4e60\u5f97\u5230\u4e00\u4e2a\u5206\u7c7b\u5668\uff0c\u8fd9\u4e2a\u5206\u7c7b\u5668\u80fd\u591f\u5bf9\u65b0\u51fa\u73b0\u7684\u5bf9\u8c61\u7ed9\u51fa\u6b63\u786e\u7684\u5206\u7c7b\u3002\u8fd9\u6837\u7684\u673a\u5668\u5b66\u4e60\u5c31\u88ab\u79f0\u4e4b\u4e3a\u76d1\u7763\u5b66\u4e60\u3002<\/p> \n <\/blockquote> \n

\u6d4b\u8bd5\u6570\u636e\u9009\u7528MushroomDataSet(\u8611\u83c7\u6570\u636e\u96c6)\uff0c\u5176\u6570\u636e\u5c5e\u6027\u5982\u4e0b\uff1a<\/h3> \n

Attribute Information:<\/p> \n

    \n
  1. cap-shape: bell=b,conical=c,convex=x,flat=f, knobbed=k,sunken=s<\/li> \n
  2. cap-surface: fibrous=f,grooves=g,scaly=y,smooth=s<\/li> \n
  3. cap-color: brown=n,buff=b,cinnamon=c,gray=g,green=r,pink=p,purple=u,red=e,white=w,yellow=y<\/li> \n
  4. bruises?: bruises=t,no=f<\/li> \n
  5. odor: almond=a,anise=l,creosote=c,fishy=y,foul=f, musty=m,none=n,pungent=p,spicy=s<\/li> \n
  6. gill-attachment: attached=a,descending=d,free=f,notched=n<\/li> \n
  7. gill-spacing: close=c,crowded=w,distant=d<\/li> \n
  8. gill-size: broad=b,narrow=n<\/li> \n
  9. gill-color: black=k,brown=n,buff=b,chocolate=h,gray=g,green=r,orange=o,pink=p,purple=u,red=e, white=w,yellow=y<\/li> \n
  10. stalk-shape: enlarging=e,tapering=t<\/li> \n
  11. stalk-root: bulbous=b,club=c,cup=u,equal=e, rhizomorphs=z,rooted=r,missing=?<\/li> \n
  12. stalk-surface-above-ring: fibrous=f,scaly=y,silky=k,smooth=s<\/li> \n
  13. stalk-surface-below-ring: fibrous=f,scaly=y,silky=k,smooth=s<\/li> \n
  14. stalk-color-above-ring: brown=n,buff=b,cinnamon=c,gray=g,orange=o,pink=p,red=e,white=w,yellow=y<\/li> \n
  15. stalk-color-below-ring: brown=n,buff=b,cinnamon=c,gray=g,orange=o,pink=p,red=e,white=w,yellow=y<\/li> \n
  16. veil-type: partial=p,universal=u<\/li> \n
  17. veil-color: brown=n,orange=o,white=w,yellow=y<\/li> \n
  18. ring-number: none=n,one=o,two=t<\/li> \n
  19. ring-type: cobwebby=c,evanescent=e,flaring=f,large=l,none=n,pendant=p,sheathing=s,zone=z<\/li> \n
  20. spore-print-color: black=k,brown=n,buff=b,chocolate=h,green=r,orange=o,purple=u,white=w,yellow=y<\/li> \n
  21. population: abundant=a,clustered=c,numerous=n, scattered=s,several=v,solitary=y<\/li> \n
  22. habitat: grasses=g,leaves=l,meadows=m,paths=p, urban=u,waste=w,woods=d
    data\u6570\u636e\u4e0b\u8f7d\u5730\u5740\u53c2\u89c1\u5173\u8054\u89c4\u5219-R\u8bed\u8a00\u5b9e\u73b0\u4e00\u6587\u3002<\/li> \n <\/ol> \n

    \u4ee3\u7801<\/h2> \n
    library(rpart)\nlibrary(rpart.plot)\ndata =read.csv(file.choose(),head=F)\nstr(data_ms)\n\ntable(data_ms$X1)\n\n   e    p \n4208 3916 \n\nprop.table(table(data_ms$X1))\n\n        e         p \n0.5179714 0.4820286 \n\nprop.table(table(data_ms$X1,data_ms$X2),2)\n\n    b         c         f         k         s         x\n  e 0.8938053 0.0000000 0.5063452 0.2753623 1.0000000 0.5328228\n  p 0.1061947 1.0000000 0.4936548 0.7246377 0.0000000 0.4671772\n\nfit <- rpart(X1 ~.,\n             data=data_ms,\n             method="class")\n#\u5206\u7c7b\u7ed3\u679c\u53ef\u89c6\u5316 \nrpart.plot(reg, type=4, extra=1,shadow.col="gray", box.col="green",\n           border.col="blue", split.col="red",split.cex=1.2,main="\u51b3\u7b56\u6811")<\/code><\/pre> \n 

    <\/p> \n

    \u53ef\u4ee5\u770b\u51fa\uff0c\u8611\u83c7\u6570\u636e\u66f4\u9002\u5408\u901a\u8fc7\u51b3\u7b56\u6811\u7b97\u6cd5\u8fdb\u884c\u5206\u7c7b\u5904\u7406\uff0c\u5206\u7c7b\u89c4\u5219\u8bc4\u5224\u8611\u83c7\u6709\u6bd2\u4e0e\u5426\u6e05\u6670\u660e\u4e86\u3002<\/p> \n

    \u53cd\u9988\u4e0e\u5efa\u8bae<\/h3> \n