Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cstenkamp committed Dec 28, 2021
1 parent ba036ca commit 54923be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions derive_conceptualspace/util/jsonloadstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import numpy as np
import pandas as pd
from sklearn.manifold._mds import MDS
from sklearn.manifold import MDS, TSNE

from derive_conceptualspace import settings

Expand Down Expand Up @@ -38,7 +38,7 @@ def default(self, obj):
return ["np.ndarray", obj.tolist()]
elif hasattr(obj, "json_serialize"):
return [obj.__class__.__name__, obj.json_serialize()]
elif isinstance(obj, MDS):
elif isinstance(obj, (MDS, TSNE)):
return Struct(**obj.__dict__) #let's return the dict of the MDS such that we can load it from json and its equal
return json.JSONEncoder.default(self, obj)

Expand Down

0 comments on commit 54923be

Please sign in to comment.