MCPcopy
hub / github.com/microsoft/qlib / cal_mean_std

Function cal_mean_std

examples/run_all_model.py:53–61  ·  view source on GitHub ↗
(results)

Source from the content-addressed store, hash-verified

51
52# function to calculate the mean and std of a list in the results dictionary
53def cal_mean_std(results) -> dict:
54 mean_std = dict()
55 for fn in results:
56 mean_std[fn] = dict()
57 for metric in results[fn]:
58 mean = statistics.mean(results[fn][metric]) if len(results[fn][metric]) > 1 else results[fn][metric][0]
59 std = statistics.stdev(results[fn][metric]) if len(results[fn][metric]) > 1 else 0
60 mean_std[fn][metric] = [mean, std]
61 return mean_std
62
63
64# function to create the environment ofr an anaconda environment

Callers 1

_collect_resultsMethod · 0.85

Calls 1

meanMethod · 0.45

Tested by

no test coverage detected