YerevaNN / mimic3-benchmarks

Python suite to construct benchmark machine learning datasets from the MIMIC-III 💊 clinical database.
https://arxiv.org/abs/1703.07771
MIT License
805 stars 329 forks source link

Project dependencies may have API risk issues #135

Closed PyDeps closed 1 year ago

PyDeps commented 2 years ago

Hi, In mimic3-benchmarks, inappropriate dependency versioning constraints can cause risks.

Below are the dependencies and version constraints that the project is using

Keras==2.1.2
numpy>=1.13.3
scikit-learn==0.18.2
pandas==0.23.4
tqdm

The version constraint == will introduce the risk of dependency conflicts because the scope of dependencies is too strict. The version constraint No Upper Bound and * will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs.

After further analysis, in this project, The version constraint of dependency Keras can be changed to >=2.2.5,<=2.3.1. The version constraint of dependency numpy can be changed to >=1.8.1,<=1.14.0. The version constraint of dependency numpy can be changed to ==1.20.0. The version constraint of dependency numpy can be changed to >=1.20.0,<=1.20.0. The version constraint of dependency scikit-learn can be changed to >=0.17,<=0.17.1. The version constraint of dependency scikit-learn can be changed to >=0.18.2,<=0.19.2. The version constraint of dependency pandas can be changed to >=0.20.0,<=0.22.0. The version constraint of dependency tqdm can be changed to >=4.36.0,<=4.64.0.

The above modification suggestions can reduce the dependency conflicts as much as possible, and introduce the latest version as much as possible without calling Error in the projects.

The invocation of the current project includes all the following methods.

The calling methods from the Keras
keras.backend.sum
keras.layers.Masking
keras.backend.epsilon
keras.backend.constant
keras.layers.LSTM
keras.backend.floatx
keras.layers.merge.Concatenate
keras.backend.backend
keras.callbacks.ModelCheckpoint
keras.callbacks.CSVLogger
keras.layers.wrappers.Bidirectional
keras.backend.ndim
keras.backend.max
keras.layers.Dropout
keras.layers.Dense
keras.backend.expand_dims
keras.layers.wrappers.TimeDistributed
keras.backend.exp
keras.backend.cast
keras.layers.merge.Multiply
The calling methods from the numpy
Reader.__init__
The calling methods from the scikit-learn
sklearn.linear_model.LogisticRegression.predict_proba
sklearn.preprocessing.Imputer.transform
sklearn.metrics.cohen_kappa_score
sklearn.linear_model.LinearRegression.fit
sklearn.metrics.confusion_matrix
Reader.__init__
sklearn.preprocessing.Imputer.fit
sklearn.preprocessing.StandardScaler.fit
sklearn.metrics.precision_recall_curve
sklearn.metrics.auc
sklearn.preprocessing.StandardScaler
sklearn.metrics.roc_auc_score
sklearn.linear_model.LogisticRegression
sklearn.metrics.mean_absolute_error
sklearn.preprocessing.StandardScaler.transform
sklearn.metrics.mean_squared_error
sklearn.linear_model.LogisticRegression.fit
sklearn.preprocessing.Imputer
sklearn.linear_model.LinearRegression
The calling methods from the pandas
json.loads
Reader.__init__
pandas.to_datetime
pandas.isnull
pandas.read_csv
The calling methods from the tqdm
tqdm.tqdm.close
tqdm.tqdm
tqdm.tqdm.update
The calling methods from the all methods
os.path.isfile
diagnoses.drop_duplicates.pivot.fillna.astype.rename
remove_icustays_with_transfers
numpy.stack.append
col.df.unique
intime.episode.add_hours_elpased_to_events.set_index.sort_index.to_csv
float
pX.append
mimic3models.in_hospital_mortality.utils.save_results
numpy.maximum
read_events_table_by_row
los_p.flatten
mimic3benchmark.subject.read_diagnoses
variable.timeseries.notnull
los_M.flatten
mimic3models.parse_utils.parse_partition
stays.DOB.stays.INTIME.subtract.apply
predictions.predictions.np.stack.transpose
keras.backend.max
len
mimic3benchmark.readers.MultitaskReader
keras.layers.Dropout
line.strip
mimic3models.parse_utils.parse_metrics
head.sort
s.re.match.group
numpy.mean
mimic3models.parse_utils.parse_size_coef
y.flatten
events.VALUEUOM.fillna.astype
sklearn.linear_model.LogisticRegression.fit
self.next
rec_dropout.dropout.return_sequences.dim.LSTM
numpy.concatenate.append
clean_fns.items
process_los
read_icustays_table
mimic3models.common_utils.DeepSupervisionDataLoader
ethnicity_series.apply.apply
ValueError
mimic3benchmark.readers.InHospitalMortalityReader.read_example
calculate
mimic3models.parse_utils.parse_ihm_C
events.ICUSTAY_ID.fillna.astype
kv_pairs.pair.pair.index
mimic3benchmark.subject.get_first_valid_from_timeseries
mimic3models.parse_utils.parse_batch_size
stays.groupby.count.reset_index
isinstance
mimic3models.common_utils.create_directory
keras.callbacks.CSVLogger
ethnicity_series.fillna.apply
mimic3models.multitask.utils.BatchGen
random.seed
process_ihm
mimic3models.metrics.get_bin_log
var_ranges.drop_duplicates.rename
mimic3models.preprocessing.Discretizer
os.path.basename
to_write.to_csv
stays.merge.drop_duplicates
DataStats
mimic3models.decompensation.utils.BatchGenDeepSupervision
final_activation.num_classes.Dense.TimeDistributed
self._generator
mimic3models.parse_utils.parse_prefix
pheno_y_true.append
x.split.split
filter_icustays_on_age
mimic3benchmark.readers.LengthOfStayReader.read_example
mimic3models.parse_utils.parse_network.find
los_y_true.append
ret.np.array.repeat.flatten
line.strip.split
sklearn.preprocessing.Imputer
read_and_extract_features
keras.layers.Dense.TimeDistributed
model_module.Network.say_name
get_bin
mimic3models.metrics.get_bin_custom
numpy.std
merged_df.dropna.isnull
self.model.predict
stays.INTIME.subtract
idx.v.apply
codes.COUNT.fillna.astype
mimic3benchmark.subject.get_events_for_stay
rec_dropout.dropout.dim.size_coef.int.LSTM
open.close
stays.DEATHTIME.notnull.astype
open.write
pandas.read_csv.unique
datetime.datetime.strptime
cur_ts.append
mimic3models.parse_utils.parse_network
k.data.append
merge_on_subject
df.isnull.sum
tsfile.readline
tsfile.readline.strip.split
diagnoses.drop_duplicates.pivot.fillna.astype
float.items
mimic3models.keras_utils.PhenotypingMetrics
names.np.array.repeat.flatten
mimic3models.common_utils.sort_and_shuffle
json.load
dt.events.CHARTTIME.apply
process_decomp
numpy.max
mimic3benchmark.readers.PhenotypingReader.read_example
open
read_events_table_and_break_up_by_subject
mimic3models.preprocessing.Discretizer.transform
mimic3models.parse_utils.parse_last_state
mimic3benchmark.readers.DecompensationReader.get_number_of_examples
var_ranges.drop_duplicates.drop_duplicates
keras.backend.cast
diagnoses.merge.groupby
reader.read_next
i.format.df.equals
metadata.variable_column.timeseries.pivot.merge.sort_index.reset_index
pheno_t.reshape
sklearn.linear_model.LinearRegression.fit
model_module.Network.fit
float.df.VALUE.astype.copy
diagnoses.drop_duplicates
ch.find
diagnoses.drop_duplicates.set_index.to_csv
events.HADM_ID.fillna
numpy.int32
NotImplementedError
stays.HADM_ID.unique
mimic3models.decompensation.utils.BatchGen
keras.callbacks.ModelCheckpoint
numpy.timedelta64
keras.layers.LSTM.Bidirectional
str.df.VALUE.astype.copy
keras.layers.wrappers.Bidirectional
predictions.append
pheno_p.reshape
mimic3benchmark.preprocessing.add_hcup_ccs_2015_groups
argparse.ArgumentParser.set_defaults
pandas.read_csv.merge
mimic3benchmark.readers.LengthOfStayReader
keras.layers.Dense
pandas.read_csv.isnull
pandas.isnull
events.VALUE.notnull
subject_id.stays.SUBJECT_ID.stays.sort_values.to_csv
yaml.load.keys
args.itemids_file.dataframe_from_csv.unique
self.model.predict.flatten
mimic3models.common_utils.read_chunk
sklearn.linear_model.LinearRegression.predict
tsfile.readlines
final_activation.num_classes.Dense
numpy.zeros
ts_filename.replace
type
lfile.readlines
names.append
events_df.columns.str.upper
sklearn.metrics.precision_recall_curve
y.np.array.flatten
mimic3models.in_hospital_mortality.utils.load_data
os.chdir
mimic3benchmark.preprocessing.make_phenotype_label_matrix
phenotypes.reindex.reindex
mimic3models.length_of_stay.utils.BatchGen.next
stays.phenotypes.make_phenotype_label_matrix.to_csv
variable_column.events.sort_values
sklearn.preprocessing.StandardScaler
variable.timeseries.notnull.any
mimic3models.metrics.get_estimate_custom
sklearn.metrics.confusion_matrix.astype
mimic3models.parse_utils.parse_dropout
decomp_M.flatten
los_p.reshape
argparse.ArgumentParser.parse_args
self.Slice.super.__init__
sorted
events_df.dropna.merge
write_current_observations
stays_df.isnull.any
diagnoses.drop_duplicates.set_index.sort_values
predictions.np.maximum.flatten.argmax
decomp_y_true.append
sklearn.linear_model.LinearRegression
var_map.ITEMID.astype
listfile.write
listfile.readlines
re.findall
sklearn.metrics.cohen_kappa_score
csv.DictWriter.writerows
json.loads
preprocess_chunk.append
mimic3models.common_utils.add_common_arguments
extract_features_single_episode
stays.DOD.notnull
read_icd_diagnoses_table
pandas.read_csv
argparse.ArgumentParser.parse_known_args
json.dump
history.append
mimic3benchmark.readers.MultitaskReader.get_number_of_examples
mimic3models.keras_utils.MultitaskMetrics
super
mimic3models.metrics.print_metrics_multilabel
softmax
mimic3models.preprocessing.Normalizer._save_params
sys.stderr.write
permute.append
mimic3models.parse_utils.parse_target_repl_coef
model_module.Network.compile
self.GetTimestep.super.__init__
numpy.round
train_listfile.write
get_bin_log
pandas.DataFrame
mimic3benchmark.subject.read_stays
phenotypes.USE_IN_BENCHMARK.phenotypes.loc.drop_duplicates
data.DataFrame.set_index
merge_on_subject_admission
keras.backend.expand_dims
mimic3benchmark.readers.LengthOfStayReader.get_number_of_examples
os.path.dirname
data_gen.next
numpy.concatenate.items
res.group.strip
numpy.median
parser.parse_args._get_kwargs
predictions.np.maximum.flatten
check_decreasing
keras.layers.Input
print_metrics_regression
sklearn.utils.resample
lstm
mimic3models.parse_utils.parse_pheno_C
events_df.isnull.sum
filter_admissions_on_nb_icustays
labels.np.expand_dims.repeat
int.phenotypes.fillna.astype.sort_index
stays.ICUSTAY_ID.unique
labels.append
events.merge
intime.datetime.strptime.deathtime.datetime.strptime.total_seconds
res.group.strip.group
float.df.VALUE.astype.copy.astype
variable_column.variable_column.events.sort_values.drop_duplicates
self._read_timeseries
enumerate
stay_id.episodic_data.index.episodic_data.loc.to_csv
model_module.Network.load_weights
filter
phenotypes.fillna.astype
cur_labels.append
merged_df.dropna.fillna
convert_to_dict
col.df.sort_values.reset_index.sort_values
next
logfile.read
decomp_names.append
pandas.to_datetime
numpy.log
self.data.append
model_module.Network.predict_on_batch
intime.episode.add_hours_elpased_to_events.set_index
events.HADM_ID.fillna.astype
os.path.join
traceback.format_exc
metadata.variable_column.timeseries.pivot.merge.sort_index.reset_index.pivot
numpy.array.find
int.phenotypes.fillna.astype.sort_index.sort_index
mimic3benchmark.preprocessing.map_itemids_to_variables
one_hot
pandas.read_csv.iterrows
self._load_data
main
_collect_attention
imp.load_source.Network
self.calc_metrics
keras.backend.floatx
fn
variable_column.var_map.set_index
los_t.flatten
mimic3models.keras_utils.LengthOfStayMetrics
os.getcwd
platform.python_version
var_ranges.drop_duplicates.set_index
extend_labels
args.load_state.re.match.group
tqdm.tqdm.update
get_range
i.header.find
sklearn.metrics.auc
mimic3benchmark.preprocessing.assemble_episodic_data
numpy.array
fin.read
test_df.merge.equals
events.ICUSTAY_ID.fillna
diagnoses.groupby.count
ethnicity_series.apply.fillna
mimic3benchmark.subject.add_hours_elpased_to_events
events.sort_values.drop_duplicates.set_index
keras.layers.wrappers.TimeDistributed
events_df.dropna.dropna
mimic3benchmark.subject.read_events
fout.write
model_module.Network.fit_generator
numpy.full
argparse.ArgumentParser
keras.backend.sum
merged_df.dropna.sum
mimic3models.parse_utils.parse_depth
np.random.choice
cX.append
pickle.dump
numpy.equal
transform_gender
metadata.variable_column.timeseries.pivot.merge.sort_index
mimic3models.metrics.print_metrics_regression
self.PhenotypingMetrics.super.__init__
outfile.write
mimic3models.parse_utils.parse_los_C
os.listdir
test_df.merge.isnull
discretizer.transform
sklearn.linear_model.LogisticRegression
channels.append
mimic3benchmark.preprocessing.read_itemid_to_variable_map
self.CollectAttetion.super.__init__
f.write
data.DataFrame.set_index.update
preprocess_chunk
print
Exception
numpy.array.append
parser.add_argument
idx.events.VALUE.copy
mimic3benchmark.readers.DecompensationReader.read_example
keras.layers.merge.Multiply
kwargs.keys
numpy.where
stays.merge.groupby
re.search.group
keras.layers.Masking
ihm_y_true.append
mimic3models.feature_extractor.extract_features
numpy.abs
df.VALUEUOM.fillna.apply
col.df.sort_values.reset_index.to_string
transform_ethnicity
Reader.__init__
y.np.expand_dims.repeat
table.lower
data.DataFrame.set_index.merge
numpy.percentile
events.VALUEUOM.fillna
stays_df.columns.str.upper
self.get_number_of_examples
train_data_loader._data.discretizer.transform.split
numpy.zeros.astype
channel_id.prev_values.append
self.Network.super.__init__
pickle.load
set.add
mimic3models.common_utils.extract_features_from_rawdata
clean_fn
var_map.VARIABLE.unique
mimic3models.preprocessing.Normalizer.load_params
phenotypes.reindex.fillna
numpy.sum
numpy.sqrt
mimic3models.keras_utils.ExtendMask
train_reader.read_example.discretizer.transform.split
rec_dropout.dropout.dim.LSTM
sorted.append
tsfile.readline.strip
masks.append
mimic3models.parse_utils.parse_dim
mimic3benchmark.util.dataframe_from_csv
diagnoses.ICD9_CODE.apply
self.normalizer.transform
tqdm.tqdm.close
random.shuffle
merged_df.merged_df.sum
ethnicity_str.replace.split
sklearn.metrics.mean_absolute_error
str.isdigit
imp.load_source
mimic3models.metrics.get_estimate_custom.append
model_module.Network.predict
phenotypes.reindex.pivot
x.find
events.sort_values.drop_duplicates
tensorflow.transpose
tensorflow.gather
set
stays.groupby.count
os.makedirs
mimic3models.preprocessing.Normalizer._feed_data
shutil.copy
zip
decomp_p.flatten
process_ph
mimic3models.keras_utils.LastTimestep
keras.backend.epsilon
sklearn.preprocessing.StandardScaler.fit
events.copy.copy
mimic3models.keras_utils.InHospitalMortalityMetrics
mimic3models.multitask.utils.BatchGen.next
filter_diagnoses_on_stays.to_csv
log.split
numpy.arange
exit
self.discretizer.transform
names.np.array.repeat
self.reader.random_shuffle
self.MultitaskMetrics.super.__init__
add_inhospital_mortality_to_icustays
hashlib.md5
sklearn.metrics.roc_auc_score
os.rename
stays.merge.merge
sklearn.metrics.mean_squared_error
self.read_example
pandas.Series
los_names.append
mimic3benchmark.readers.MultitaskReader.read_example
mimic3models.length_of_stay.utils.BatchGenDeepSupervision
numpy.stack
ihm_names.append
dict
add_inunit_mortality_to_icustays
mimic3models.length_of_stay.utils.BatchGen
re.match
mimic3models.parse_utils.parse_task
min
dropout.Dropout
rec_dropout.dropout.return_sequences.dim.size_coef.int.LSTM
intime.episode.add_hours_elpased_to_events.set_index.sort_index
break_up_diagnoses_by_subject
numpy.hstack
ret.append
events.copy.sort_values
events_df.dropna.isnull
self.LengthOfStayMetrics.super.__init__
sklearn.preprocessing.Imputer.fit
list
tqdm.tqdm
self.model.predict.reshape
keras.backend.constant
codes.COUNT.fillna
keras.backend.backend
subject_id.diagnoses.SUBJECT_ID.diagnoses.sort_values
col.df.apply
df.to_string.encode
stays.DEATHTIME.notnull
process_partition
outputs.np.array.flatten
log.find
self._load_per_patient_data
stays.merge.to_csv
merged_df.isnull.sum
add_age_to_icustays
permute
subject_id.stays.SUBJECT_ID.stays.sort_values
sklearn.preprocessing.StandardScaler.transform
sorted.add
subject_id.diagnoses.SUBJECT_ID.diagnoses.sort_values.to_csv
mimic3models.parse_utils.parse_decomp_C
mimic3benchmark.util.dataframe_from_csv.sort_values
col.df.sort_values.reset_index
get_bin_custom
read_admissions_table
stays.SUBJECT_ID.unique
mimic3benchmark.readers.PhenotypingReader
mimic3benchmark.subject.convert_events_to_timeseries
diagnoses.drop_duplicates.pivot
table.upper
sklearn.preprocessing.Imputer.transform
gender_series.fillna
self._preprocess_single
sklearn.metrics.confusion_matrix
break_up_stays_by_subject
threading.Lock
model.predict_on_batch.reshape
parser.set_defaults
table1.merge
reader.get_number_of_examples
normalizer.transform
keras.layers.LSTM
mimic3benchmark.preprocessing.clean_events
model.predict_on_batch.flatten
stays.ICUSTAY_ID.sort_values
diagnoses.merge.astype
numpy.concatenate
keras.backend.ndim
variable_column.var_map.set_index.rename
channel.self._possible_values.index
mimic3models.preprocessing.Normalizer
pheno_y.np.expand_dims.repeat
csv.DictWriter
ts.append
mimic3models.decompensation.utils.save_results
var_map.COUNT.astype
self.data.items
ethnicity_str.replace
mimic3models.keras_utils.Slice
df.VALUE.copy
os.path.isdir
join.append
ihm_y.np.expand_dims.repeat
merged_df.dropna.dropna
int
dropout.rec_dropout.dim.LSTM
mimic3models.parse_utils.parse_epoch
numpy.expand_dims
self.ExtendMask.super.__init__
fn.dataframe_from_csv.fillna.astype
var_ranges.drop_duplicates.notnull
sklearn.linear_model.LogisticRegression.predict_proba
range
s.lower
x.flatten
mimic3models.common_utils.pad_zeros
diagnoses.drop_duplicates.set_index
y_true.append
mimic3benchmark.readers.DecompensationReader
keras.layers.merge.Concatenate
mimic3models.phenotyping.utils.BatchGen
df.VALUE.astype
decomp_t.flatten
mimic3models.parse_utils.parse_deep_supervision
self.DecompensationMetrics.super.__init__
diagnoses.merge.drop_duplicates
os.mkdir
df.VALUEUOM.fillna
mimic3models.keras_utils.GetTimestep
str
mimic3models.metrics.print_metrics_multilabel.items
map
ihm_p.flatten
fin.read.find
os.walk
gender_series.fillna.apply
float.df.VALUE.astype.copy.apply
model_module.Network.summary
df.MIMIC_LABEL.apply
max
variable_column.timeseries.pivot.merge
filter_diagnoses_on_stays
diagnoses.drop_duplicates.pivot.fillna
os.path.exists
fn.dataframe_from_csv.fillna
codes.sort_values.reset_index
mimic3models.metrics.print_metrics_custom_bins
keras.backend.exp
data_stats.curr_obs.append
ihm_M.flatten
format
line.split
read_patients_table
c.replace
mimic3models.phenotyping.utils.save_results
numpy.argmax
numpy.array.flatten
process_single
diagnoses.merge.merge
write
df_str.hashlib.md5.hexdigest
mimic3benchmark.readers.InHospitalMortalityReader
ihm_pos.GetTimestep
val_listfile.write
extract_diagnosis_labels
m.results.append
mimic3models.metrics.get_estimate_log
inputs.append
count_icd_codes
file.split
ethnicity_str.replace.split.split
self.InHospitalMortalityMetrics.super.__init__
join
mimic3models.keras_utils.DecompensationMetrics
diagnoses.SUBJECT_ID.unique
mimic3models.length_of_stay.utils.save_results
ret.np.array.repeat
csv.DictReader
ts_file.readlines
yaml.load
argparse.ArgumentParser.add_argument
var_ranges.notnull.all
mean_absolute_percentage_error
line.strip.split.append
channel_info_file.read
outputs.append
ys.append
mimic3models.metrics.print_metrics_binary
ch.Slice
ihm_t.flatten
re.search
mimic3models.metrics.print_metrics_log_bins
numpy.argsort

@developer Could please help me check this issue? May I pull a request to fix it? Thank you very much.

hrayrhar commented 1 year ago

Thanks for raising the issue. I have specified the requirements clearly and checked that they are not contradicting each other (assuming Python 3.7). Also, added some notes on installation.