Skip to content
Snippets Groups Projects
Commit 92ef1080 authored by Baptiste Bauvin's avatar Baptiste Bauvin
Browse files

Added featrue_ids

parent b37578bd
No related branches found
No related tags found
No related merge requests found
......@@ -64,11 +64,12 @@ class Adaboost(AdaBoostClassifier, BaseMonoviewClassifier):
[step_pred for step_pred in self.staged_predict(X)])
return pred
def get_interpretation(self, directory, base_file_name, y_test,
def get_interpretation(self, directory, base_file_name, y_test, feature_ids,
multi_class=False): # pragma: no cover
interpretString = ""
interpretString += self.get_feature_importance(directory,
base_file_name)
base_file_name,
feature_ids)
interpretString += "\n\n Estimator error | Estimator weight\n"
interpretString += "\n".join(
[str(error) + " | " + str(weight / sum(self.estimator_weights_)) for
......
......@@ -76,14 +76,15 @@ class GradientBoosting(GradientBoostingClassifier, BaseMonoviewClassifier):
[step_pred for step_pred in self.staged_predict(X)])
return pred
def get_interpretation(self, directory, base_file_name, y_test,
def get_interpretation(self, directory, base_file_name, y_test, feature_ids,
multi_class=False):
interpretString = ""
if multi_class:
return interpretString
else:
interpretString += self.get_feature_importance(directory,
base_file_name)
base_file_name,
feature_ids)
step_test_metrics = np.array(
[self.plotted_metric.score(y_test, step_pred) for step_pred in
self.step_predictions])
......
......@@ -34,10 +34,11 @@ class RandomForest(RandomForestClassifier, BaseMonoviewClassifier):
["gini", "entropy"], [random_state]]
self.weird_strings = {}
def get_interpretation(self, directory, base_file_name, y_test,
def get_interpretation(self, directory, base_file_name, y_test, feature_ids,
multiclass=False):
interpret_string = ""
interpret_string += self.get_feature_importance(directory,
base_file_name)
base_file_name,
feature_ids)
return interpret_string
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment