test sorting out 'bad' fits
This commit is contained in:
parent
68e7b75768
commit
5f5afd68a9
16
analysis.py
16
analysis.py
@ -26,8 +26,22 @@ def main():
|
||||
# exit(0)
|
||||
# sensitivity_analysis(dir_path, max_models=3)
|
||||
|
||||
behaviour_keys = ["burstiness", "coefficient_of_variation", "serial_correlation",
|
||||
"vector_strength", "f_inf_slope", "f_zero_slope", "f_zero_middle"]
|
||||
|
||||
fits_info = get_fit_info(dir_path)
|
||||
|
||||
for cell in sorted(fits_info.keys()):
|
||||
model_values = fits_info[cell][1]
|
||||
|
||||
if model_values["vector_strength"] < 0.4:
|
||||
del fits_info[cell]
|
||||
print("excluded because of vs")
|
||||
|
||||
elif model_values["f_inf_slope"] / fits_info[cell][2]["f_inf_slope"] > 2:
|
||||
del fits_info[cell]
|
||||
print("f_inf bad")
|
||||
|
||||
errors = calculate_percent_errors(fits_info)
|
||||
create_boxplots(errors)
|
||||
labels, corr_values, corrected_p_values = behaviour_correlations(fits_info, model_values=False)
|
||||
@ -48,7 +62,7 @@ def get_fit_info(folder):
|
||||
for item in os.listdir(folder):
|
||||
cell_folder = os.path.join(folder, item)
|
||||
|
||||
results = get_best_fit(cell_folder, use_comparable_error=True)
|
||||
results = get_best_fit(cell_folder, use_comparable_error=False)
|
||||
cell_behaviour, model_behaviour = results.get_behaviour_values()
|
||||
fits_info[item] = [results.get_final_parameters(), model_behaviour, cell_behaviour]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user