diff --git a/data_retriever.json b/data_retriever.json index c85d663bd1b15502c50c4ebe766f77282b3770b5..5a1a78bbb95fd8c141fa5c95ee4c998e6c7463ae 100644 --- a/data_retriever.json +++ b/data_retriever.json @@ -16,7 +16,6 @@ "solvers" : [], "xtypes" : { "AXp": "Abductive Explanation", "CXp": "Contrastive explanation"} - }, { "ml_type" : "RandomForest", diff --git a/pages/application/RandomForest/RandomForestComponent.py b/pages/application/RandomForest/RandomForestComponent.py index c02c75ec6520c8bd14e4236ff7c5ceda620dcf43..97deaeec675ef07998d98e35e46b8e386b711df5 100644 --- a/pages/application/RandomForest/RandomForestComponent.py +++ b/pages/application/RandomForest/RandomForestComponent.py @@ -31,13 +31,10 @@ class RandomForestComponent: # Conversion model options = {} if info is not None and '.csv' in type_info: - self.data = Dataset(info) - self.data.mapping_features() - options["n_classes"] = self.data.num_class - options["feature_names"] = self.data.feature_names - options["n_features"] = self.data.nb_features - if isinstance(model, RandomForestClassifier) or isinstance(model, VotingClassifier)\ + if isinstance(model, RandomForestClassifier) or isinstance(model, VotingClassifier) \ or isinstance(model, xrf.rndmforest.RF2001): + self.data = Dataset(info) + self.data.mapping_features() self.random_forest = XRF(model, self.data) elif isinstance(model, XGBRFClassifier): self.random_forest = XGBRandomForest(options, from_model=model) @@ -70,9 +67,9 @@ class RandomForestComponent: self.network = html.Div([]) # Creating a clean and nice text component - compt=0 + compt = 0 for sample_expl in explanation_result: - compt+=1 + compt += 1 self.explanation.append(html.H4("Sample{0} : \n".format(compt))) for k in sample_expl.keys(): self.explanation.append(html.H5(k))