if feature_indices is not None:
            w = SparseVector()
            for index in self.weights:
                w[feature_indices.get_label_name(index)] = self.weights[index]
            w.save(f)