def process_label_logic(currentIndex, input_obj, label_file_buffers, max, min,
                        output_obj, v_scale):
    # Calculate the label value(label the movement percentage input/output)
    labeler = market_data_labeler.y_labeler(output_obj, max, min, v_scale,
                                            const.HSI_IMAGE_HEIGHT)
    is_over_20_pct = int(labeler.isLabelPositive(1, 0.2))
    is_over_40_pct = int(labeler.isLabelPositive(1, 0.4))
    temp_str = str(currentIndex) + ', ' + input_obj.md_date[0] + ', ' + str(
        is_over_20_pct) + ', ' + str(is_over_40_pct) + ', ' + str(
            max) + ', ' + str(min) + ', ' + str(v_scale) + '\n'
    label_file_buffers.append(temp_str)
예제 #2
0
 def test_label_drop_90_pct(self):
     labeler = pkg_ylabel.y_labeler(self.extract_obj, 22125, 22108, 5.65,
                                    const.HSI_IMAGE_HEIGHT)
     is_positive = labeler.isLabelPositive(-1, 0.9)
     nptest.assert_equal(is_positive, False)
예제 #3
0
 def test_label_rise_50_pct(self):
     labeler = pkg_ylabel.y_labeler(self.extract_obj, 22125, 22108, 5.65,
                                    const.HSI_IMAGE_HEIGHT)
     is_positive = labeler.isLabelPositive(1, 0.5)
     nptest.assert_equal(is_positive, True)