b523b464d8cafe29e352981c1c6df941f205592a,nilmtk/metrics.py,,mean_normalized_error_power,#Any#Any#,109

Before Change


    numerator = {}
    denominator = {}

    for appliance in predicted_power:
        numerator[appliance] = np.sum(np.abs(predicted_power[appliance] -
                                             df_appliances_ground_truth[appliance].values))
        denominator[appliance] = np.sum(
            df_appliances_ground_truth[appliance].values)
        mne[appliance] = numerator[appliance] * 1.0 / denominator[appliance]
    return mne


def rms_error_power(predicted_power, df_appliances_ground_truth):

After Change


    // TODO: need to resample to keep things in step
    mne = {}
    for meter in predictions.submeters():
        ground_truth_meter_identifier = meter.identifier._replace(
            dataset=ground_truth.dataset())
        ground_truth_meter = ground_truth[ground_truth_meter_identifier]
        sections = meter.good_sections()
        sample_period = meter.sample_period()
        period_alias = "{:d}S".format(sample_period)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: nilmtk/nilmtk
Commit Name: b523b464d8cafe29e352981c1c6df941f205592a
Time: 2014-07-09
Author: jack-list@xlk.org.uk
File Name: nilmtk/metrics.py
Class Name:
Method Name: mean_normalized_error_power


Project Name: allenai/allennlp
Commit Name: 0542c5a6be82461e8be569125ab6f43c65f55c39
Time: 2019-03-14
Author: joelgrus@gmail.com
File Name: allennlp/tests/data/token_indexers/ner_tag_indexer_test.py
Class Name: TestNerTagIndexer
Method Name: test_blank_ner_tag


Project Name: allenai/allennlp
Commit Name: 0542c5a6be82461e8be569125ab6f43c65f55c39
Time: 2019-03-14
Author: joelgrus@gmail.com
File Name: allennlp/tests/data/token_indexers/pos_tag_indexer_test.py
Class Name: TestPosTagIndexer
Method Name: test_blank_pos_tag