@@ -427,7 +427,6 @@ define([
427
427
description : 'Transform labels to normalized encoding.'
428
428
}
429
429
}
430
-
431
430
if ( modelType != 'ColumnTransformer' ) {
432
431
actions = {
433
432
...actions ,
@@ -443,6 +442,32 @@ define([
443
442
}
444
443
}
445
444
}
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
+ }
446
471
break ;
447
472
case 'Regression' :
448
473
actions = {
0 commit comments