def test_caltrack_hourly_fit_feature_processor( segmented_data, occupancy_lookup, occupied_temperature_bins, unoccupied_temperature_bins, ): result = caltrack_hourly_fit_feature_processor( "dec-jan-feb-weighted", segmented_data, occupancy_lookup, occupied_temperature_bins, unoccupied_temperature_bins, ) assert list(result.columns) == [ "meter_value", "hour_of_week", "bin_0_occupied", "bin_1_occupied", "bin_2_occupied", "bin_3_occupied", "bin_0_unoccupied", "bin_1_unoccupied", "bin_2_unoccupied", "weight", ] assert result.shape == (24, 10) assert round(result.sum().sum(), 2) == 5916.0
def segmented_design_matrices(segmented_data, occupancy_lookup, temperature_bins): return { "dec-jan-feb-weighted": caltrack_hourly_fit_feature_processor("dec-jan-feb-weighted", segmented_data, occupancy_lookup, temperature_bins) }
def segmented_design_matrices_nans( segmented_data_nans, occupancy_lookup_nans, temperature_bins_nans ): return { "dec-jan-feb-weighted": caltrack_hourly_fit_feature_processor( "dec-jan-feb-weighted", segmented_data_nans, occupancy_lookup_nans, temperature_bins_nans, ), "apr-may-jun-weighted": caltrack_hourly_fit_feature_processor( "apr-may-jun-weighted", segmented_data_nans, occupancy_lookup_nans, temperature_bins_nans, ), }
def segmented_design_matrices_single_mode( segmented_data, occupancy_lookup_zeroes, occupied_temperature_bins, unoccupied_temperature_bins, ): return { "dec-jan-feb-weighted": caltrack_hourly_fit_feature_processor( "dec-jan-feb-weighted", segmented_data, occupancy_lookup_zeroes, occupied_temperature_bins, unoccupied_temperature_bins, ) }
def segmented_design_matrices_empty_models( segmented_data, occupancy_lookup, occupied_temperature_bins, unoccupied_temperature_bins, ): return { "dec-jan-feb-weighted": caltrack_hourly_fit_feature_processor( "dec-jan-feb-weighted", segmented_data[:0], occupancy_lookup, occupied_temperature_bins, unoccupied_temperature_bins, ) }
def test_caltrack_hourly_fit_feature_processor( segmented_data, occupancy_lookup, temperature_bins ): result = caltrack_hourly_fit_feature_processor( "dec-jan-feb-weighted", segmented_data, occupancy_lookup, temperature_bins ) assert list(result.columns) == [ "meter_value", "hour_of_week", "occupancy", "bin_0", "bin_1", "bin_2", "bin_3", "weight", ] assert result.shape == (24, 8) assert round(result.sum().sum(), 2) == 5928.0