Skip to content

Commit

Permalink
Merge pull request #277 from intellica-tech/fix-trained
Browse files Browse the repository at this point in the history
fix: trained
  • Loading branch information
erayerturk authored Apr 16, 2024
2 parents a34d82b + c125880 commit 5cea11f
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const StyledRange = styled.div`
display: flex;
flex-direction: column;
gap: 8px;
padding: 0 10px;
`;

const StyledPopper = styled.div`
Expand Down Expand Up @@ -88,7 +89,7 @@ const StyledRangePopover = styled.div`

const StyledRangeLabel = styled.label`
font-weight: 600;
color: ${({ theme }) => theme.colors.dvt.text.label};
color: ${({ theme }) => theme.colors.grayscale.dark2};
`;

export {
Expand Down
7 changes: 7 additions & 0 deletions superset-frontend/src/components/DvtSidebar/dvtSidebarData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,13 @@ const DvtSidebarData: SidebarDataProps[] = [
label: t('LABEL COLUMN'),
active: 'linear_regression',
},
{
placeholder: t('Training Data Ratio'),
name: 'training_data_ratio',
label: t('TRAINING DATA RATIO'),
active: 'linear_regression',
status: 'range',
},
{
placeholder: t('EPSİLON'),
name: 'epsilon',
Expand Down
26 changes: 26 additions & 0 deletions superset-frontend/src/components/DvtSidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import DvtInputSelect from '../DvtInputSelect';
import DvtDargCardList from '../DvtDragCardList';
import DvtCollapse from '../DvtCollapse';
import Icon from '../Icons/Icon';
import DvtRange from '../DvtRange';
import {
StyledDvtSidebar,
StyledDvtSidebarHeader,
Expand Down Expand Up @@ -474,6 +475,7 @@ const DvtSidebar: React.FC<DvtSidebarProps> = ({ pathName, minWidth }) => {
'featureColumn',
'groupColumn',
'labelColumn',
'training_data_ratio',
],
},
{
Expand Down Expand Up @@ -891,6 +893,30 @@ const DvtSidebar: React.FC<DvtSidebarProps> = ({ pathName, minWidth }) => {
typeDesign="chartsForm"
/>
)}
{data.status === 'range' &&
data.active ===
newTrainedTableSelector.algorithm.value && (
<DvtRange
min={0}
max={1}
step={0.01}
value={
pathTitles(pathName) === 'newTrainedTable'
? newTrainedTableSelector[data.name]
: undefined
}
setValue={value => {
updateProperty(
sidebarDataFindPathname.key,
data.name,
value,
);
}}
label={data.label}
important
popoverDirection="top"
/>
)}
{data.status === 'datepicker' && (
<DvtDatePicker
isOpen
Expand Down
4 changes: 4 additions & 0 deletions superset-frontend/src/pages/DvtNewTrainedTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ function DvtNewTainedTable() {
label_column: newTainedTableAddSelector.labelColumn?.value
? newTainedTableAddSelector.labelColumn?.value
: undefined,
training_data_ratio: newTainedTableAddSelector.training_data_ratio
? newTainedTableAddSelector.training_data_ratio
: undefined,
},
}
: {
Expand Down Expand Up @@ -154,6 +157,7 @@ function DvtNewTainedTable() {
{ key: 'featureColumn' },
{ key: 'groupColumn' },
{ key: 'labelColumn' },
{ key: 'training_data_ratio' },
];

useEffect(() => {
Expand Down

0 comments on commit 5cea11f

Please sign in to comment.