FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit fc7baaac authored by M.D. Driver's avatar M.D. Driver
Browse files

continued working on functions.

parent 3f89efee
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,6 @@ LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(logging.WARN)
def get_total_by_fit_order(best_order_dict):
"""This returns a tuple containing the order, and also the number of
occurances where the corresponding order provided the best fit.
......@@ -24,7 +23,33 @@ def get_total_by_fit_order(best_order_dict):
order_tuple = tuple(sorted(best_order_dict.keys()))
number_by_order = tuple([len(best_order_dict[order]) for order in order_tuple])
return (order_tuple, number_by_order)
def extract_lists_by_order_of_alt_metric(solvent_id_list, solvent_ids_by_order):
"""This returns a dictionary where the solvent IDs are sorted based on the
best order from the alternate metric.
"""
solvent_id_alt_metric = {}
for order in solvent_ids_by_order.keys():
metric_ids_for_order = []
for solvent_id in solvent_id_list:
if solvent_id in solvent_ids_by_order[order]:
metric_ids_for_order.append(solvent_id)
solvent_id_alt_metric[order] = metric_ids_for_order
return solvent_id_alt_metric
def get_solvent_id_by_order(best_order_dict):
"""This gets the values from the best order dict and returns lists of
solvent IDs group by the order of the polynomial that gives the best fit.
"""
solvent_ids_by_order = {}
for order in best_order_dict.keys():
solvent_ids_by_order[order] = get_solvent_id(best_order_dict[order])
return solvent_ids_by_order
def get_solvent_id(order_info_list):
"""This gets the values from the order info list about which solvents are in this set.
"""
return [order_info_list[i][0] for i in range(len(order_info_list))]
def get_best_poly_fit_rmse(polynomial_dict_by_solvent_id):
"""This returns a dict with tuples containing the information.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment