Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Adds popover help for multiclass confusion matrix #101732

Merged
merged 7 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React, { useState } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import {
HelpPopover,
HelpPopoverButton,
} from '../../../../../components/help_popover/help_popover';

export const MulticlassConfusionMatrixHelpPopover = () => {
const [isPopoverOpen, setIsPopoverOpen] = useState(false);

return (
<HelpPopover
anchorPosition="upCenter"
button={
<HelpPopoverButton
onClick={() => {
setIsPopoverOpen(!isPopoverOpen);
}}
/>
}
closePopover={() => setIsPopoverOpen(false)}
isOpen={isPopoverOpen}
title={i18n.translate('xpack.ml.dataframe.analytics.confusionMatrixPopoverTitle', {
defaultMessage: 'Normalized confusion matrix',
})}
>
<p>
<FormattedMessage
id="xpack.ml.dataframe.analytics.confusionMatrixBasicExplanation"
defaultMessage="The multiclass confusion matrix provides a summary of the performance of the classification analysis. It contains the proportion of the data points that the analysis classified correctly with their actual class as well as the proportion of the misclassified data points."
/>
</p>
<p>
<FormattedMessage
id="xpack.ml.dataframe.analytics.confusionMatrixAxisExplanation"
defaultMessage="The matrix contains the actual labels on the left side while the predicted labels are on the top. The proportion of correct and incorrect predictions is broken down for each class. This enables you to examine how the classification analysis confused the different classes while it made its predictions. If you want to see the exact number of occurrences, select a cell in the matrix and click the appearing icon."
/>
</p>
<p>
<FormattedMessage
id="xpack.ml.dataframe.analytics.confusionMatrixShadeExplanation"
defaultMessage="As the number of classes in the classification analysis increases, the confusion matrix also increases in complexity. For an easier overview, darker cells indicate higher percentage of the predictions."
/>
</p>
<p>
<FormattedMessage
id="xpack.ml.dataframe.analytics.confusionMatrixColumnExplanation"
defaultMessage="The Columns selector enables you to toggle between showing or hiding some of the columns or all of them."
/>
</p>
</HelpPopover>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import {
import { isTrainingFilter } from './is_training_filter';
import { useRocCurve } from './use_roc_curve';
import { useConfusionMatrix } from './use_confusion_matrix';
import { MulticlassConfusionMatrixHelpPopover } from './confusion_matrix_help_popover';

export interface EvaluatePanelProps {
jobConfig: DataFrameAnalyticsConfig;
Expand Down Expand Up @@ -288,21 +289,12 @@ export const EvaluatePanel: FC<EvaluatePanelProps> = ({ jobConfig, jobStatus, se
{errorConfusionMatrix !== null && <ErrorCallout error={errorConfusionMatrix} />}
{errorConfusionMatrix === null && (
<>
<EuiFlexGroup gutterSize="none">
<EuiFlexGroup gutterSize="none" alignItems="center">
<EuiTitle size="xxs">
<span>{getHelpText(dataSubsetTitle)}</span>
</EuiTitle>
<EuiFlexItem grow={false}>
<EuiIconTip
anchorClassName="mlDataFrameAnalyticsClassificationInfoTooltip"
content={i18n.translate(
'xpack.ml.dataframe.analytics.classificationExploration.confusionMatrixTooltip',
{
defaultMessage:
'The multi-class confusion matrix contains the number of occurrences where the analysis classified data points correctly with their actual class as well as the number of occurrences where it misclassified them with another class',
}
)}
/>
<MulticlassConfusionMatrixHelpPopover />
peteharverson marked this conversation as resolved.
Show resolved Hide resolved
</EuiFlexItem>
</EuiFlexGroup>
{/* BEGIN TABLE ELEMENTS */}
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -14048,7 +14048,6 @@
"xpack.ml.dataframe.analytics.classificationExploration.confusionMatrixLabel": "分類混同行列",
"xpack.ml.dataframe.analytics.classificationExploration.confusionMatrixPredictedLabel": "予測されたクラス",
"xpack.ml.dataframe.analytics.classificationExploration.confusionMatrixTestingHelpText": "データセットをテストするための正規化された混同行列",
"xpack.ml.dataframe.analytics.classificationExploration.confusionMatrixTooltip": "マルチクラス混同行列には、分析が実際のクラスで正しくデータポイントを分類した発生数と、別のクラスで誤分類した発生数が含まれます。",
"xpack.ml.dataframe.analytics.classificationExploration.confusionMatrixTrainingHelpText": "データセットを学習するための正規化された混同行列",
"xpack.ml.dataframe.analytics.classificationExploration.evaluateJobStatusLabel": "ジョブ状態",
"xpack.ml.dataframe.analytics.classificationExploration.evaluateSectionAvgRecallTooltip": "平均再現率は、実際のクラスメンバーのデータポイントのうち正しくクラスメンバーとして特定された数を示します。",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -14230,7 +14230,6 @@
"xpack.ml.dataframe.analytics.classificationExploration.confusionMatrixLabel": "分类混淆矩阵",
"xpack.ml.dataframe.analytics.classificationExploration.confusionMatrixPredictedLabel": "预测类",
"xpack.ml.dataframe.analytics.classificationExploration.confusionMatrixTestingHelpText": "用于测试数据集的标准化混淆矩阵",
"xpack.ml.dataframe.analytics.classificationExploration.confusionMatrixTooltip": "多类混淆矩阵包含分析使用数据点的实际类正确分类数据点的次数以及分析使用其他类错误分类这些数据点的次数",
"xpack.ml.dataframe.analytics.classificationExploration.confusionMatrixTrainingHelpText": "用于训练数据集的标准化混淆矩阵",
"xpack.ml.dataframe.analytics.classificationExploration.evaluateJobStatusLabel": "作业状态",
"xpack.ml.dataframe.analytics.classificationExploration.evaluateSectionAvgRecallTooltip": "平均召回率显示作为实际类成员的数据点有多少个已被正确标识为类成员。",
Expand Down