Skip to content

Commit

Permalink
Merge pull request #120 from vxld014/updates
Browse files Browse the repository at this point in the history
Deepcopy
  • Loading branch information
maxpumperla authored Dec 5, 2018
2 parents 56a24b4 + 30d4ed3 commit dcc9b42
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions elephas/ml_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import absolute_import, print_function

import numpy as np
import copy
import h5py
import json

Expand Down Expand Up @@ -150,7 +151,7 @@ def _transform(self, df):
"""
output_col = self.getOutputCol()
label_col = self.getLabelCol()
new_schema = df.schema
new_schema = copy.deepcopy(df.schema)
new_schema.add(StructField(output_col, StringType(), True))

rdd = df.rdd.coalesce(1)
Expand All @@ -176,4 +177,4 @@ def load_ml_transformer(file_name):
f = h5py.File(file_name, mode='r')
elephas_conf = json.loads(f.attrs.get('distributed_config'))
config = elephas_conf.get('config')
return ElephasTransformer(**config)
return ElephasTransformer(**config)

0 comments on commit dcc9b42

Please sign in to comment.