@@ -479,16 +479,30 @@ define([
479479 name : 'permutation_importance' ,
480480 label : 'Permutation importance' ,
481481 import : 'from sklearn.inspection import permutation_importance' ,
482- code : '${importance_allocate} = permutation_importance (${model}, ${importance_featureData}, ${importance_targetData}${scoring}${random_state}${etc })' ,
482+ code : '${importance_allocate} = vp_create_permutation_importances (${model}, ${importance_featureData}, ${importance_targetData}${scoring}${sort })' ,
483483 description : 'Permutation importance for feature evaluation.' ,
484484 options : [
485485 { name : 'importance_featureData' , label : 'Feature Data' , component : [ 'data_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'X_train' } ,
486486 { name : 'importance_targetData' , label : 'Target Data' , component : [ 'data_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'y_train' } ,
487487 { name : 'scoring' , component : [ 'input' ] , usePair : true } ,
488- { name : 'random_state ' , component : [ 'input_number ' ] , placeholder : '123' , usePair : true } ,
488+ { name : 'sort ' , label : 'Sort data' , component : [ 'bool_checkbox ' ] , value : true , usePair : true } ,
489489 { name : 'importance_allocate' , label : 'Allocate to' , component : [ 'input' ] , placeholder : 'New variable' , value : 'importances' }
490490 ]
491491 } ,
492+ 'plot_permutation_importance' : {
493+ name : 'plot_permutation_importance' ,
494+ label : 'Plot permutation importance' ,
495+ import : 'from sklearn.inspection import permutation_importance' ,
496+ code : 'vp_plot_permutation_importances(${model}, ${importance_featureData}, ${importance_targetData}${scoring}${sort}${top_count})' ,
497+ description : 'Permutation importance for feature evaluation.' ,
498+ options : [
499+ { name : 'importance_featureData' , label : 'Feature Data' , component : [ 'data_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'X_train' } ,
500+ { name : 'importance_targetData' , label : 'Target Data' , component : [ 'data_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'y_train' } ,
501+ { name : 'scoring' , component : [ 'input' ] , usePair : true } ,
502+ { name : 'sort' , label : 'Sort data' , component : [ 'bool_checkbox' ] , value : true , usePair : true } ,
503+ { name : 'top_count' , label : 'Top count' , component : [ 'input_number' ] , min : 0 , usePair : true }
504+ ]
505+ } ,
492506 'feature_importances' : {
493507 name : 'feature_importances' ,
494508 label : 'Feature importances' ,
0 commit comments