run_searchlight | R Documentation |
Execute a searchlight analysis using multivariate pattern analysis.
run_searchlight(
model_spec,
radius,
method = c("standard", "randomized"),
niter = NULL,
...
)
model_spec |
A |
radius |
The searchlight radius in millimeters |
method |
The type of searchlight, either 'randomized' or 'standard' |
niter |
The number of searchlight iterations (used only for 'randomized' method) |
... |
Extra arguments passed to specific searchlight methods |
A named list of NeuroVol
objects containing performance metrics (e.g., AUC) at each voxel location
# Generate sample dataset with categorical response
dataset <- gen_sample_dataset(
D = c(8,8,8), # 8x8x8 volume
nobs = 100, # 100 observations
response_type = "categorical",
data_mode = "image",
blocks = 3, # 3 blocks for cross-validation
nlevels = 2 # binary classification
)
# Create cross-validation specification using blocks
cval <- blocked_cross_validation(dataset$design$block_var)
# Load the SDA classifier (Shrinkage Discriminant Analysis)
model <- load_model("sda_notune")
# Create MVPA model
mspec <- mvpa_model(
model = model,
dataset = dataset$dataset,
design = dataset$design,
model_type = "classification",
crossval = cval
)
# Run searchlight analysis
results <- run_searchlight(
mspec,
radius = 8, # 8mm radius
method = "standard" # Use standard searchlight
)
# Results contain performance metrics
# Access them with results$performance
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.