@@ -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