diff --git a/superset-frontend/src/components/DvtSidebar/dvtSidebarData.ts b/superset-frontend/src/components/DvtSidebar/dvtSidebarData.ts index 1195a0a52ae68..05c55d0229084 100644 --- a/superset-frontend/src/components/DvtSidebar/dvtSidebarData.ts +++ b/superset-frontend/src/components/DvtSidebar/dvtSidebarData.ts @@ -320,6 +320,25 @@ const DvtSidebarData: SidebarDataProps[] = [ label: t('TİME COLUMN NAME'), active: 'lstm', }, + { + placeholder: t('TARGET COLUMN'), + name: 'targetColumnName', + label: t('TARGET COLUMN NAME'), + active: 'lstm_forecast', + }, + { + placeholder: t('TİME COLUMN'), + name: 'timeColumnName', + label: t('TİME COLUMN NAME'), + active: 'lstm_forecast', + }, + { + placeholder: t('Prediction Number'), + name: 'predictionNumber', + label: t('Prediction Number'), + active: 'lstm_forecast', + status: 'input', + }, { placeholder: t('PERCENTILE'), name: 'percentile', diff --git a/superset-frontend/src/components/DvtSidebar/index.tsx b/superset-frontend/src/components/DvtSidebar/index.tsx index dc04902a8ddc8..b3414312b0dda 100644 --- a/superset-frontend/src/components/DvtSidebar/index.tsx +++ b/superset-frontend/src/components/DvtSidebar/index.tsx @@ -475,6 +475,7 @@ const DvtSidebar: React.FC = ({ pathName, minWidth }) => { 'algorithm', 'targetColumnName', 'timeColumnName', + 'predictionNumber', 'featureColumn', 'groupColumn', 'labelColumn', diff --git a/superset-frontend/src/dvt-redux/dvt-sidebarReducer.ts b/superset-frontend/src/dvt-redux/dvt-sidebarReducer.ts index 1ec4d9b19ee83..2324914c168d4 100644 --- a/superset-frontend/src/dvt-redux/dvt-sidebarReducer.ts +++ b/superset-frontend/src/dvt-redux/dvt-sidebarReducer.ts @@ -67,6 +67,7 @@ interface DvtSidebarState { algorithm: any; targetColumnName: any; timeColumnName: any; + predictionNumber: any; featureColumn: any; groupColumn: any; labelColumn: any; @@ -217,6 +218,7 @@ interface DvtSidebarState { algorithm: any[]; targetColumnName: any[]; timeColumnName: any[]; + predictionNumber: any[]; featureColumn: any[]; groupColumn: any[]; labelColumn: any[]; @@ -300,6 +302,7 @@ const INITIAL_STATE = { algorithm: '', targetColumnName: '', timeColumnName: '', + predictionNumber: '', featureColumn: '', groupColumn: '', labelColumn: '', @@ -460,6 +463,7 @@ const initialState: DvtSidebarState = { algorithm: [], targetColumnName: [], timeColumnName: [], + predictionNumber: [], featureColumn: [], groupColumn: [], labelColumn: [], @@ -574,6 +578,7 @@ const dvtSidebarSlice = createSlice({ algorithm: [], targetColumnName: [], timeColumnName: [], + predictionNumber: [], featureColumn: [], groupColumn: [], labelColumn: [], diff --git a/superset-frontend/src/pages/DvtNewTrainedTable/index.tsx b/superset-frontend/src/pages/DvtNewTrainedTable/index.tsx index cfca7bcfe9331..5a44c1c12cbcb 100644 --- a/superset-frontend/src/pages/DvtNewTrainedTable/index.tsx +++ b/superset-frontend/src/pages/DvtNewTrainedTable/index.tsx @@ -67,6 +67,16 @@ function DvtNewTainedTable() { newTainedTableAddSelector.targetColumnName?.value, time_column_name: newTainedTableAddSelector.timeColumnName?.value, } + : newTainedTableAddSelector.algorithm?.value === 'lstm_forecast' + ? { + source_table_name: newTainedTableAddSelector.selectDatabase?.value, + target_column_name: + newTainedTableAddSelector.targetColumnName?.value, + time_column_name: newTainedTableAddSelector.timeColumnName?.value, + predictionNumber: newTainedTableAddSelector.predictionNumber + ? newTainedTableAddSelector.predictionNumber + : undefined, + } : newTainedTableAddSelector.category?.value === 'statistical' ? { algorithm_name: newTainedTableAddSelector.algorithm?.value, @@ -243,6 +253,8 @@ function DvtNewTainedTable() { setPostSegmentationDataSetUrl('algorithms/run-ml-algorithm'); } else if (newTainedTableAddSelector.algorithm?.value === 'lstm') { setPostDataSetUrl('lstm'); + } else if (newTainedTableAddSelector.algorithm?.value === 'lstm_forecast') { + setPostDataSetUrl('lstm_forecast'); } else { setPostDataSetUrl('ml_and_insert/'); } @@ -261,7 +273,10 @@ function DvtNewTainedTable() { dvtSidebarSetDataProperty({ pageKey: 'newTrainedTable', key: 'algorithm', - value: [{ value: 'lstm', label: 'LSTM' }], + value: [ + { value: 'lstm', label: 'LSTM' }, + { value: 'lstm_forecast', label: 'LSTM Forecast' }, + ], }), ); } else if (newTainedTableAddSelector.category?.value === 'statistical') {