R/callback-functions.R
base_return_pop_callback.RdA base callback function that returns a galgo.Obj
base_return_pop_callback( 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 <- galgoR::galgo(generations = 5, population = 15, prob_matrix = expression, OS = OS, end_galgo_callback = base_return_pop_callback )#>#>#> k rnkIndex CrowD #> result.4 7 0.084590350 257.1524 1 1.195919 #> result.6 7 0.003680792 317.3117 1 Inf #> result.8 10 0.005842896 292.0617 1 1.012713 #> result.11 6 0.099653514 216.1316 1 Inf#>#> k rnkIndex CrowD #> result.6 7 0.003680792 317.3117 1 Inf #> result.11 6 0.099653514 216.1316 1 Inf #> result.4 7 0.084590350 257.1524 1 0.9224728 #> result.13 7 0.014630474 269.6885 1 0.8038738 #> result.8 10 0.005842896 292.0617 1 0.2587913#>#> k rnkIndex CrowD #> result.6 7 0.003680792 317.3117 1 Inf #> result.11 6 0.099653514 216.1316 1 Inf #> result.4 7 0.084590350 257.1524 1 1.0030396 #> result.13 7 0.014630474 269.6885 1 0.8771233 #> result.8 10 0.005842896 292.0617 1 0.2729658#>#> k rnkIndex CrowD #> result.11 6 0.099653514 216.1316 1 Inf #> 10 0.002507672 461.5718 1 Inf #> result.4 7 0.084590350 257.1524 1 0.8639862 #> result.13 7 0.014630474 269.6885 1 0.7675283 #> result.6 7 0.003680792 317.3117 1 0.4062790 #> result.8 10 0.005842896 292.0617 1 0.2018596#>#> k rnkIndex CrowD #> 10 0.002507672 461.57176 1 Inf #> 2 0.118741912 75.50483 1 Inf #> result.4 7 0.084590350 257.15245 1 0.7624803 #> result.13 7 0.014630474 269.68853 1 0.6741793 #> result.11 6 0.099653514 216.13165 1 0.6552316 #> result.6 7 0.003680792 317.31173 1 0.3947242 #> result.8 10 0.005842896 292.06171 1 0.1869448