Skip to content

Commit

Permalink
nonsense--
Browse files Browse the repository at this point in the history
  • Loading branch information
SkBlaz committed Oct 24, 2024
1 parent d8563fa commit c56c363
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions outrank/algorithms/importance_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,20 @@ def get_importances_estimate_nonmyopic(args: Any, tmp_df: pd.DataFrame):
pass

def initialize_classifier(surrogate_model: str):

if 'surrogate-LR' in surrogate_model:
return LogisticRegression(max_iter=100000)

elif 'surrogate-SVM' in surrogate_model:
return SVC(gamma='auto', probability=True)
elif 'surrogate-SGD' in surrogate_model:
return SGDClassifier(max_iter=100000, loss='log_loss')

elif 'surrogate-SGD-SVD' in surrogate_model:
clf = Pipeline([('svd', TruncatedSVD(n_components=2**5)), ('reg', SGDClassifier(max_iter=100000, loss='log_loss'))])
return clf

elif 'surrogate-SGD' in surrogate_model:
return SGDClassifier(max_iter=100000, loss='log_loss')

else:
logger.warning(f'The chosen surrogate model {surrogate_model} is not supported, falling back to surrogate-SGD')
return SGDClassifier(max_iter=100000, loss='log_loss')

0 comments on commit c56c363

Please sign in to comment.