Skip to content

Commit

Permalink
[ML] DF Analytics fix: show MSE and rSquared in expanded row only for…
Browse files Browse the repository at this point in the history
… regression jobs (#48390)

* Only show MSE and rSquared in expanded row for regression jobs

* use isRegressionAnalysis check
  • Loading branch information
alvarezmelissa87 authored Oct 16, 2019
1 parent 09d9958 commit a9515bd
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { ExpandedRowJsonPane } from './expanded_row_json_pane';
import { ProgressBar } from './progress_bar';
import { getDependentVar, getValuesFromResponse, loadEvalData, Eval } from '../../../../common';
import { isCompletedAnalyticsJob } from './common';
import { isRegressionAnalysis } from '../../../../common/analytics';
// import { ExpandedRowMessagesPane } from './expanded_row_messages_pane';

function getItemDescription(value: any) {
Expand Down Expand Up @@ -60,6 +61,7 @@ export const ExpandedRow: FC<Props> = ({ item }) => {
const index = idx(item, _ => _.config.dest.index) as string;
const dependentVariable = getDependentVar(item.config.analysis);
const jobIsCompleted = isCompletedAnalyticsJob(item.stats);
const isRegressionJob = isRegressionAnalysis(item.config.analysis);

const loadData = async () => {
setIsLoadingGeneralization(true);
Expand Down Expand Up @@ -113,7 +115,7 @@ export const ExpandedRow: FC<Props> = ({ item }) => {
};

useEffect(() => {
if (jobIsCompleted) {
if (jobIsCompleted && isRegressionJob) {
loadData();
}
}, [jobIsCompleted]);
Expand Down Expand Up @@ -162,7 +164,7 @@ export const ExpandedRow: FC<Props> = ({ item }) => {
position: 'right',
};

if (jobIsCompleted) {
if (jobIsCompleted && isRegressionJob) {
stats.items.push(
{
title: 'generalization mean squared error',
Expand Down

0 comments on commit a9515bd

Please sign in to comment.