예제 #1
0
 def _weights(label_id):
     coef = get_coef(clf, label_id)
     _x = x
     scores = _multiply(_x, coef)
     if flt_indices is not None:
         scores = scores[flt_indices]
         _x = mask(_x, flt_indices)
     return get_top_features(feature_names, scores, top, _x)
예제 #2
0
 def _weights(label_id, scale=1.0):
     coef = get_coef(clf, label_id)
     scores = _multiply(x, coef)
     return get_top_features_filtered(x, flt_feature_names, flt_indices,
                                      scores, top, scale)
예제 #3
0
 def _features(label_id):
     coef = get_coef(clf, label_id, scale=coef_scale)
     if flt_indices is not None:
         coef = coef[flt_indices]
     return get_top_features(feature_names, coef, top)
예제 #4
0
 def _features(target_id):
     coef = get_coef(reg, target_id, scale=coef_scale)
     if flt_indices is not None:
         coef = coef[flt_indices]
     return get_top_features(feature_names, coef, top)
예제 #5
0
 def _weights(label_id):
     coef = get_coef(reg, label_id)
     scores = _multiply(x, coef)
     return get_top_features(feature_names, scores, top)