@@ -479,16 +479,30 @@ define([
479
479
name : 'permutation_importance' ,
480
480
label : 'Permutation importance' ,
481
481
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 })' ,
483
483
description : 'Permutation importance for feature evaluation.' ,
484
484
options : [
485
485
{ name : 'importance_featureData' , label : 'Feature Data' , component : [ 'data_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'X_train' } ,
486
486
{ name : 'importance_targetData' , label : 'Target Data' , component : [ 'data_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'y_train' } ,
487
487
{ 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 } ,
489
489
{ name : 'importance_allocate' , label : 'Allocate to' , component : [ 'input' ] , placeholder : 'New variable' , value : 'importances' }
490
490
]
491
491
} ,
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
+ } ,
492
506
'feature_importances' : {
493
507
name : 'feature_importances' ,
494
508
label : 'Feature importances' ,
0 commit comments