Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
16e094a
plot_pd is now correctly exported.
alexzwanenburg May 12, 2026
0353d7c
Version 2.0.1 is Brilliant Bat.
alexzwanenburg May 13, 2026
7479e8a
Work to facilitate selection of a subset of features for feature simi…
alexzwanenburg May 13, 2026
f360d0e
Add features as input parameter for export_feature_similarity.
alexzwanenburg May 13, 2026
2b6927b
`plot_feature_similarity` now has the `features` argument, which sele…
alexzwanenburg May 15, 2026
19dbda9
Add remove_feature_labels.
alexzwanenburg May 15, 2026
9b65311
Added features, remove_feature_labels and remove_sample_labels to plo…
alexzwanenburg May 15, 2026
bd59395
Initial pass-through for features.
alexzwanenburg May 15, 2026
843ac31
Add selection of features to .extract_sample_similarity
alexzwanenburg May 18, 2026
6f8b5d8
`plot_kaplan_meier` now works correctly if the column indicated by `r…
alexzwanenburg May 19, 2026
6173be8
select_features now has a clearer error message.
alexzwanenburg May 19, 2026
5c5f125
Prevent duplication of identfier columns if they are not explicitly s…
alexzwanenburg May 20, 2026
55afe0c
`plot_kaplan_meier` now plots strata in one facet if the risk group i…
alexzwanenburg May 20, 2026
083f44c
`plot_kaplan_meier` now correctly shows the results of the log-rank t…
alexzwanenburg May 20, 2026
0661a31
Update NEWS.md
alexzwanenburg May 20, 2026
b96bf32
Revise tests in test-experimental_design
alexzwanenburg May 20, 2026
743618e
Update tests to be more complex.
alexzwanenburg May 20, 2026
b3568a5
WIP on fall-back for determining variable importance to select the mo…
alexzwanenburg May 20, 2026
7dd3205
WIP on fall-back code.
alexzwanenburg May 21, 2026
f146d02
Prevents an error when evaluating models in bootstrap or cross-valida…
alexzwanenburg May 21, 2026
a786ad6
Added missing parameter documentation.
alexzwanenburg May 21, 2026
05504ac
Pass through features to shap and ice computation methods.
alexzwanenburg May 22, 2026
039a041
Use roxygen2 version 8.0.0
alexzwanenburg May 22, 2026
356407c
Now that features are explicitly passed, check for waiver().
alexzwanenburg May 22, 2026
d358aab
Use identical instead of direct comparison.
alexzwanenburg May 22, 2026
f8e4d77
Split experimental_design into separate test files.
alexzwanenburg May 22, 2026
7d4c9b0
Update archive to 2.0.1.
alexzwanenburg May 22, 2026
42fc0d1
Evaluation makes this test take a long time.
alexzwanenburg May 22, 2026
82fcd37
Update cran-comments.md
alexzwanenburg May 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: familiar
Title: End-to-End Automated Machine Learning and Model Evaluation
Version: 2.0.0
Version: 2.0.1
Authors@R: c(
person("Alex", "Zwanenburg",
email = "alexander.zwanenburg@nct-dresden.de",
Expand All @@ -26,7 +26,6 @@ Depends: R (>= 4.0.0)
License: EUPL
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.3
Roxygen: list(markdown = TRUE)
VignetteBuilder: knitr
Imports:
Expand Down Expand Up @@ -227,3 +226,4 @@ Collate:
'aaa.R'
Config/testthat/parallel: true
Config/testthat/edition: 3
Config/roxygen2/version: 8.0.0
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ exportMethods(plot_feature_similarity)
exportMethods(plot_ice)
exportMethods(plot_kaplan_meier)
exportMethods(plot_model_performance)
exportMethods(plot_pd)
exportMethods(plot_permutation_variable_importance)
exportMethods(plot_sample_clustering)
exportMethods(plot_shap_dependence)
Expand Down
32 changes: 32 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
# Version 2.0.1 (Brilliant Bat)

## Minor changes

- `plot_feature_similarity` and `plot_sample_clustering` now have the `features`
argument, which selects the features that appear in the heatmap.

- `plot_feature_similarity` and `plot_sample_clustering` now have the
`remove_feature_labels` argument, which suppresses rendering of feature
names as tick labels for the heatmap.

- `plot_sample_clustering` now has the `remove_sample_labels` argument, which
suppresses rendering of sample names as tick labels for the heatmap.

- `plot_kaplan_meier` now plots strata in one facet if the risk group is equal
to the data set.

- `plot_kaplan_meier` now correctly shows the results of the log-rank test for
strata in each facet.

## Fixes

- Prevents an error when evaluating models in bootstrap or cross-validation
experiments without variable importances and a number features in the model
that exceeds `n_important_features`.

- `plot_pd` is now correctly exported and can be called externally.

- `plot_kaplan_meier` now works correctly if the column indicated by `risk_group_column`
contains `NA` values.


# Version 2.0.0 (Astonishing Anteater)

## Breaking changes
Expand Down
5 changes: 4 additions & 1 deletion R/DataObject.R
Original file line number Diff line number Diff line change
Expand Up @@ -2338,7 +2338,10 @@ setMethod(
# Check if features are present as column name
if (length(features) > 0L) {
if (!all(features %in% colnames(data@data))) {
logger_stop("Not all features were found in the data set.")
missing_features <- setdiff(features, colnames(data@data))
logger_stop(
paste0("Not all features were found in the data set: ", paste_s(missing_features))
)
}
}

Expand Down
15 changes: 15 additions & 0 deletions R/DataParameterChecks.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
) {
settings$data$sample_col <- get_id_columns(single_column = "sample")
}

} else if (is.null(settings$data$sample_col)) {
if (get_id_columns(single_column = "sample") %in% colnames(data)) {
settings$data$sample_col <- get_id_columns(single_column = "sample")
}
}

if (!is.null(settings$data$batch_col) && check_stringency != "strict") {
Expand All @@ -83,6 +88,11 @@
) {
settings$data$batch_col <- get_id_columns(single_column = "batch")
}

} else if (is.null(settings$data$batch_col)) {
if (get_id_columns(single_column = "batch") %in% colnames(data)) {
settings$data$batch_col <- get_id_columns(single_column = "batch")
}
}

if (!is.null(settings$data$series_col) && check_stringency != "strict") {
Expand All @@ -93,6 +103,11 @@
) {
settings$data$series_col <- get_id_columns(single_column = "series")
}

} else if (is.null(settings$data$series_col)) {
if (get_id_columns(single_column = "series") %in% colnames(data)) {
settings$data$series_col <- get_id_columns(single_column = "series")
}
}

## Sample column -------------------------------------------------------------
Expand Down
6 changes: 2 additions & 4 deletions R/Familiar.R
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,7 @@ summon_familiar <- function(
#' @inheritParams .parse_variable_importance_settings
#' @inheritDotParams .parse_experiment_settings -config
#' @inheritDotParams .parse_setup_settings -config
#' @inheritDotParams .parse_preprocessing_settings -config -data -parallel
#' -outcome_type
#' @inheritDotParams .parse_preprocessing_settings -config -data -parallel -outcome_type
#'
#' @details This is a thin wrapper around `summon_familiar`, and functions like
#' it, but automatically skips computation of variable importance, learning
Expand Down Expand Up @@ -729,8 +728,7 @@ precompute_data_assignment <- function(
#' @inheritParams .parse_variable_importance_settings
#' @inheritDotParams .parse_experiment_settings -config
#' @inheritDotParams .parse_setup_settings -config
#' @inheritDotParams .parse_preprocessing_settings -config -data -parallel
#' -outcome_type
#' @inheritDotParams .parse_preprocessing_settings -config -data -parallel -outcome_type
#'
#' @details This is a thin wrapper around `summon_familiar`, and functions like
#' it, but automatically skips computation of variable importance, learning
Expand Down
12 changes: 11 additions & 1 deletion R/FamiliarDataComputation.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ setMethod(
#' vignette on performance metrics for the available metrics. If not provided
#' explicitly, this parameter is read from settings used at creation of the
#' underlying `familiarModel` objects.
#'
#'@param features Features that should be considered for extracting information
#' from. Typically called in external workflows, e.g. for plotting. Internally,
#' i.e. from summon_familiar, this variable is not used.
#'
#'@param feature_cluster_method The method used to perform clustering. These are
#' the same methods as for the `cluster_method` configuration parameter:
#' `none`, `hclust`, `agnes`, `diana` and `pam`.
Expand Down Expand Up @@ -319,6 +324,7 @@ setMethod(
stratification_method = waiver(),
evaluation_times = waiver(),
metric = waiver(),
features = waiver(),
feature_cluster_method = waiver(),
feature_cluster_cut_method = waiver(),
feature_linkage_method = waiver(),
Expand Down Expand Up @@ -346,7 +352,7 @@ setMethod(
"feature_expressions", "permutation_vimp") %in% data_element)) {
# Not for the fs_vimp data elements. This is because the subset of
# features in the ensemble is generally smaller than that assessed within
# feature selection..
# feature selection.

# Compute a table containing the pairwise distance between features.
feature_similarity <- extract_feature_similarity(
Expand All @@ -358,6 +364,7 @@ setMethod(
confidence_level = confidence_level,
bootstrap_ci_method = bootstrap_ci_method,
is_pre_processed = is_pre_processed,
features = features,
feature_cluster_method = feature_cluster_method,
feature_linkage_method = feature_linkage_method,
feature_cluster_cut_method = feature_cluster_cut_method,
Expand All @@ -378,6 +385,7 @@ setMethod(
data = data,
cl = cl,
is_pre_processed = is_pre_processed,
features = features,
sample_limit = sample_limit,
sample_similarity_metric = sample_similarity_metric,
sample_cluster_method = sample_cluster_method,
Expand Down Expand Up @@ -639,6 +647,7 @@ setMethod(
data = data,
cl = cl,
ensemble_method = ensemble_method,
features = features,
evaluation_times = evaluation_times,
sample_limit = sample_limit,
n_important_features = n_important_features,
Expand All @@ -663,6 +672,7 @@ setMethod(
data = data,
cl = cl,
ensemble_method = ensemble_method,
features = features,
evaluation_times = evaluation_times,
sample_limit = sample_limit,
detail_level = detail_level,
Expand Down
34 changes: 34 additions & 0 deletions R/FamiliarDataComputationFeatureExpression.R
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,37 @@ setMethod(




.feature_expression_remove_feature <- function(x, features) {
if (is_empty(x)) return(x)

all_features <- names(x@feature_info)
available_features <- intersect(all_features, features)

if (length(available_features) == 0L) return(NULL)

# Filter features.
x@feature_info <- x@feature_info[available_features]
x@data <- x@data[, mget(c(setdiff(colnames(x@data), all_features), available_features))]
x@value_column <- available_features

return(x)
}





# export_feature_expressions (generic) -----------------------------------------

#'@title Extract and export feature expressions.
#'
#'@description Extract and export feature expressions for the features in a
#' familiarCollection.
#'
#'@param features Features that should be exported. If `NULL` or `waiver()`, all
#' features exported (default).
#'
#'@param evaluation_time One or more time points that are used to create the
#' outcome columns in expression plots. If not provided explicitly, this
#' parameter is read from settings used at creation of the underlying
Expand Down Expand Up @@ -314,6 +338,7 @@ setGeneric(
"export_feature_expressions",
function(
object,
features = waiver(),
dir_path = NULL,
evaluation_time = waiver(),
export_collection = FALSE,
Expand All @@ -333,6 +358,7 @@ setMethod(
signature(object = "familiarCollection"),
function(
object,
features = waiver(),
dir_path = NULL,
evaluation_time = waiver(),
export_collection = FALSE,
Expand All @@ -348,6 +374,11 @@ setMethod(
# Check that the data are not empty.
if (is_empty(x)) return(NULL)

if (!is.waive(features) && !is.null(features)) {
# Filter features.
x <- lapply(x, .feature_expression_remove_feature, features = features)
}

if (!is.waive(evaluation_time)) {

# Check values.
Expand Down Expand Up @@ -391,6 +422,7 @@ setMethod(
signature(object = "ANY"),
function(
object,
features = waiver(),
dir_path = NULL,
evaluation_time = waiver(),
export_collection = FALSE,
Expand All @@ -403,6 +435,7 @@ setMethod(
args = c(
list(
"object" = object,
"features" = features,
"data_element" = "feature_expressions",
"evaluation_times" = evaluation_time
),
Expand All @@ -415,6 +448,7 @@ setMethod(
args = c(
list(
"object" = object,
"features" = features,
"dir_path" = dir_path,
"evaluation_time" = evaluation_time,
"export_collection" = export_collection
Expand Down
Loading
Loading