Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
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
41 changes: 0 additions & 41 deletions src/python/nimbusml/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2409,54 +2409,13 @@ def summary(self, verbose=0, **params):
self._run_time = time.time() - start_time
raise e

self._validate_model_summary(summary_data)
self.model_summary = summary_data

# stop the clock
self._run_time = time.time() - start_time
self._write_csv_time = graph._write_csv_time
return self.model_summary

@trace
def _validate_model_summary(self, model_summary):
"""
Validates model summary has correct format

:param model_summary: model summary dataframes

"""
if not isinstance(model_summary, (DataFrame)):
raise TypeError(
"Unexpected type {0} for model_summary, type DataFrame "
"is expected ".format(
type(model_summary)))

col_names = [
'Bias',
'ClassNames',
'Coefficients',
'PredictorName',
'Summary',
'VectorName'
]

col_name_prefixes = [
'Weights',
'Gains',
'Support vectors.',
'VectorData'
]

for col in model_summary.columns:
if col in col_names:
pass
elif any([col.startswith(pre) for pre in col_name_prefixes]):
pass
else:
raise TypeError(
"Unsupported '{0}' column is in model_summary".format(
col))

@trace
def save_model(self, dst):
"""
Expand Down
23 changes: 9 additions & 14 deletions src/python/nimbusml/tests/model_summary/test_model_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,20 @@
OrdinaryLeastSquaresRegressor(),
PoissonRegressionRegressor(),
OneVsRestClassifier(FastLinearBinaryClassifier()),
LightGbmClassifier(),
GamRegressor(),
GamBinaryClassifier(),
PcaAnomalyDetector(),
FactorizationMachineBinaryClassifier(),
KMeansPlusPlus(),
NaiveBayesClassifier()

# Skipping these tests since they are throwing the following error:
# *** System.NotSupportedException: 'Column has variable length
# vector: CategoricalSplitFeatures. Not supported in python.
# Drop column before sending to Python
#FastForestBinaryClassifier(),
#FastForestRegressor(),
#FastTreesBinaryClassifier(),
#FastTreesRegressor(),
#FastTreesTweedieRegressor(),
#LightGbmRegressor(),
#LightGbmBinaryClassifier(),
NaiveBayesClassifier(),
FastForestBinaryClassifier(number_of_trees=2),
FastForestRegressor(number_of_trees=2),
FastTreesBinaryClassifier(number_of_trees=2),
FastTreesRegressor(number_of_trees=2),
FastTreesTweedieRegressor(number_of_trees=2),
LightGbmRegressor(number_of_iterations=2),
LightGbmClassifier(),
LightGbmBinaryClassifier(number_of_iterations=2)
]

learners_not_supported = [
Expand Down