[Subgroup-commits] r51 - in pkg/rsubgroup: . R inst/java man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Sep 10 17:40:18 CEST 2014


Author: atzmueller
Date: 2014-09-10 17:40:17 +0200 (Wed, 10 Sep 2014)
New Revision: 51

Modified:
   pkg/rsubgroup/DESCRIPTION
   pkg/rsubgroup/NEWS
   pkg/rsubgroup/R/classes.R
   pkg/rsubgroup/R/subgroup.R
   pkg/rsubgroup/inst/java/subgroup.jar
   pkg/rsubgroup/man/CreateSDTask.Rd
   pkg/rsubgroup/man/DiscoverSubgroups.Rd
   pkg/rsubgroup/man/DiscoverSubgroupsByTask.Rd
   pkg/rsubgroup/man/Pattern-class.Rd
   pkg/rsubgroup/man/SDTaskConfig-class.Rd
   pkg/rsubgroup/man/ToDataframe.Rd
   pkg/rsubgroup/man/as.target.Rd
   pkg/rsubgroup/man/subgroup-package.Rd
Log:
* fix exclusion of target from attributes for subgroup discovery (dependent variables)
* restrict runtime of examples (according to CRAN policies)
* update documentation for SDTaskConfig - attributes can be NULL so that all attributes
are included, otherwise a subset can be selected

Modified: pkg/rsubgroup/DESCRIPTION
===================================================================
--- pkg/rsubgroup/DESCRIPTION	2014-09-09 07:22:10 UTC (rev 50)
+++ pkg/rsubgroup/DESCRIPTION	2014-09-10 15:40:17 UTC (rev 51)
@@ -2,7 +2,7 @@
 Type: Package
 Title: Subgroup Discovery and Analytics
 Version: 0.6
-Date: 2014-09-09
+Date: 2014-09-10
 Author: Martin Atzmueller
 Maintainer: Martin Atzmueller <martin at atzmueller.net>
 Description: A collection of efficient and effective tools and

Modified: pkg/rsubgroup/NEWS
===================================================================
--- pkg/rsubgroup/NEWS	2014-09-09 07:22:10 UTC (rev 50)
+++ pkg/rsubgroup/NEWS	2014-09-10 15:40:17 UTC (rev 51)
@@ -3,7 +3,7 @@
 For a detailed list of changes, see the svn commit history at
 svn://r-forge.r-project.org/svnroot/subgroup/
 
-Changes in version 0.6 (2014-09-09)
+Changes in version 0.6 (2014-09-10)
 ===================================
 * Improvements:
   * optimizations in the beam search algorithm

Modified: pkg/rsubgroup/R/classes.R
===================================================================
--- pkg/rsubgroup/R/classes.R	2014-09-09 07:22:10 UTC (rev 50)
+++ pkg/rsubgroup/R/classes.R	2014-09-10 15:40:17 UTC (rev 51)
@@ -20,6 +20,13 @@
 #    Contact: Martin Atzmueller (martin at atzmueller.net)
 ###############################################################################
 
+.GetAllAttributesAsJArray <- function(ontology) {
+  attributeSetObject <- J(ontology, "getAttributes")
+  attributeArrayObject <- J(attributeSetObject, "toArray")
+  attributeArray <- .jevalArray(attributeArrayObject)
+  attributeIDs <- sapply(attributeArray, FUN=function(a) {J(a, "getId")}, simplify = TRUE)
+  return(.jarray(attributeIDs))
+}
 
 setClass("SDTaskConfig",
     representation(
@@ -32,10 +39,10 @@
         nodefaults  = "logical",
         relfilter   = "logical",
         postfilter  = "character",
-        attributes  = "character"
+        attributes  = "vector"
     ),
     prototype(qf="ps", method="sdmap", k = as.integer(20), minqual = as.integer(0), minsize = as.integer(0),
-        maxlen = as.integer(7), nodefaults = FALSE, relfilter = FALSE, postfilter = "", attributes = character(0))
+        maxlen = as.integer(7), nodefaults = FALSE, relfilter = FALSE, postfilter = "", attributes = NULL)
 )
 
 

Modified: pkg/rsubgroup/R/subgroup.R
===================================================================
--- pkg/rsubgroup/R/subgroup.R	2014-09-09 07:22:10 UTC (rev 50)
+++ pkg/rsubgroup/R/subgroup.R	2014-09-10 15:40:17 UTC (rev 51)
@@ -101,8 +101,13 @@
   if (config at postfilter != "") {
     J(task, "setPostFilter", config at postfilter)
   }
-  if ((!is.null(config at attributes)) && (length(config at attributes) > 0)) {
-    J(task, "setAttributes", .jarray(config at attributes))
+  if (is.null(config at attributes)) {
+    attributesArrayObject <- .GetAllAttributesAsJArray(ontology = ontology)
+    J(task, "setAttributes", attributesArrayObject)
+  } else if ((!is.null(config at attributes)) && (length(config at attributes) > 0)) {
+    J(task, "setAttributes", .jarray(config at attributes))  
+  } else {
+    J(task, "setAttributes", .jarray(character(0))) 
   }
   return(task)
 }

Modified: pkg/rsubgroup/inst/java/subgroup.jar
===================================================================
(Binary files differ)

Modified: pkg/rsubgroup/man/CreateSDTask.Rd
===================================================================
--- pkg/rsubgroup/man/CreateSDTask.Rd	2014-09-09 07:22:10 UTC (rev 50)
+++ pkg/rsubgroup/man/CreateSDTask.Rd	2014-09-10 15:40:17 UTC (rev 51)
@@ -30,4 +30,4 @@
 # task with numeric target
 taskNum <- CreateSDTask(credit.data, as.target("credit_amount"))
 }
-\keyword{subgroup task}
+\keyword{subgroup task}
\ No newline at end of file

Modified: pkg/rsubgroup/man/DiscoverSubgroups.Rd
===================================================================
--- pkg/rsubgroup/man/DiscoverSubgroups.Rd	2014-09-09 07:22:10 UTC (rev 50)
+++ pkg/rsubgroup/man/DiscoverSubgroups.Rd	2014-09-10 15:40:17 UTC (rev 51)
@@ -27,7 +27,9 @@
 \examples{
 # subgroup discovery on a data.frame, for binary target
 data(credit.data)
-result1 <- DiscoverSubgroups(credit.data, as.target("class", "good"))
+result1 <- DiscoverSubgroups(
+    credit.data, as.target("class", "good"), new("SDTaskConfig",
+    attributes=c("checking_status", "credit_amount", "employment", "purpose")))
 result2 <- DiscoverSubgroups(
     credit.data, as.target("class", "good"), new("SDTaskConfig",
     attributes=c("checking_status", "employment")))
@@ -36,9 +38,10 @@
 ToDataFrame(result2)
 
 # subgroup discovery for numeric target variable
-result3 <- DiscoverSubgroups(credit.data, as.target("credit_amount"))
+result3 <- DiscoverSubgroups(
+    credit.data, as.target("credit_amount"), new("SDTaskConfig",
+    attributes=c("checking_status", "employment")))
 
 ToDataFrame(result3)
 }
-\keyword{subgroup discovery}
-
+\keyword{subgroup discovery}
\ No newline at end of file

Modified: pkg/rsubgroup/man/DiscoverSubgroupsByTask.Rd
===================================================================
--- pkg/rsubgroup/man/DiscoverSubgroupsByTask.Rd	2014-09-09 07:22:10 UTC (rev 50)
+++ pkg/rsubgroup/man/DiscoverSubgroupsByTask.Rd	2014-09-10 15:40:17 UTC (rev 51)
@@ -20,12 +20,15 @@
 \examples{
 # creating a task
 data(credit.data)
-task <- CreateSDTask(credit.data, as.target("class", "bad"))
-taskNum <- CreateSDTask(credit.data, as.target("credit_amount"))
+task <- CreateSDTask(
+    credit.data, as.target("class", "bad"), new("SDTaskConfig",
+    attributes=c("checking_status", "employment"))) 
+taskNum <- CreateSDTask(
+    credit.data, as.target("credit_amount"), new("SDTaskConfig",
+    attributes=c("checking_status", "employment")))
 
 # running the tasks
 DiscoverSubgroupsByTask(task)
 DiscoverSubgroupsByTask(taskNum)
 }
-\keyword{subgroup task}
-
+\keyword{subgroup task}
\ No newline at end of file

Modified: pkg/rsubgroup/man/Pattern-class.Rd
===================================================================
--- pkg/rsubgroup/man/Pattern-class.Rd	2014-09-09 07:22:10 UTC (rev 50)
+++ pkg/rsubgroup/man/Pattern-class.Rd	2014-09-10 15:40:17 UTC (rev 51)
@@ -31,4 +31,4 @@
 \code{\link{CreateSDTask}}
 }
   
-\keyword{classes}
+\keyword{classes}
\ No newline at end of file

Modified: pkg/rsubgroup/man/SDTaskConfig-class.Rd
===================================================================
--- pkg/rsubgroup/man/SDTaskConfig-class.Rd	2014-09-09 07:22:10 UTC (rev 50)
+++ pkg/rsubgroup/man/SDTaskConfig-class.Rd	2014-09-10 15:40:17 UTC (rev 51)
@@ -59,7 +59,8 @@
 	removes patterns that do not significantly improve
 	(0.05 level) w.r.t. all generalizations in the result set.
 	}
-	\item{\code{attributes}}{The list of attributes to consider for mining.}
+	\item{\code{attributes}}{The list of attributes to consider for mining.
+	Either a vector of attribute names, or NULL, which includes all attributes.}
 	}
  }
 \seealso{

Modified: pkg/rsubgroup/man/ToDataframe.Rd
===================================================================
--- pkg/rsubgroup/man/ToDataframe.Rd	2014-09-09 07:22:10 UTC (rev 50)
+++ pkg/rsubgroup/man/ToDataframe.Rd	2014-09-10 15:40:17 UTC (rev 51)
@@ -15,4 +15,4 @@
 \seealso{
 \code{\link{DiscoverSubgroups}}.
 }
-\keyword{subgroup analysis}
+\keyword{subgroup analysis}
\ No newline at end of file

Modified: pkg/rsubgroup/man/as.target.Rd
===================================================================
--- pkg/rsubgroup/man/as.target.Rd	2014-09-09 07:22:10 UTC (rev 50)
+++ pkg/rsubgroup/man/as.target.Rd	2014-09-10 15:40:17 UTC (rev 51)
@@ -25,4 +25,4 @@
 #numeric:
 as.target("numeric_class")
 }
-\keyword{target variable}
+\keyword{target variable}
\ No newline at end of file

Modified: pkg/rsubgroup/man/subgroup-package.Rd
===================================================================
--- pkg/rsubgroup/man/subgroup-package.Rd	2014-09-09 07:22:10 UTC (rev 50)
+++ pkg/rsubgroup/man/subgroup-package.Rd	2014-09-10 15:40:17 UTC (rev 51)
@@ -14,7 +14,7 @@
 Package: \tab rsubgroup\cr
 Type: \tab Package\cr
 Version: \tab 0.6\cr
-Date: \tab 2014-09-09\cr
+Date: \tab 2014-09-10\cr
 License: \tab GPL (>= 3)\cr
 LazyLoad: \tab yes\cr
 }
@@ -31,5 +31,4 @@
 	\item Florian Lemmerich and Mathias Rohlfs and Martin Atzmueller. Fast Discovery of Relevant Subgroup Patterns. In: Proc. 23rd FLAIRS Conference, AAAI Press, 2010.
   }
 }
-\keyword{ package }
-
+\keyword{ package }
\ No newline at end of file



More information about the Subgroup-commits mailing list