Skip to content
Snippets Groups Projects
Commit 367face6 authored by Caroline DE POURTALES's avatar Caroline DE POURTALES
Browse files

update

parent d00ad854
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
"solvers" : [], "solvers" : [],
"xtypes" : { "xtypes" : {
"AXp": "Abductive Explanation", "CXp": "Contrastive explanation"} "AXp": "Abductive Explanation", "CXp": "Contrastive explanation"}
}, },
{ {
"ml_type" : "RandomForest", "ml_type" : "RandomForest",
......
...@@ -31,13 +31,10 @@ class RandomForestComponent: ...@@ -31,13 +31,10 @@ class RandomForestComponent:
# Conversion model # Conversion model
options = {} options = {}
if info is not None and '.csv' in type_info: if info is not None and '.csv' in type_info:
self.data = Dataset(info) if isinstance(model, RandomForestClassifier) or isinstance(model, VotingClassifier) \
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)\
or isinstance(model, xrf.rndmforest.RF2001): or isinstance(model, xrf.rndmforest.RF2001):
self.data = Dataset(info)
self.data.mapping_features()
self.random_forest = XRF(model, self.data) self.random_forest = XRF(model, self.data)
elif isinstance(model, XGBRFClassifier): elif isinstance(model, XGBRFClassifier):
self.random_forest = XGBRandomForest(options, from_model=model) self.random_forest = XGBRandomForest(options, from_model=model)
...@@ -70,9 +67,9 @@ class RandomForestComponent: ...@@ -70,9 +67,9 @@ class RandomForestComponent:
self.network = html.Div([]) self.network = html.Div([])
# Creating a clean and nice text component # Creating a clean and nice text component
compt=0 compt = 0
for sample_expl in explanation_result: for sample_expl in explanation_result:
compt+=1 compt += 1
self.explanation.append(html.H4("Sample{0} : \n".format(compt))) self.explanation.append(html.H4("Sample{0} : \n".format(compt)))
for k in sample_expl.keys(): for k in sample_expl.keys():
self.explanation.append(html.H5(k)) self.explanation.append(html.H5(k))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment