Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
MPBA Radiomics
RADLER
Commits
9794d893
Commit
9794d893
authored
Nov 04, 2019
by
Alessia Marcolini
Browse files
Better root path handling
parent
d1d66c16
Changes
1
Hide whitespace changes
Inline
Side-by-side
radiomics_pipeline/feature_selection/merge_features.py
View file @
9794d893
PATH
=
'/home/bizzego/projects/radiomics_pipeline'
#%%
from
IPython
import
get_ipython
get_ipython
().
run_line_magic
(
'HN_env'
,
''
)
#%%
import
os
PATH
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
curdir
,
''
))
#PATH = '/home/bizzego/projects/radiomics_pipeline'
import
numpy
as
np
import
os
import
matplotlib.pyplot
as
plt
import
pandas
as
pd
#%%
EXPERIMENT_NAME
=
'LR_noTx_branch_wise_free_aug_CT_20191027-124913'
DEEP_FEATURES_DIR
=
f
'
{
PATH
}
/experiments/
{
EXPERIMENT_NAME
}
/features'
RADIOMICS_FEATURES_DIR
=
f
'
{
PATH
}
/data'
DATASET
=
'OPBG'
FEATURE_DIR
=
f
'
{
PATH
}
/data/
{
DATASET
}
/features'
RADIO_FEATURES
=
'radiomics_features_A2.csv'
DEEP_FEATURES
=
'transfer_features_A2.csv'
OUT_FILE
=
'merged_features_A2.csv'
RADIO_FEATURES
=
'radiomics_features_F_SVC_Locoregional.csv'
DEEP_FEATURES
=
'features_noTx_F_SVC_Locoregional.csv'
OUT_FILE
=
f
'merged_
{
RADIO_FEATURES
}
_
{
DEEP_FEATURES
}
.csv'
#%%
feat_radio
=
pd
.
read_csv
(
f
'
{
FEATURE_DIR
}
/
{
RADIO_FEATURES
}
'
,
index_col
=
0
)
feat_deep
=
pd
.
read_csv
(
f
'
{
FEATURE_DIR
}
/
{
DEEP_FEATURES
}
'
,
index_col
=
0
)
feat_radio
=
pd
.
read_csv
(
f
'
{
RADIOMICS_
FEATURE
S
_DIR
}
/
{
RADIO_FEATURES
}
'
,
index_col
=
0
)
feat_deep
=
pd
.
read_csv
(
f
'
{
DEEP_
FEATURE
S
_DIR
}
/
{
DEEP_FEATURES
}
'
,
index_col
=
0
)
df
=
pd
.
merge
(
feat_radio
,
feat_deep
,
left_index
=
True
,
right_index
=
True
)
print
(
df
.
shape
)
#%% SAVE
df
.
to_csv
(
f
'
{
FEATURE_DIR
}
/
{
OUT_FILE
}
'
)
df
.
to_csv
(
f
'
{
DEEP_FEATURES_DIR
}
/
{
OUT_FILE
}
'
)
# %%
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment