Skip to content

Commit

Permalink
Merge branch 'dev-2.0-alpha' of https://github.com/FederatedAI/FATE i…
Browse files Browse the repository at this point in the history
…nto dev-2.0-alpha
  • Loading branch information
kaideng authored and kaideng committed Jan 9, 2023
2 parents 34bb1f2 + 1d8e1f2 commit 67eeda0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/fate/ml/feature_scale/feature_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ def transform(self, ctx: Context, test_data):
def to_model(self):
return dict(
mean=self._mean.to_json(),
std=self._std.to_json()
mean_dtype=self._mean.dtype.name,
std=self._std.to_json(),
std_dtype=self._std.dtype.name
)

def from_model(self, model):
self._mean = pd.Series(json.loads(model["mean"]))
self._std = pd.Series(json.loads(model["std"]))
self._mean = pd.Series(json.loads(model["mean"]), dtype=model["mean_dtype"])
self._std = pd.Series(json.loads(model["std"]), dtype=model["std_dtype"])

0 comments on commit 67eeda0

Please sign in to comment.