Skip to content

Commit 0e42c44

Browse files
authored
Merge pull request #161 from sassoftware/1.9.1
v1.9.1
2 parents f401981 + 0d9abb6 commit 0e42c44

19 files changed

+295
-241
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.

examples/data/hmeqModels/H2OMOJOGLM/fileMetadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
},
1414
{
1515
"role": "scoreResource",
16-
"name": "glmfit.pickle"
16+
"name": "glmfit.mojo"
1717
}
1818
]
374 Bytes
Binary file not shown.
-94.1 KB
Binary file not shown.
Binary file not shown.

examples/data/hmeqModels/H2OBinaryGLM/score_glmfit_mojo.py renamed to examples/data/hmeqModels/H2OMOJOGLM/score_glmfit_mojo.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,15 @@
1313

1414
h2o.init()
1515

16-
with gzip.open(Path(settings.pickle_path) / "{model_file_name}", "r") as fileIn, open(Path(settings.pickle_path) / "glmfit.zip", "wb") as fileOut:
17-
shutil.copyfileobj(fileIn, fileOut)
18-
os.chmod(Path(settings.pickle_path) / "glmfit.zip", 0o777)
19-
model = h2o.import_mojo(Path(settings.pickle_path) / "glmfit.zip")
16+
model = h2o.import_mojo(Path(settings.pickle_path))
2017

2118
def score(LOAN, MORTDUE, VALUE, REASON, JOB, YOJ, DEROG, DELINQ, CLAGE, NINQ, CLNO, DEBTINC):
2219
"Output: EM_CLASSIFICATION, EM_EVENTPROBABILITY"
2320

2421
try:
2522
global model
2623
except NameError:
27-
model = h2o.import_mojo(Path(settings.pickle_path) / "glmfit.zip")
24+
model = h2o.import_mojo(Path(settings.pickle_path))
2825

2926
try:
3027
if math.isnan(LOAN):

examples/pzmm_binary_classification_model_import.ipynb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,11 @@
648648
"\n",
649649
"# Serialize the models to a pickle format\n",
650650
"for (mod, prefix, path) in zip(model, model_prefix, zip_folder):\n",
651-
" pzmm.PickleModel.pickle_trained_model(trained_model=mod, model_prefix=prefix, pickle_path=path)"
651+
" pzmm.PickleModel.pickle_trained_model(\n",
652+
" model_prefix=prefix,\n",
653+
" trained_model=mod,\n",
654+
" pickle_path=path\n",
655+
" )"
652656
]
653657
},
654658
{

examples/pzmm_h2o_model_import.ipynb

Lines changed: 106 additions & 132 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)