Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Explanation Interface
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
S4XAI
Explanation Interface
Commits
be7f6d7c
There was an error fetching the commit references. Please try again later.
Commit
be7f6d7c
authored
2 years ago
by
Matthieu BELLUCCI
Browse files
Options
Downloads
Patches
Plain Diff
Added TextExplanation component
parent
2ab34b4c
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Prediction.js
+20
-11
20 additions, 11 deletions
src/Prediction.js
with
20 additions
and
11 deletions
src/Prediction.js
+
20
−
11
View file @
be7f6d7c
...
@@ -2,13 +2,28 @@ import { render } from '@testing-library/react';
...
@@ -2,13 +2,28 @@ import { render } from '@testing-library/react';
import
'
./Prediction.css
'
;
import
'
./Prediction.css
'
;
import
BarChart
from
'
./BarChart
'
;
import
BarChart
from
'
./BarChart
'
;
import
PredictionTab
from
'
./Tabs
'
;
import
PredictionTab
from
'
./Tabs
'
;
function
TextExplanation
(
props
)
{
const
isConsistent
=
props
.
data
.
isConsistent
;
const
predictedClass
=
props
.
data
.
predictedClass
;
const
predictionColor
=
isConsistent
?
"
green
"
:
"
red
"
;
return
(
<
div
className
=
"
Label
"
>
<
h1
style
=
{{
color
:
predictionColor
}}
>
{
predictedClass
}
<
/h1
>
<
p
>
The
model
saw
a
{
predictedClass
}
and
it
is
{
isConsistent
?
"
consistent
"
:
"
not consistent
"
}
with
the
expert
knowledge
.
<
/p
>
<
p
>
ADD
PROPERTIES
EXPLANATIONS
<
/p
>
<
/div
>
)
}
function
Prediction
(
props
)
{
function
Prediction
(
props
)
{
console
.
log
(
props
.
data
);
const
bar
=
<
BarChart
data
=
{
props
.
arr
}
barColour
=
"
#AAA
"
/>
const
properties
=
Object
.
entries
(
props
.
data
.
prediction
.
properties
);
const
properties
=
Object
.
entries
(
props
.
data
.
prediction
.
properties
);
console
.
log
(
properties
[
0
][
1
])
const
tabList
=
properties
.
map
(
function
(
x
)
{
return
{
name
:
x
[
0
],
content
:
<
BarChart
data
=
{
x
[
1
]}
/>};}
)
;
const
tabList
=
properties
.
map
(
function
(
x
)
{
return
{
name
:
x
[
0
],
content
:
<
BarChart
data
=
{
x
[
1
]}
/>};}
)
;
//return (tabList[1][0]["content"]);
const
color
=
"
green
"
;
return
(
return
(
<
div
className
=
"
Prediction
"
>
<
div
className
=
"
Prediction
"
>
...
@@ -19,13 +34,7 @@ function Prediction(props) {
...
@@ -19,13 +34,7 @@ function Prediction(props) {
alt
=
{
props
.
label
}
alt
=
{
props
.
label
}
/
>
/
>
<
/div
>
<
/div
>
<
div
className
=
"
Label
"
>
<
TextExplanation
data
=
{
props
.
data
.
prediction
}
/
>
<
h1
style
=
{{
color
:
color
}}
>
{
props
.
data
.
prediction
.
predicted_class
}
<
/h1
>
<
p
>
The
model
saw
a
PREDICTED_CLASS
and
it
is
CONSISTENCY
with
the
expert
knowledge
.
-----------------
----------------
----------------------
-------------------
<
/p
>
<
/div
>
<
/div
>
<
/div
>
<
div
className
=
"
LowerPrediction
"
>
<
div
className
=
"
LowerPrediction
"
>
<
PredictionTab
tabList
=
{
tabList
}
/
>
<
PredictionTab
tabList
=
{
tabList
}
/
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment