evolve_model.R/class_def.R
ga_fsm-class.RdAn S4 class to return the results of using a GA to estimate a FSM with
evolve_model.
Turns ga_fsm S4 object into list of summaries for printing and then prints it.
Plots ga_fsm S4 object's state transition matrix
Plots ga_fsm S4 object's variable importances
Plots ga_fsm S4 object's variable importances
Extracts slot relevant to estimating the fsm
Extracts performance
Extracts slot of variable importances
Extracts slot of action_vec
Extracts number of states
Predicts new data with estimated model
# S4 method for class 'ga_fsm'
print(x, ...)
# S4 method for class 'ga_fsm'
show(object)
# S4 method for class 'ga_fsm'
summary(object, digits = 3)
# S4 method for class 'ga_fsm,ANY'
plot(x, y, maintitle = "Transition Diagram",
action_label = NULL, transition_label = NULL,
curvature = c(0.3, 0.6, 0.8))
# S4 method for class 'ga_fsm'
barplot(height, ...)
# S4 method for class 'ga_fsm'
dotchart(x, labels)
# S4 method for class 'ga_fsm'
estimation_details(x)
# S4 method for class 'ga_fsm'
best_performance(x)
# S4 method for class 'ga_fsm'
varImp(x)
# S4 method for class 'ga_fsm'
action_vec(x)
# S4 method for class 'ga_fsm'
states(x)
# S4 method for class 'ga_fsm'
predict(object, data, type = "prob", na.action = stats::na.omit, ...)S4 ga_fsm object. @export
arguments to be passed to/from other methods.
S4 ga_fsm object
Optional numeric vector length one for how many significant digits to print, default is 3.
@export
not used.
optional character vector
optional character vector same length as action vector, where each ith element corresponds to what that ith element in the action vector represents. This will be used to fill in the states (circles) of the state transition matrix to be plotted.
optional character vector same length as number of columns of state transition matrix.
optional numeric vector specifying the curvature of the lines for a diagram of 2 or more states.
ga_fsm S4 object
vector of labels for each point. For vectors the default is to use names(x) and for matrices the row labels dimnames(x)[[1]].
A data.frame that has columns named "period" and "outcome"
(period is the time period that the outcome action was taken), and one to
three additional columns, containing predictors.
All of the 3-5 columns should be named.
The period and outcome columns should be integer vectors and the columns
with the predictor variable data should be logical vectors
(TRUE, FALSE).
If the predictor variable data is not logical, it will coerced to logical
with base::as.logical().
Not currently used.
Optional function.
print(ga_fsm): An S4 method for printing a ga_fsm S4 object
show(ga_fsm): An S4 method for showing a ga_fsm S4 object
summary(ga_fsm): An S4 method for summarizing a ga_fsm S4 object
plot(x = ga_fsm, y = ANY):
barplot(ga_fsm):
dotchart(ga_fsm): Plots ga_fsm S4 object's variable importances
estimation_details(ga_fsm): @export
best_performance(ga_fsm): @export
varImp(ga_fsm): @export
action_vec(ga_fsm): @export
states(ga_fsm): @export
predict(ga_fsm): Predicts new data with estimated model
callLanguage from the call of the function evolve_model.
actionsNumeric vector with the number of actions.
statesNumeric vector with the number of states.
GAS4 object created by ga() from the GA package.
state_matNumeric matrix with rows as states and columns as predictors.
action_vecNumeric vector indicating what action to take for each state.
predictiveNumeric vector of length one with test data accuracy if test data was supplied; otherwise, a character vector with a message that the user should provide test data for better estimate of performance.
varImpNumeric vector same length as number of columns of state matrix with relative importance scores for each predictor.
varImp2Numeric matrix same size as state matrix with relative importance scores for each transition.
timingNumeric vector length one with the total elapsed seconds it took
evolve_model to execute.
diagnosticsCharacter vector length one, to be printed with base::cat().