Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit13510e5

Browse files
Merge pull request#64 from alexzwanenburg/dev1.4.1
Merge version 1.4.1
2 parentsc9b9f65 +eb33c39 commit13510e5

File tree

48 files changed

+4600
-3051
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+4600
-3051
lines changed

‎.Rbuildignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
^vignettes/original$
1616
^tests/testthat/Rplots\.pdf$
1717
^tests/old_experiments$
18+
^Rplots\.pdf$

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ inst/doc
1111
/man/
1212
*.Rd
1313
tests/old_experiments/_experiment
14+
Rplots.pdf

‎DESCRIPTION‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: familiar
22
Title: End-to-End Automated Machine Learning and Model Evaluation
3-
Version: 1.4.0
3+
Version: 1.4.1
44
Authors@R: c(
55
person("Alex", "Zwanenburg",
66
email = "alexander.zwanenburg@nct-dresden.de",
@@ -30,7 +30,7 @@ Depends: R (>= 4.0.0)
3030
License: EUPL
3131
Encoding: UTF-8
3232
LazyData: true
33-
RoxygenNote: 7.2.2
33+
RoxygenNote: 7.2.3
3434
Roxygen: list(markdown = TRUE)
3535
VignetteBuilder: knitr
3636
Imports:

‎NEWS.md‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
#Version 1.4.1 (Nefarious Newt)
2+
3+
##Minor changes
4+
5+
- Robust methods for power transformations were added, based on the work of Raymaekers and Rousseeuw (Transforming variables to central normality. Mach Learn. 2021. doi:10.1007/s10994-021-05960-5). These methods are`yeo_johnson_robust` and`box_cox_robust`.
6+
7+
- A robust normalisation method, based on Huber's M-estimators for location and scale, was added:`standardisation_robust`.
8+
9+
- Improved efficiency of aggregating and computing point estimates for evaluation steps. It may occur that for each grouping (e.g. samples for pairwise sample similarity), multiple values are available that should be aggregated to a point estimate. Previously we split on all unique combinations of grouping column, and process each split separately. This is a valid approach, but can occur significant overhead when this forms a large number (>100k) splits. We now first determine which data (if any) require computation of a (bias-corrected) point estimate because of grouping. Often, each split would only contain a single instance which forms a point estimate on its own. Extra computation is avoided for these cases.
10+
11+
- Plots now always show the evaluation time point. This is relevant for, for example, calibration plots, where both the observed and expected (predicted) probabilities are time-dependent, and will change depending on the time point.
12+
13+
- Improved support for providing a file name for storing a plot. The plotting device is now changed based on the file name, if it has an extension. In case multiple plots would be created, e.g. due to splitting on some grouping variable, such as the underlying dataset, the provided file name is used as a base.
14+
15+
- Methods for setting labels previously could update the ordering of the labels for`familiarCollection` objects, which could produce unexpected changes. Setting new labels now does not change the label order. Use the`order` argument to update the order of the labels.
16+
17+
##Bug fixes
18+
19+
- Fixed an error that would occur when attempting to create risk group labels for a`familiarCollection` object that is composed of externally provided`familiarData` objects.
20+
21+
- Fixed an issue that would prevent a`familiarCollection` object from being returned if an experiment was run using a temporary folder.
22+
23+
- Fixed an issue with apply functions in familiar taking long to aggregate their results.
24+
25+
- Fixed an issue that would prevent Kaplan-Meier curves to be plotted when more than three risk strata where present.
26+
27+
- Fixed an error that would occur if Kaplan-Meier curves were plotted for more than one stratification method and different risk groups.
28+
29+
- Fixed an issue that could potentially cause matching wrong transformation and normalisation parameter values when forming ensemble models. This may have affect sample cluster plots, which uses this information.
30+
131
#Version 1.4.0 (Misanthropic Muskrat)
232

333
##Major changes

‎R/CombatNormalisation.R‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ setMethod("add_feature_info_parameters", signature(object="featureInfoParameters
4141

4242
# Generate a replacement object that uses univariate
4343
# standardisation.
44-
replacement_object<- ..create_normalisation_parameter_skeleton(feature_name=object@name,
45-
method="standardisation",
46-
batch=object@batch)
44+
replacement_object<- ..create_normalisation_parameter_skeleton(
45+
feature_name=object@name,
46+
method="standardisation",
47+
batch=object@batch)
4748

4849
# Select the current feature and batch from batch_parameter_data.
4950
batch_parameter_data<-batch_parameter_data[feature==object@name&batch_id==object@batch, ]
@@ -90,9 +91,10 @@ setMethod("add_feature_info_parameters", signature(object="featureInfoParameters
9091

9192
# Generate a replacement object that uses univariate
9293
# standardisation.
93-
replacement_object<- ..create_normalisation_parameter_skeleton(feature_name=object@name,
94-
method="standardisation",
95-
batch=object@batch)
94+
replacement_object<- ..create_normalisation_parameter_skeleton(
95+
feature_name=object@name,
96+
method="standardisation",
97+
batch=object@batch)
9698

9799
# Select the current feature and batch from batch_parameter_data.
98100
batch_parameter_data<-batch_parameter_data[feature==object@name&batch_id==object@batch, ]

‎R/Evaluation.R‎

Lines changed: 79 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
run_evaluation<-function(cl,
2-
proj_list,
3-
settings,
4-
file_paths,
5-
message_indent=0L,
6-
verbose=TRUE){
1+
run_evaluation<-function(
2+
cl,
3+
proj_list,
4+
settings,
5+
file_paths,
6+
message_indent=0L,
7+
verbose=TRUE){
78
# performs evaluation of the data
89

910
if(settings$eval$do_parallel=="FALSE")cl<-NULL
@@ -12,21 +13,32 @@ run_evaluation <- function(cl,
1213
if(length(settings$eval$evaluation_data_elements)==0)verbose<-FALSE
1314

1415
# Extract data from ensembles
15-
data_set_list<- .prepare_familiar_data_sets(cl=cl,
16-
only_pooling=settings$eval$pool_only,
17-
message_indent=message_indent,
18-
verbose=verbose)
19-
16+
data_set_list<- .prepare_familiar_data_sets(
17+
cl=cl,
18+
only_pooling=settings$eval$pool_only,
19+
message_indent=message_indent,
20+
verbose=verbose)
21+
2022
# Form collections (all individual ensembles with train and validation data combined)
2123
collection_list<- .prepare_familiar_collections(data_set_list=data_set_list)
2224

23-
# Create and save collections and export data
25+
# Create and save collections and export data. For temporary files we do not
26+
# export the plots and tables, as that does not make sense.
2427
if(!file_paths$is_temporary){
25-
lapply(collection_list,
26-
.process_collections,
27-
file_paths=file_paths,
28-
message_indent=message_indent,
29-
verbose=verbose)
28+
lapply(
29+
collection_list,
30+
.process_collections,
31+
file_paths=file_paths,
32+
message_indent=message_indent,
33+
verbose=verbose)
34+
35+
}else {
36+
lapply(
37+
collection_list,
38+
.create_familiar_collection_runtime,
39+
file_paths=file_paths,
40+
message_indent=message_indent,
41+
verbose=verbose)
3042
}
3143
}
3244

@@ -556,40 +568,71 @@ run_evaluation <- function(cl,
556568

557569

558570

559-
.process_collections<-function(collection_info,
560-
file_paths,
561-
message_indent=0L,
562-
verbose=TRUE){
563-
571+
.create_familiar_collection_runtime<-function(
572+
collection_info,
573+
file_paths,
574+
message_indent=0L,
575+
verbose=TRUE){
576+
564577
# Create the expected file path to the familiarCollection object.
565-
fam_collection_file<- file.path(file_paths$fam_coll_dir, paste0(collection_info$collection_name,".RDS"))
566-
578+
fam_collection_file<- file.path(
579+
file_paths$fam_coll_dir,
580+
paste0(collection_info$collection_name,".RDS"))
581+
567582
# Check if the familiarCollection already exists.
568583
if(!file.exists(fam_collection_file)){
569-
logger.message(paste0("\nEvaluation: Creating collection",collection_info$collection_name),
570-
indent=message_indent,
571-
verbose=verbose)
584+
logger.message(
585+
paste0("\nEvaluation: Creating collection",collection_info$collection_name),
586+
indent=message_indent,
587+
verbose=verbose)
572588

573589
# Create a collection using the available input data
574-
fam_collection<- as_familiar_collection(object=collection_info$fam_data,
575-
familiar_data_names=collection_info$fam_data_names,
576-
collection_name=collection_info$collection_name)
590+
fam_collection<- suppressWarnings(
591+
as_familiar_collection(
592+
object=collection_info$fam_data,
593+
familiar_data_names=collection_info$fam_data_names,
594+
collection_name=collection_info$collection_name))
577595

578596
# Save to drive.
579-
save(list=fam_collection,file=file_paths$fam_coll_dir)
597+
save(
598+
list=fam_collection,
599+
file=file_paths$fam_coll_dir)
580600

581601
}else {
582602
# Read from drive.
583603
fam_collection<- load_familiar_object(fam_collection_file)
584604
}
585605

586-
logger.message(paste0("\nEvaluation: Exporting data from collection",collection_info$collection_name),
587-
indent=message_indent,
588-
verbose=verbose)
606+
return(fam_collection)
607+
}
608+
609+
610+
611+
.process_collections<-function(collection_info,
612+
file_paths,
613+
message_indent=0L,
614+
verbose=TRUE){
615+
616+
# Create or load familiarCollection object.
617+
fam_collection<- .create_familiar_collection_runtime(
618+
collection_info=collection_info,
619+
file_paths=file_paths,
620+
message_indent=message_indent,
621+
verbose=verbose
622+
)
623+
624+
logger.message(
625+
paste0("\nEvaluation: Exporting data from collection",collection_info$collection_name),
626+
indent=message_indent,
627+
verbose=verbose)
589628

590629
# Export to csv
591-
export_all(object=fam_collection,dir_path=file_paths$results_dir)
630+
export_all(
631+
object=fam_collection,
632+
dir_path=file_paths$results_dir)
592633

593634
# Export to plot
594-
plot_all(object=fam_collection,dir_path=file_paths$results_dir)
635+
plot_all(
636+
object=fam_collection,
637+
dir_path=file_paths$results_dir)
595638
}

‎R/Familiar.R‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,9 +1103,8 @@ get_project_list <- function(){
11031103
# Load familiarData files and add to list
11041104
familiar_list$familiarData<- load_familiar_object(data_files)
11051105

1106-
11071106
# Find familiarCollection files
1108-
coll_files<- list.files(path=file_paths$fam_coll_dir,pattern="ensemble.RDS|pooled_data.RDS")
1107+
coll_files<- list.files(path=file_paths$fam_coll_dir,pattern="ensemble_data_|pooled_data.RDS")
11091108
coll_files<- sapply(coll_files,function(x,dir_path) (file.path(dir_path,x)),dir_path=file_paths$fam_coll_dir)
11101109

11111110
# Load familiarCollection files and add to list

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp