Get signature of RasaModelData. Signature stores the shape and whether features are sparse or not for every key. Returns: A dictionary of key and sub-key to a list of feature signatures (same structure as the data attribute).
(
self, data: Optional[Data] = None
)
| 662 | return self._convert_train_test_split(output_values, solo_values) |
| 663 | |
| 664 | def get_signature( |
| 665 | self, data: Optional[Data] = None |
| 666 | ) -> Dict[Text, Dict[Text, List[FeatureSignature]]]: |
| 667 | """Get signature of RasaModelData. |
| 668 | |
| 669 | Signature stores the shape and whether features are sparse or not for every key. |
| 670 | |
| 671 | Returns: |
| 672 | A dictionary of key and sub-key to a list of feature signatures |
| 673 | (same structure as the data attribute). |
| 674 | """ |
| 675 | if not data: |
| 676 | data = self.data |
| 677 | |
| 678 | return { |
| 679 | key: { |
| 680 | sub_key: [ |
| 681 | FeatureSignature(f.is_sparse, f.units, f.number_of_dimensions) |
| 682 | for f in features |
| 683 | ] |
| 684 | for sub_key, features in attribute_data.items() |
| 685 | } |
| 686 | for key, attribute_data in data.items() |
| 687 | } |
| 688 | |
| 689 | def shuffled_data(self, data: Data) -> Data: |
| 690 | """Shuffle model data. |