2016-07-17 02:35:55 +02:00
|
|
|
print.dataset.statistics = function(dataset)
|
2016-04-15 15:44:49 +02:00
|
|
|
{
|
2016-07-17 02:35:55 +02:00
|
|
|
if (ncol(dataset) == 0) # for mockups
|
2016-04-15 15:44:49 +02:00
|
|
|
{
|
|
|
|
flog.warn("Empty dataset")
|
|
|
|
return()
|
|
|
|
}
|
|
|
|
|
|
|
|
no.cases = nrow(dataset)
|
|
|
|
no.attributes = ncol(dataset) - 1
|
2016-07-17 02:35:55 +02:00
|
|
|
perc.classes =
|
|
|
|
round(100*as.numeric(table(dataset[, ncol(dataset)]))/nrow(dataset), 0)
|
2016-04-15 15:44:49 +02:00
|
|
|
|
|
|
|
flog.info(paste0("Cases: ", no.cases, ", attributes: ", no.attributes,
|
|
|
|
", classes: ", perc.classes[1], "%/", perc.classes[2], "%"))
|
|
|
|
}
|
2016-07-17 02:35:55 +02:00
|
|
|
|
|
|
|
setup.logger = function(output.file)
|
|
|
|
{
|
|
|
|
if (LOGGER.OVERWRITE.EXISTING.FILES & file.exists(output.file))
|
|
|
|
{
|
|
|
|
file.remove(output.file)
|
|
|
|
}
|
|
|
|
|
|
|
|
invisible(flog.appender(appender.tee(output.file)))
|
|
|
|
}
|