Skip to content

Commit

Permalink
setup new datasets study
Browse files Browse the repository at this point in the history
  • Loading branch information
timovdk committed Jan 22, 2025
1 parent 384b28c commit 0ecd8b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions asreview2-optuna/classifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def svm_params(trial: optuna.trial.FrozenTrial):

# Only set gamma to a value if we use rbf kernel
gamma = "scale"
#if kernel == "rbf":
# # Use logarithmic normal distribution for gamma (gamma effect is non-linear)
# gamma = trial.suggest_float("svm__gamma", 1e-4, 10, log=True)
if kernel == "rbf":
# Use logarithmic normal distribution for gamma (gamma effect is non-linear)
gamma = trial.suggest_float("svm__gamma", 1e-4, 10, log=True)
return {"C": C, "kernel": kernel, "gamma": gamma}


Expand Down
4 changes: 2 additions & 2 deletions asreview2-optuna/feature_extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def tfidf_params(trial: optuna.trial.FrozenTrial):
max_features = trial.suggest_int("tfidf__max_features", 200, 20_000)
#max_features = trial.suggest_int("tfidf__max_features", 200, 20_000)

max_df = trial.suggest_float("tfidf__max_df", 0.5, 1.0)

Expand All @@ -18,7 +18,7 @@ def tfidf_params(trial: optuna.trial.FrozenTrial):
sublinear_tf = trial.suggest_categorical("tfidf__sublinear_tf", [True, False])

return {
"max_features": max_features,
#"max_features": max_features,
"max_df": max_df,
"min_df": min_df,
"ngram_range": ngram_range,
Expand Down
2 changes: 1 addition & 1 deletion asreview2-optuna/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

# Study variables
VERSION = 1
STUDY_SET = "full"
STUDY_SET = "demo"
PICKLE_FOLDER_PATH = Path("synergy-dataset", "pickles")
CLASSIFIER_TYPE = "svm" # Options: "nb", "log", "svm", "rf"
FEATURE_EXTRACTOR_TYPE = "tfidf" # Options: "tfidf", "onehot"
Expand Down

0 comments on commit 0ecd8b2

Please sign in to comment.