Skip to content

Commit

Permalink
[ML] DF Analytics Results: adds link to docs (elastic#54189)
Browse files Browse the repository at this point in the history
* add doc links to evaluate panel for analytics jobs

* fix confusion matrix dataGrid label

* internationalize link text
  • Loading branch information
alvarezmelissa87 committed Jan 8, 2020
1 parent 1da8cbd commit aefdd29
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import React, { FC, useState, useEffect, Fragment } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import {
EuiButtonEmpty,
EuiDataGrid,
EuiFlexGroup,
EuiFlexItem,
Expand All @@ -18,6 +19,7 @@ import {
EuiText,
EuiTitle,
} from '@elastic/eui';
import { metadata } from 'ui/metadata';
import { ErrorCallout } from '../error_callout';
import {
getDependentVar,
Expand Down Expand Up @@ -243,7 +245,7 @@ export const EvaluatePanel: FC<Props> = ({ jobConfig, jobStatus, searchQuery })
<EuiPanel style={{ width: `${panelWidth}px` }}>
<EuiFlexGroup direction="column" gutterSize="s">
<EuiFlexItem>
<EuiFlexGroup gutterSize="s">
<EuiFlexGroup alignItems="center" justifyContent="spaceBetween">
<EuiFlexItem grow={false}>
<EuiTitle size="xs">
<span>
Expand All @@ -260,6 +262,25 @@ export const EvaluatePanel: FC<Props> = ({ jobConfig, jobStatus, searchQuery })
<EuiFlexItem grow={false}>
<span>{getTaskStateBadge(jobStatus)}</span>
</EuiFlexItem>
<EuiFlexItem>
<EuiSpacer />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonEmpty
target="_blank"
iconType="help"
iconSide="left"
color="primary"
href={`https://www.elastic.co/guide/en/machine-learning/${metadata.branch}/ml-dfanalytics-evaluate.html#ml-dfanalytics-classification`}
>
{i18n.translate(
'xpack.ml.dataframe.analytics.classificationExploration.classificationDocsLink',
{
defaultMessage: 'Classification evaluation docs ',
}
)}
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
{error !== null && (
Expand Down Expand Up @@ -327,28 +348,18 @@ export const EvaluatePanel: FC<Props> = ({ jobConfig, jobStatus, searchQuery })
<Fragment>
<EuiFlexGroup direction="column" justifyContent="center" gutterSize="s">
<EuiFlexItem grow={false}>
<EuiFlexGroup>
<EuiFlexItem>
<EuiSpacer />
</EuiFlexItem>
<EuiFlexItem>
<EuiSpacer />
</EuiFlexItem>
<EuiFlexItem>
<EuiFormRow
helpText={i18n.translate(
'xpack.ml.dataframe.analytics.classificationExploration.confusionMatrixPredictedLabel',
{
defaultMessage: 'Predicted label',
}
)}
>
<Fragment />
</EuiFormRow>
</EuiFlexItem>
</EuiFlexGroup>
<EuiFormRow
helpText={i18n.translate(
'xpack.ml.dataframe.analytics.classificationExploration.confusionMatrixPredictedLabel',
{
defaultMessage: 'Predicted label',
}
)}
>
<Fragment />
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem grow={false} style={{ width: '90%' }}>
<EuiFlexItem grow={false}>
<EuiDataGrid
aria-label="Data grid demo"
columns={columns}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@
import React, { FC, Fragment, useEffect, useState } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui';
import {
EuiButtonEmpty,
EuiFlexGroup,
EuiFlexItem,
EuiPanel,
EuiSpacer,
EuiText,
EuiTitle,
} from '@elastic/eui';
import { metadata } from 'ui/metadata';
import { ErrorCallout } from '../error_callout';
import {
getValuesFromResponse,
Expand Down Expand Up @@ -221,7 +230,7 @@ export const EvaluatePanel: FC<Props> = ({ jobConfig, jobStatus, searchQuery })

return (
<EuiPanel>
<EuiFlexGroup gutterSize="s">
<EuiFlexGroup alignItems="center" justifyContent="spaceBetween">
<EuiFlexItem grow={false}>
<EuiTitle size="xs">
<span>
Expand All @@ -238,6 +247,25 @@ export const EvaluatePanel: FC<Props> = ({ jobConfig, jobStatus, searchQuery })
<EuiFlexItem grow={false}>
<span>{getTaskStateBadge(jobStatus)}</span>
</EuiFlexItem>
<EuiFlexItem>
<EuiSpacer />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonEmpty
target="_blank"
iconType="help"
iconSide="left"
color="primary"
href={`https://www.elastic.co/guide/en/machine-learning/${metadata.branch}/ml-dfanalytics-evaluate.html#ml-dfanalytics-regression-evaluation`}
>
{i18n.translate(
'xpack.ml.dataframe.analytics.classificationExploration.regressionDocsLink',
{
defaultMessage: 'Regression evaluation docs ',
}
)}
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size="m" />
<EuiFlexGroup justifyContent="spaceBetween">
Expand Down

0 comments on commit aefdd29

Please sign in to comment.