Extract the names of the features in an object.
feature_names(x)
# S4 method for ProjectProblem
feature_names(x)
character
feature names.
# load data
data(sim_projects, sim_features, sim_actions)
# build problem with default solver
p <- problem(sim_projects, sim_actions, sim_features,
"name", "success", "name", "cost", "name") %>%
add_max_richness_objective(budget = 200) %>%
add_binary_decisions() %>%
add_default_solver()
# print problem
print(p)
#> Project Prioritization Problem
#> actions F1_action, F2_action, F3_action, ... (6 actions)
#> projects F1_project, F2_project, F3_project, ... (6 projects)
#> features F1, F2, F3, ... (5 features)
#> action costs: min: 0, max: 103.22583
#> project success: min: 0.81379, max: 1
#> objective: Maximum richness objective [budget (200)]
#> targets: none
#> weights: default
#> decisions Binary decision
#> constraints: <none>
#> solver: Gurobi [first_feasible (0), gap (0), number_solutions (1), presolve (2), solution_pool_method (2), threads (1), time_limit (2147483647), time_limit (2147483647), verbose (1)]
# print feature names
feature_names(p)
#> [1] "F1" "F2" "F3" "F4" "F5"