Skip to content

Commit

Permalink
Fix features selection (#16)
Browse files Browse the repository at this point in the history
* Fixed features_selection

* Remove unsupported

* Bump version
  • Loading branch information
giladmaya authored Mar 25, 2024
1 parent 928c21c commit d683953
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 14 deletions.
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pd-dwi"
version = "1.0.4"
version = "1.0.5"
description = "Physiologically-Decomposed Diffusion-Weighted MRI machine-learning model for predicting response to neoadjuvant chemotherapy in invasive breast cancer"
authors = [
"Maya Gilad <[email protected]>"
Expand All @@ -14,8 +14,6 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Development Status :: 3 - Alpha"
]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion src/pd_dwi/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Classifier(BaseModel):

class Pipeline(BaseModel):
features_transformer: FeatureTransformer
feature_selection: FeatureSelection
features_selection: FeatureSelection
classifier: Classifier


Expand Down
2 changes: 1 addition & 1 deletion src/pd_dwi/config/samples/F.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pipeline:
Original: { }
setting:
resampledPixelSpacing: [ 1.27,1.27,4.0 ]
feature_selection:
features_selection:
k: 100
classifier:
module: xgboost.XGBClassifier
Expand Down
2 changes: 1 addition & 1 deletion src/pd_dwi/config/samples/adc0100.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pipeline:
Original: {}
setting:
resampledPixelSpacing: [1.27,1.27,4.0]
feature_selection:
features_selection:
k: 100
classifier:
module: xgboost.XGBClassifier
Expand Down
2 changes: 1 addition & 1 deletion src/pd_dwi/config/samples/adc0100600800.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pipeline:
Original: {}
setting:
resampledPixelSpacing: [1.27,1.27,4.0]
feature_selection:
features_selection:
k: 100
classifier:
module: xgboost.XGBClassifier
Expand Down
2 changes: 1 addition & 1 deletion src/pd_dwi/config/samples/adc0100_F.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pipeline:
Original: { }
setting:
resampledPixelSpacing: [ 1.27,1.27,4.0 ]
feature_selection:
features_selection:
k: 100
classifier:
module: xgboost.XGBClassifier
Expand Down
2 changes: 1 addition & 1 deletion src/pd_dwi/config/samples/adc100600800.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pipeline:
Original: {}
setting:
resampledPixelSpacing: [1.27,1.27,4.0]
feature_selection:
features_selection:
k: 100
classifier:
module: xgboost.XGBClassifier
Expand Down
2 changes: 1 addition & 1 deletion src/pd_dwi/training_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def create_pipeline_from_config(cfg: ModelConfig) -> Pipeline:
remainder='drop'
)

cfg_feature_selection = cfg.pipeline.feature_selection
cfg_feature_selection = cfg.pipeline.features_selection
if cfg_feature_selection is None:
features_selection = SelectKBest(f_classif)
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/data/invalid_encoders_bad_modality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pipeline:
Original: { }
setting:
resampledPixelSpacing: [ 1.27,1.27,4.0 ]
feature_selection:
features_selection:
k: 100
classifier:
module: xgboost.XGBClassifier
Expand Down
2 changes: 1 addition & 1 deletion tests/data/invalid_encoders_bad_time_points.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pipeline:
Original: { }
setting:
resampledPixelSpacing: [ 1.27,1.27,4.0 ]
feature_selection:
features_selection:
k: 100
classifier:
module: xgboost.XGBClassifier
Expand Down
2 changes: 1 addition & 1 deletion tests/data/invalid_no_modalities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pipeline:
Original: { }
setting:
resampledPixelSpacing: [ 1.27,1.27,4.0 ]
feature_selection:
features_selection:
k: 100
classifier:
module: xgboost.XGBClassifier
Expand Down
2 changes: 1 addition & 1 deletion tests/data/valid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pipeline:
Original: { }
setting:
resampledPixelSpacing: [ 1.27,1.27,4.0 ]
feature_selection:
features_selection:
k: 100
classifier:
module: xgboost.XGBClassifier
Expand Down

2 comments on commit d683953

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
pd_dwi
   __init__.py20100% 
   dataset.py463230%12, 15–18, 20–22, 24, 26–27, 29, 31–32, 34–37, 39–43, 45, 47–49, 56, 59, 62, 66, 69
   model.py803753%56, 58–60, 62–63, 66, 68–70, 72–73, 77–78, 80–82, 84–85, 87–88, 90, 92–94, 100–111
   training_utils.py53492%27–28, 60, 84
pd_dwi/config
   __init__.py00100% 
   config.py71198%100
   utils.py11190%15
pd_dwi/feature_selection
   __init__.py00100% 
   select_k_best.py60100% 
pd_dwi/models
   __init__.py12466%14–16, 18
pd_dwi/preprocessing
   __init__.py00100% 
   column_transformer.py10460%14–15, 18, 20
pd_dwi/preprocessing/transformers
   __init__.py00100% 
   hormone_receptor_encoder.py19952%16–17, 19, 22–24, 26, 29, 32
   radiomics_encoder.py692859%40, 43, 55–56, 58, 61, 63–64, 66, 68, 71, 74, 77–82, 84–85, 87, 90, 93–98
   sbr_grade_encoder.py21957%18–19, 22, 24, 27–28, 30, 33, 36
pd_dwi/scripts
   __init__.py00100% 
   cli.py17194%24
   list_command.py90100% 
   predict_command.py251444%9–10, 12–13, 15, 17–19, 21, 23–24, 26–27, 29
   score_command.py8275%5–6
   train_command.py10370%5–7
TOTAL46914968% 

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
pd_dwi
   __init__.py20100% 
   dataset.py463230%12, 15–18, 20–22, 24, 26–27, 29, 31–32, 34–37, 39–43, 45, 47–49, 56, 59, 62, 66, 69
   model.py803753%56, 58–60, 62–63, 66, 68–70, 72–73, 77–78, 80–82, 84–85, 87–88, 90, 92–94, 100–111
   training_utils.py53492%27–28, 60, 84
pd_dwi/config
   __init__.py00100% 
   config.py71198%100
   utils.py11190%15
pd_dwi/feature_selection
   __init__.py00100% 
   select_k_best.py60100% 
pd_dwi/models
   __init__.py12466%14–16, 18
pd_dwi/preprocessing
   __init__.py00100% 
   column_transformer.py10460%14–15, 18, 20
pd_dwi/preprocessing/transformers
   __init__.py00100% 
   hormone_receptor_encoder.py19952%16–17, 19, 22–24, 26, 29, 32
   radiomics_encoder.py692859%40, 43, 55–56, 58, 61, 63–64, 66, 68, 71, 74, 77–82, 84–85, 87, 90, 93–98
   sbr_grade_encoder.py21957%18–19, 22, 24, 27–28, 30, 33, 36
pd_dwi/scripts
   __init__.py00100% 
   cli.py17194%24
   list_command.py90100% 
   predict_command.py251444%9–10, 12–13, 15, 17–19, 21, 23–24, 26–27, 29
   score_command.py8275%5–6
   train_command.py10370%5–7
TOTAL46914968% 

Please sign in to comment.