### Set up java parameter and load rmcfs package
options(java.parameters = "-Xmx4g")
library(rmcfs)
# create input data
adata <- artificial.data(rnd.features = 10)
showme(adata)
# Parametrize and run MCFS-ID procedure
result <- mcfs(class~., adata, projections = 100, projectionSize = 4,
cutoffPermutations = 3, finalCV = FALSE, finalRuleset = TRUE,
threadsNumber = 2)
# Plot & print out distances between subsequent projections.
# These are convergence MCFS-ID statistics.
plot(result, type="distances")
print(result$distances)
# Plot & print out 50 most important features.
plot(result, type="ri", size = 50)
# Show max RI values from permutation experiment.
plot(result, type = "ri", size = 50, plot_permutations = TRUE)
print(head(result$RI, 50))
# Plot & print out 50 strongest feature interdependencies.
plot(result, type = "id", size = 50)
print(head(result$ID, 50))
# Plot features ordered by RI_norm. Parameter 'size' is the number of
# top features in the chart. We set this parameter a bit larger than cutoff_value.
plot(result, type = "features", size = result$cutoff_value * 1.1, cex = 1)
# Here we set 'size' at fixed value 10.
plot(result, type = "features", size = 10)
# Plot cv classification result obtained on top features.
# In the middle of x axis red label denotes cutoff_value.
# plot(result, type = "cv", measure = "wacc", cex = 0.8)
# Plot & print out confusion matrix. This matrix is the result of
# all classifications performed by all decision trees on all s*t datasets.
plot(result, type = "cmatrix")
Run the code above in your browser using DataLab