Commit 9794d893 authored by Alessia Marcolini's avatar Alessia Marcolini
Browse files

Better root path handling

parent d1d66c16
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_FEATURES_DIR}/{RADIO_FEATURES}', index_col=0)
feat_deep = pd.read_csv(f'{DEEP_FEATURES_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}')
# %%
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment