Add version info to Reports

This commit is contained in:
2021-12-17 13:21:35 +01:00
parent 83f2fb37d1
commit cc14d338f8
2 changed files with 6 additions and 2 deletions

View File

@@ -208,6 +208,7 @@ class Experiment:
shuffle=True, random_state=random_state, n_splits=self.folds
)
clf = self._build_classifier(random_state, hyperparameters)
self.version = clf.version() if hasattr(clf, "version") else "-"
with warnings.catch_warnings():
warnings.filterwarnings("ignore")
res = cross_validate(
@@ -248,6 +249,7 @@ class Experiment:
output = {}
output["score_name"] = self.score_name
output["model"] = self.model_name
output["version"] = self.version
output["stratified"] = self.stratified
output["folds"] = self.folds
output["date"] = self.date

View File

@@ -136,7 +136,8 @@ class Report(BaseReport):
self._compare_totals = {}
self.header_line("*")
self.header_line(
f" Report {self.data['model']} with {self.data['folds']} Folds "
f" Report {self.data['model']} ver. {self.data['version']}"
f" with {self.data['folds']} Folds "
f"cross validation and {len(self.data['seeds'])} random seeds"
)
self.header_line(
@@ -262,7 +263,8 @@ class Excel(BaseReport):
self.sheet.write(
0,
0,
f" Report {self.data['model']} with {self.data['folds']} Folds "
f" Report {self.data['model']} ver. {self.data['version']}"
f" with {self.data['folds']} Folds "
f"cross validation and {len(self.data['seeds'])} random seeds",
header,
)