Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SkBlaz committed Oct 24, 2024
1 parent c56c363 commit 32597dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions examples/recursive_ranking.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
DATA_PATH = os.path.expanduser('~/datasets/toy')
MODEL_SPEC_DIR = 'model_spec_dir'
LABEL_COLUMN_NAME = 'label'
HEURISTIC = 'surrogate-SGD-SVD'
HEURISTIC = 'surrogate-SGD'
DATA_FORMAT = 'ob-vw'
NUM_THREADS = 6
INTERACTION_ORDER = 3
INTERACTION_ORDER = 2
COMBINATION_NUMBER_BOUND = 1_000
MINIBATCH_SIZE = 10_000
SUBSAMPLING = 1
SUBSAMPLING = 10

def run_outrank_task(reference_model_json: str, output_folder: str) -> None:
"""Run the outrank task with the specified parameters."""
Expand Down Expand Up @@ -97,7 +97,7 @@ def parse_arguments() -> argparse.Namespace:
parser.add_argument(
'--iterations',
type=int,
default=10,
default=80,
help='Number of iterations to run (default: 10)',
)
return parser.parse_args()
Expand Down
3 changes: 1 addition & 2 deletions outrank/algorithms/importance_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ def sklearn_surrogate(
vector_first: np.ndarray, vector_second: np.ndarray, surrogate_model: str,
) -> float:
clf = initialize_classifier(surrogate_model)
transf = OneHotEncoder()
X = transf.fit_transform(vector_first)
X = OneHotEncoder().fit_transform(vector_first)
scores = cross_val_score(clf, X, vector_second, scoring='neg_log_loss', cv=num_folds)
return 1 + np.median(scores)

Expand Down

0 comments on commit 32597dd

Please sign in to comment.