Skip to content

Commit

Permalink
Add data sample set to model save
Browse files Browse the repository at this point in the history
  • Loading branch information
WarmCyan committed Aug 11, 2023
1 parent c90832c commit 0646fa0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions icat/anchorlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ def _template(self):
background-color: #333333 !important;
}
.delete-button {
margin: 5px;
margin-left: 15px;
margin: 0px;
margin-left: 6px;
color: var(--md-grey-500) !important;
}
.delete-button:hover {
Expand Down
8 changes: 8 additions & 0 deletions icat/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ def save(self, path: str):
# TODO: maybe this isn't necessary?
self.data.active_data.to_pickle(f"{path}/active_data.pkl")

# save the sample set
with open(f"{path}/active_data_sample.json", "w") as outfile:
json.dump(self.data.sample_indices, outfile)

# save the classifier
joblib.dump(self.classifier, f"{path}/classifier.joblib")

Expand Down Expand Up @@ -404,6 +408,10 @@ def load(self, path: str):
# load the active data into the data manager
self.data.set_data(pd.read_pickle(f"{path}/active_data.pkl"))

# load the sample set into the data manager
with open(f"{path}/active_data_sample.json") as infile:
self.data.sample_indices = json.load(infile)

# load the training data
if os.path.exists(f"{path}/training_data.pkl"):
self.training_data = pd.read_pickle(f"{path}/training_data.pkl")
Expand Down

0 comments on commit 0646fa0

Please sign in to comment.