R/callback-functions.R
callback_base_return_pop.Rd
A base callback function that returns a galgo.Obj
callback_base_return_pop (userdir = "",generation, pop_pool, pareto, prob_matrix, current_time)
userdir | the default directory used by `galgo()` to store files |
---|---|
generation | a number indicating the number of iterations of the galgo algorithm |
pop_pool | a |
pareto | the solutions found by Galgo across all generations in the solution space |
prob_matrix | a |
current_time | an |
an object of class galgo
#> Warning: object 'transbig' not foundexpression <- Biobase::exprs(Train) clinical <- Biobase::pData(Train) OS <- survival::Surv(time = clinical$t.rfs, event = clinical$e.rfs) # We will use a reduced dataset for the example expression <- expression[sample(1:nrow(expression), 100), ] # Now we scale the expression matrix expression <- t(scale(t(expression))) # Run galgo with base_return_pop_callback assigned to the end_galgo_callback # hook-point # By using this callback galgo() return a `galgo,Obj` object. output <- GSgalgoR::galgo(generations = 5, population = 15, prob_matrix = expression, OS = OS, end_galgo_callback = callback_base_return_pop )#>#>#> k rnkIndex CrowD #> result.8 4 0.02559570 206.82540 1 Inf #> result.10 4 0.05791995 14.48178 1 Inf #> result.13 2 0.05073109 32.45238 1 1.313193#>#> k rnkIndex CrowD #> result.1 6 0.03106352 210.57312 1 Inf #> result.3 2 0.07486536 45.95706 1 Inf #> result.13 4 0.05948496 95.64288 1 0.8823692 #> result.10 4 0.06508901 94.40352 1 0.3849673#>#> k rnkIndex CrowD #> result.1 6 0.03106352 210.57312 1 Inf #> result.3 2 0.07486536 45.95706 1 Inf #> 4 0.05252796 162.56503 1 0.8986327 #> 3 0.07290575 130.81743 1 0.8572644#>#> k rnkIndex CrowD #> 10 -0.00671469 306.82977 1 Inf #> 3 0.08651116 16.38125 1 Inf #> result.1 6 0.03106352 210.57312 1 1.1094377 #> 4 0.05252796 162.56503 1 0.7108536 #> 3 0.07290575 130.81743 1 0.5564300 #> 3 0.08101525 86.20927 1 0.5219056#>#> k rnkIndex CrowD #> 10 -0.00671469 306.82977 1 Inf #> 3 0.08651116 16.38125 1 Inf #> 5 0.03436379 245.48002 1 1.1083379 #> 4 0.05252796 162.56503 1 0.7892608 #> 3 0.07290575 130.81743 1 0.5558479 #> 3 0.08101525 86.20927 1 0.5210333