@@ -379,8 +379,8 @@ define([
379
379
code : '${score_allocate} = ${model}.score(${score_featureData}, ${score_targetData})' ,
380
380
description : '' ,
381
381
options : [
382
- { name : 'score_featureData' , label : 'Feature Data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'X ' } ,
383
- { name : 'score_targetData' , label : 'Target Data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'y ' } ,
382
+ { name : 'score_featureData' , label : 'Feature Data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'X_train ' } ,
383
+ { name : 'score_targetData' , label : 'Target Data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'y_train ' } ,
384
384
{ name : 'score_allocate' , label : 'Allocate to' , component : [ 'input' ] , placeholder : 'New variable' , value : 'scores' }
385
385
]
386
386
} ,
@@ -452,7 +452,8 @@ define([
452
452
"def plot_feature_importances(model, X_train=None, sort=False):\
453
453
\n df_i = create_feature_importances(model, X_train, sort)\
454
454
\n\
455
- \n df_i['Percentage'].sort_values().plot(kind='barh')\
455
+ \n if sort: df_i['Percentage'].sort_values().plot(kind='barh')\
456
+ \n else: df_i['Percentage'].plot(kind='barh')\
456
457
\n plt.xlabel('Feature importance Percentage')\
457
458
\n plt.ylabel('Features')\
458
459
\n\
@@ -629,8 +630,8 @@ define([
629
630
\nplt.show()" ,
630
631
description : '' ,
631
632
options : [
632
- { name : 'roc_targetData ' , label : 'Target Data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'y_test ' } ,
633
- { name : 'roc_featureData ' , label : 'Feature Data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'X_test ' }
633
+ { name : 'roc_featureData ' , label : 'Feature Data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'X_test ' } ,
634
+ { name : 'roc_targetData ' , label : 'Target Data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'y_test ' }
634
635
]
635
636
} ,
636
637
'auc' : {
@@ -640,8 +641,8 @@ define([
640
641
code : 'metrics.roc_auc_score(${auc_targetData}, ${model}.predict_proba(${auc_featureData})[:, 1])' ,
641
642
description : '' ,
642
643
options : [
643
- { name : 'auc_targetData ' , label : 'Target Data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'y_test ' } ,
644
- { name : 'auc_featureData ' , label : 'Feature Data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'X_test ' }
644
+ { name : 'auc_featureData ' , label : 'Feature Data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'X_test ' } ,
645
+ { name : 'auc_targetData ' , label : 'Target Data' , component : [ 'var_select' ] , var_type : [ 'DataFrame' , 'Series' , 'ndarray' , 'list' , 'dict' ] , value : 'y_test ' }
645
646
]
646
647
} ,
647
648
'permutation_importance' : defaultInfos [ 'permutation_importance' ]
0 commit comments