搜索
人大经济论坛 附件下载

附件下载

所在主题:
文件名:  mba.txt
资料下载链接地址: https://bbs.pinggu.org/a-2593363.html
附件大小:
救救孩子吧
这是怎么肥事?怎么改才好? Error in slot(x, s) : subscript out of bounds
R version 3.5.1 (2018-07-02) -- "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(arules)
载入需要的程辑包:Matrix

载入程辑包:‘arules’

The following objects are masked from ‘package:base’:

abbreviate, write

> library(arulesViz)
载入需要的程辑包:grid
> dt<-read.table("mba.txt",header=T)
> mba<-as(dt,"transactions")
> rules=apriori(mba,parameter=list(support=0.03,confidence=0.4,minlen=2,maxlen=2))
Apriori

Parameter specification:
confidence minval smax aremaval originalSupport
0.4 0.1 1 none FALSE TRUE
maxtime support minlen maxlen target ext
5 0.03 2 2rules FALSE

Algorithmic control:
filter tree heap memopt load sort verbose
0.1 TRUE TRUEFALSE TRUE 2 TRUE

Absolute minimum support count: 5

set item appearances ...[0 item(s)] done [0.00s].
set transactions ...[27 item(s), 179 transaction(s)] done [0.00s].
sorting and recoding items ... [22 item(s)] done [0.00s].
creating transaction tree ... done [0.00s].
checking subsets of size 1 2 done [0.00s].
writing ... [19 rule(s)] done [0.00s].
creating S4 object... done [0.00s].
Warning message:
In apriori(mba, parameter = list(support = 0.03, confidence = 0.4,:
Mining stopped (maxlen reached). Only patterns up to a length of 2 returned!
> summary(rules)
set of 19 rules

rule length distribution (lhs + rhs):sizes
2
19

Min. 1st Qu.Median Mean 3rd Qu. Max.
2 2 2 2 2 2

summary of quality measures:
support confidence lift
Min. :0.03352 Min. :0.4048 Min. :1.362
1st Qu.:0.10056 1st Qu.:0.4988 1st Qu.:1.637
Median :0.16760 Median :0.6122 Median :2.275
Mean :0.14760 Mean :0.6505 Mean :2.216
3rd Qu.:0.17318 3rd Qu.:0.7941 3rd Qu.:2.578
Max. :0.31844 Max. :0.9661 Max. :3.236
count
Min. : 6.00
1st Qu.:18.00
Median :30.00
Mean :26.42
3rd Qu.:31.00
Max. :57.00

mining info:
data ntransactions support confidence
mba 179 0.03 0.4
> x=sort(subset(rules,subset=lhs%pin%"=TRUE"&rhs%pin%"=TRUE"&lift>=1),by="support")
> inspect(x[1:10])
Error in slot(x, s) : subscript out of bounds




    熟悉论坛请点击新手指南
下载说明
1、论坛支持迅雷和网际快车等p2p多线程软件下载,请在上面选择下载通道单击右健下载即可。
2、论坛会定期自动批量更新下载地址,所以请不要浪费时间盗链论坛资源,盗链地址会很快失效。
3、本站为非盈利性质的学术交流网站,鼓励和保护原创作品,拒绝未经版权人许可的上传行为。本站如接到版权人发出的合格侵权通知,将积极的采取必要措施;同时,本站也将在技术手段和能力范围内,履行版权保护的注意义务。
(如有侵权,欢迎举报)
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

GMT+8, 2026-1-22 17:16