Skip to content

Commit e46aa1e

Browse files
author
minjk-bl
committed
Edit SMOTE actions
1 parent 1e5a67b commit e46aa1e

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

visualpython/html/m_ml/fitPredict.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</div>
3939
<div class="vp-grid-border-box">
4040
<div class="vp-multilang vp-ins-select-title">Options</div>
41-
<div class="vp-ins-parameter-box vp-grid-col-95">
41+
<div class="vp-ins-parameter-box vp-grid-col-130">
4242

4343
</div>
4444
</div>

visualpython/js/m_ml/FitPredict.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ define([
427427
description: 'Transform labels to normalized encoding.'
428428
}
429429
}
430-
431430
if (modelType != 'ColumnTransformer') {
432431
actions = {
433432
...actions,
@@ -443,6 +442,32 @@ define([
443442
}
444443
}
445444
}
445+
if (modelType === 'SMOTE') {
446+
actions = {
447+
'fit': {
448+
name: 'fit',
449+
label: 'Fit',
450+
code: '${model}.fit(${fit_featureData}, ${fit_targetData})',
451+
description: 'Check inputs and statistics of the sampler.',
452+
options: [
453+
{ name: 'fit_featureData', label: 'Feature Data', component: ['data_select'], var_type: ['DataFrame', 'Series', 'ndarray', 'list', 'dict'], value: 'X_train' },
454+
{ name: 'fit_targetData', label: 'Target Data', component: ['data_select'], var_type: ['DataFrame', 'Series', 'ndarray', 'list', 'dict'], value: 'y_train' }
455+
]
456+
},
457+
'fit_resample': {
458+
name: 'fit_resample',
459+
label: 'Fit and resample',
460+
code: '${fit_res_allocateX}, ${fit_res_allocatey} = ${model}.fit_resample(${fit_res_featureData}, ${fit_res_targetData})',
461+
description: 'Resample the dataset.',
462+
options: [
463+
{ name: 'fit_res_allocateX', label: 'Allocate feature', component: ['input'], placeholder: 'New variable', value: 'X_res' },
464+
{ name: 'fit_res_allocatey', label: 'Allocate target', component: ['input'], placeholder: 'New variable', value: 'y_res' },
465+
{ name: 'fit_res_featureData', label: 'Feature Data', component: ['data_select'], var_type: ['DataFrame', 'Series', 'ndarray', 'list', 'dict'], value: 'X_train' },
466+
{ name: 'fit_res_targetData', label: 'Target Data', component: ['data_select'], var_type: ['DataFrame', 'Series', 'ndarray', 'list', 'dict'], value: 'y_train' }
467+
]
468+
}
469+
}
470+
}
446471
break;
447472
case 'Regression':
448473
actions = {

0 commit comments

Comments
 (0)