Skip to content

Commit f86f501

Browse files
authored
Improvements in the interface (#92)
* Make improvements in the interface * Fix LimeResult reference * Split line and rename test file * Revert string changes
1 parent 6c71275 commit f86f501

20 files changed

+107
-98
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/__tests__/components/explanation/post_hoc.test.js renamed to src/__tests__/components/explanation/LimeResult.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React from 'react';
22
import {shallow} from 'enzyme';
3-
import PostHocExplanation from '../../../components/explanation/post_hoc';
3+
import LimeResult from '../../../components/explanation/LimeResult';
44
import HorizontalBarChartCard from '../../../components/chart/HorizontalBarChartCard';
55
import {parseLimeResult} from '../../../util/dataReducers';
66
import {limeList} from '../../../../stories/Explanation';
77

88
describe('Lime result', () => {
99
it('renders without data', () => {
10-
const element = shallow(<PostHocExplanation
10+
const element = shallow(<LimeResult
1111
jobs={[]}
1212
isLimeValuesLoaded={true}
1313
traceId={1}
@@ -17,7 +17,7 @@ describe('Lime result', () => {
1717
});
1818

1919
it('renders with data', () => {
20-
const element = shallow(<PostHocExplanation
20+
const element = shallow(<LimeResult
2121
jobs={[]}
2222
isLimeValuesLoaded={true}
2323
traceId={1}

src/components/WalkThrough.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ class WalkThrough extends PureComponent {
3232
</div>
3333
</CardTitle>
3434
<CardText>
35-
<p>Nirdizati Research is a <span onDoubleClick={this.otherClick.bind(this)}>tool</span> that aims at
36-
supporting
35+
<p>Nirdizati Research is a <span onDoubleClick={this.otherClick.bind(this)}>tool</span> that aims to
36+
support
3737
expert users in finding the best predictive models suitable for specific datasets and prediction
3838
problems. The
3939
predictive models can then be used to provide predictions at runtime on incomplete traces or streams
4040
of
4141
events.</p>
4242

4343
<p>The tool offers a wide selection of features ranging from event log preprocessing options to
44-
hyperparmeter
44+
hyperparameter
4545
optimization as well as runtime feedback to the user.</p>
4646

47-
<p>The standard procedure to be followed to use the application is summarized in the steps below.</p>
47+
<p>The standard procedure to use the application is summarized in the steps below.</p>
4848
{rotate(this.state.other)}
4949
<div className="md-grid">
5050
<List className="md-cell md-cell--12 md-cell--8-tablet">
@@ -125,7 +125,7 @@ class WalkThrough extends PureComponent {
125125
button={<Button flat primary href={'/#/explanation'}
126126
iconEl={<FontIcon>work</FontIcon>}>Explanation</Button>}
127127
title="Explanation"
128-
text="Explanation"
128+
text="See explanations for model predictions"
129129
threeLines
130130
/> }
131131
</List>

src/components/chart/HorizontalBarChartCard.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ class HorizontalBarChartCard extends React.Component {
4747
xaxis: {
4848
min: -1,
4949
max: 1,
50+
title: {
51+
text: 'Correlation'
52+
},
5053
labels: {
5154
show: true
5255
},

src/components/chart/PredictionLineChart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class PredictionLineChart extends React.Component {
3636
max: this.props.data.length +1,
3737
tickAmount: this.props.data.length +1,
3838
title: {
39-
text: 'Feature'
39+
text: 'Prefix length'
4040
}
4141
},
4242
yaxis: {

src/components/chart/ScatterChartCard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const ScatterChartCard = props => {
4040
max: props.data.length + 1,
4141
tickAmount: props.data.length + 1,
4242
title: {
43-
text: 'Time',
43+
text: 'Prefix length',
4444
},
4545
}
4646
}

src/components/chart/VerticalBarChartCard.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import ReactApexChart from 'react-apexcharts';
44

5-
class HorizontalBarChartCard extends React.Component {
5+
class VerticalBarChartCard extends React.Component {
66
constructor(props) {
77
super(props);
88
}
@@ -40,7 +40,7 @@ class HorizontalBarChartCard extends React.Component {
4040
}
4141
},
4242
title: {
43-
text: 'Count',
43+
text: 'Number of traces',
4444
},
4545
}, {
4646
labels: {
@@ -50,7 +50,7 @@ class HorizontalBarChartCard extends React.Component {
5050
},
5151
opposite: true,
5252
title: {
53-
text: 'Label: 1 means False, 2 means True'
53+
text: 'Label'
5454
}
5555
}],
5656
xaxis: {
@@ -68,7 +68,7 @@ class HorizontalBarChartCard extends React.Component {
6868
},
6969
series: [
7070
{
71-
name: 'Count',
71+
name: 'Feature value',
7272
type: 'column',
7373
data: this.props.count
7474
},
@@ -92,9 +92,9 @@ class HorizontalBarChartCard extends React.Component {
9292
}
9393
}
9494

95-
HorizontalBarChartCard.propTypes = {
95+
VerticalBarChartCard.propTypes = {
9696
data: PropTypes.any.isRequired,
9797
labels: PropTypes.any.isRequired,
9898
count: PropTypes.any.isRequired
9999
};
100-
export default HorizontalBarChartCard;
100+
export default VerticalBarChartCard;

src/components/explanation/ICEResult.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ class ICEResult extends PureComponent {
3333
<Card className="md-block-centered">
3434
<CardTitle title="ICE Result for a single attribute: "></CardTitle>
3535
<CardText>
36-
<h4>Select the feature for ICE, LIME and SHAP</h4>
36+
<p>ICE plot shows correlation of each feature with the label values (1 = False, 2 = True).</p>
37+
<h4>Select a feature for ICE, LIME and SHAP</h4>
3738
{this.getTraceSelector()}
3839
</CardText>
3940
{!this.props.isIceValuesLoaded ? <CircularProgress id="query-indeterminate-progress"/> : null}

src/components/explanation/post_hoc.js renamed to src/components/explanation/LimeResult.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ import React from 'react';
55
import {Card, CardText, CardTitle} from 'react-md/lib/Cards/index';
66
import PropTypes from 'prop-types';
77
import {jobPropType} from '../../propTypes';
8-
import HorizontalBarChartCard from '../../components/chart/HorizontalBarChartCard';
8+
import HorizontalBarChartCard from '../chart/HorizontalBarChartCard';
99
import CircularProgress from 'react-md/lib/Progress/CircularProgress';
1010

11-
const PostHocExplanation = (props) => {
11+
const LimeResult = (props) => {
1212
const horizontalBarChart = <HorizontalBarChartCard
1313
data = {props.limeValueList.values}
1414
labels = {props.limeValueList.labels}/>;
1515
return <Card className="md-cell md-cell--12">
1616
<CardTitle title="LIME Result for a single trace"/>
1717
<CardText>
18-
{props.traceId != '' && props.jobId != '' ?
18+
<p>LIME shows correlation of each feature with the prediction.</p>
19+
{props.traceId != '' && props.jobId != '' ?
1920
'Lime result with trace id: '+ props.traceId
2021
+' and job id: '+ props.jobId + ' and prefix: ' + props.attributeId: ''}
2122
</CardText>
@@ -30,7 +31,7 @@ const PostHocExplanation = (props) => {
3031
};
3132

3233

33-
PostHocExplanation.propTypes = {
34+
LimeResult.propTypes = {
3435
jobs: PropTypes.arrayOf(jobPropType).isRequired,
3536
limeValueList: PropTypes.any.isRequired,
3637
isLimeValuesLoaded: PropTypes.bool.isRequired,
@@ -40,4 +41,4 @@ PostHocExplanation.propTypes = {
4041
attributeId: PropTypes.any
4142

4243
};
43-
export default PostHocExplanation;
44+
export default LimeResult;

src/components/explanation/ShapResult.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ const ShapResult = (props) => {
1515
return <Card className="md-cell md-cell--12">
1616
<CardTitle title="SHAP Result for a single trace"/>
1717
<CardText>
18-
{props.traceId != '' && props.jobId != '' ?
18+
<p>SHAP shows correlation of each feature with the prediction.</p>
19+
{props.traceId != '' && props.jobId != '' ?
1920
'Shap result with trace id: '+ props.traceId
2021
+', job id: '+ props.jobId + ' and prefix: ' + props.attributeId: ''}
2122
</CardText>

0 commit comments

Comments
 (0)