(model_data: RasaModelData)
| 25 | |
| 26 | |
| 27 | def test_split_data_by_label(model_data: RasaModelData): |
| 28 | split_model_data = model_data._split_by_label_ids( |
| 29 | model_data.data, model_data.get("label", "ids")[0], np.array([0, 1]) |
| 30 | ) |
| 31 | |
| 32 | assert len(split_model_data) == 2 |
| 33 | for s in split_model_data: |
| 34 | assert len(set(s.get("label", "ids")[0])) == 1 |
| 35 | |
| 36 | for key, attribute_data in split_model_data[0].items(): |
| 37 | for sub_key, features in attribute_data.items(): |
| 38 | assert len(features) == len(model_data.data[key][sub_key]) |
| 39 | assert len(features[0]) == 2 |
| 40 | |
| 41 | |
| 42 | def test_split_data_by_none_label(model_data: RasaModelData): |
nothing calls this directly
no test coverage detected
searching dependent graphs…