Export the rows that makes the confusion matrix

830 views
Skip to first unread message

Rolf Edberg

unread,
Jun 11, 2013, 7:26:10 AM6/11/13
to rattle...@googlegroups.com

Hi

 

How can I export the rows that are used to form the confusion matrix?

 

I want to continue to make calculations on the rows that makes the result in the confusion matrix including TP, FP, TN and FN.

 

How can I export all the rows (incl the parameters) into an csv flie or Excel file?

 

Regards,

Rolf

 

 

Graham Williams

unread,
Jun 11, 2013, 7:56:58 AM6/11/13
to rattle...@googlegroups.com
Have a look in the Log tab. The code to generate the matrix is included there.

For the weather dataset, I see the following code used to generate the matrix:

> table(crs$dataset[crs$validate, c(crs$input, crs$target)]$RainTomorrow, crs$pr, dnn=c("Actual", "Predicted"))

Wrap this in a write.csv to save a csv file:

> write.csv(table(crs$dataset[crs$validate, c(crs$input, crs$target)]$RainTomorrow, crs$pr, dnn=c("Actual", "Predicted")), file="tmp.csv")

Is that what you meant? 

Graham Williams


--
You received this message because you are subscribed to the Google Groups "rattle-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rattle-users...@googlegroups.com.
To post to this group, send email to rattle...@googlegroups.com.
Visit this group at http://groups.google.com/group/rattle-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Graham Williams

unread,
Jun 11, 2013, 8:00:37 AM6/11/13
to rattle...@googlegroups.com
On 11 June 2013 18:16, <gerard...@gmail.com> wrote:

Hi,

 

Rattle is not responding (meaning nothing happens) when I execute Associate (including basket).

 

In R the following error is displayed:

 

Error in executeAssociateTab() : attempt to apply non-function

 

I think it is has to do with running Rattle on a Mac

 

Lion OS X 10.8.3

R version 2.15.3

Rattle 2.6.26

 

Does anyone have a solution?

 

Regards Gerard


I wonder if you have arules installed - Rattle should be picking that up so I don't think that is the actual problem. 

You could try the latest version of Rattle to see if that fixes the problem:

> install.packages("rattle", repos="http://rattle.togaware.com", type="source")
 
Hope that helps.

Graham Williams


Rolf Edberg

unread,
Jun 11, 2013, 8:31:14 AM6/11/13
to rattle...@googlegroups.com

Hi Graham,

I get the following error if I try to create the csv-file:

Error in table(crs$dataset[crs$validate, c(crs$input, crs$target)]$RainTomorrow,  :

  all arguments must have the same length

 

My goal in the weather dataset would be to take the sum of RISK_MM from the 205 TP and compare it with the sum of the RISK_MM from the 27 FP. Sometimes the RISK_MM is smaller or bigger in the TP than the FP. (In the weather dataset is the TP no(Pre)/no(Act) and the FP(no(Pre)/yes(Act))

 

How do I do that?

 

Kind regards,

Rolf

Bob Nisbet

unread,
Jun 11, 2013, 9:30:00 AM6/11/13
to rattle...@googlegroups.com

It is easier to just do it all in Excel.  Export the scored list, and create your own confusion matrix with Excel formulas.  I do it all the time with output from other data mining tools.

 

Bob Nisbet

Rolf Edberg

unread,
Jun 11, 2013, 4:17:44 PM6/11/13
to rattle...@googlegroups.com

Thank you for the advise!!

 

What I am worried about is that the RISK_MM at the False Positive ( the wrong predictions) is worse than the average RISK_MM. That is the reason I want the RISK_MM that is the wrong predictions.

 

Rolf

timeitself

unread,
Mar 18, 2014, 6:17:27 PM3/18/14
to rattle...@googlegroups.com
I have the same situation, with Mac OS 10.9.2 (Mavericks).
Everything else seems to work fine.
The Rattle version I have is 2.6.27 100.

I'm using Rattle in a Data mining course I'm teaching at the Stevens Institute of Technology and Basket Analysis is one of the topics ...

Carlo

Graham Williams

unread,
Mar 21, 2014, 1:24:33 AM3/21/14
to rattle-users
Did you give it a try with the latest version of rattle?

> install.packages("rattle", repos="http://rattle.togaware.com", type="source")

This should be fixed there.

Graham Williams


--
You received this message because you are subscribed to the Google Groups "rattle-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rattle-users...@googlegroups.com.
To post to this group, send email to rattle...@googlegroups.com.

timeitself

unread,
Mar 21, 2014, 6:05:27 PM3/21/14
to rattle...@googlegroups.com
I updated it to the latest Rattle version (3.0.3), but still not working.
Also, I'm using R 2.15, because R 3 seems to be in conflict with the graphic libraries, mapping all the Rattle characters with squares.
Moving Rattle to a Ubuntu VM seems to be the most feasible work around.


Thanks
Carlo

Stephen

unread,
Mar 20, 2014, 4:13:53 AM3/20/14
to rattle...@googlegroups.com
Hello,

I have the same problem, Mac OS X 10.9.2 (Mavericks), R version 3.0.3, Rattle 3.0.3. In the log, I have:

# Association Rules 

# The 'arules' package provides the 'arules' function.

require(arules, quietly=TRUE)

I also get these errors with clustering when clicking “Execute” (using the weather sample data):

Error in executeClusterKMeans(include) : attempt to apply non-function 

Error in executeClusterEwkm(include) : attempt to apply non-function

In the log, I have:
# KMeans 

# Reset the random number seed to obtain the same results each time.

set.seed(crv$seed)

and
# Entropy Weighted KMeans 

# The 'weightedKmeans' package provides the 'ewkm' function.

require(weightedKmeans, quietly=TRUE)

# Reset the random number seed to obtain the same results each time.

set.seed(crv$seed)

Stephen

Graham Williams

unread,
Mar 25, 2014, 2:33:51 PM3/25/14
to rattle...@googlegroups.com
These issues are now fixed in Rattle version 3.0.4


> install.packages("rattle", repos="http://rattle.togaware.com", type="source")

Thanks for the assistance in resolving the issues.
Reply all
Reply to author
Forward
0 new messages