Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
375 B
1
Indexable
Never
    def save(self):
        with tempfile.TemporaryDirectory() as tmpdirname:
            self.mapping_df.write.parquet(f'file:{tmpdirname}/string_indexer_df')
            mlflow.log_artifacts(f"{tmpdirname}/string_indexer_df", artifact_path='string_indexer')
            unique_strings = self.mapping_df.count()
            mlflow.log_param("unique_strings", unique_strings)