Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pystacknet/pystacknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ def __init__(self, models, metric="logloss", folds=3, restacking=False, use_retr
raise Exception("Models has to be a list of sklearn type of models ")
for l in range (len(models)):
if not isinstance(models[l], list):
raise Exception("Each element in the models' list has to be a list . In other words a 2-dimensional list is epected. ")
raise Exception("Each element in the 'models' list has to be a list . In other words a 2-dimensional list is expected. ")
for m in range (len(models[l])):
if not hasattr(models[l][m], 'fit') :
raise Exception("Each model/algorithm needs to implement a 'fit() method ")
raise Exception("Each model/algorithm needs to implement a 'fit()' method ")

if not hasattr(models[l][m], 'predict_proba') and not hasattr(models[l][m], 'predict') and not hasattr(models[l][m], 'transform') :
raise Exception("Each model/algorithm needs to implement at least one of ('predict()','predict_proba()' or 'transform()' ")
Expand Down Expand Up @@ -940,10 +940,10 @@ def __init__(self, models, metric="rmse", folds=3, restacking=False, use_retrain
raise Exception("Models has to be a list of sklearn type of models ")
for l in range (len(models)):
if not isinstance(models[l], list):
raise Exception("Each element in the models' list has to be a list . In other words a 2-dimensional list is epected. ")
raise Exception("Each element in the 'models' list has to be a list . In other words a 2-dimensional list is expected. ")
for m in range (len(models[l])):
if not hasattr(models[l][m], 'fit') :
raise Exception("Each model/algorithm needs to implement a 'fit() method ")
raise Exception("Each model/algorithm needs to implement a 'fit()' method ")

if not hasattr(models[l][m], 'predict_proba') and not hasattr(models[l][m], 'predict') and not hasattr(models[l][m], 'transform') :
raise Exception("Each model/algorithm needs to implement at least one of ('predict()','predict_proba()' or 'transform()' ")
Expand Down