Skip to content

Commit

Permalink
benchmarks: add single lambda screening benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
jolars committed Feb 27, 2025
1 parent 8bd28c9 commit 22b3f9a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/benchmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,29 @@ TEST_CASE("Path screening benchmarks", "[!benchmark]")
model.path(data.x, data.y);
};
}

TEST_CASE("One lambda screening benchmarks", "[!benchmark]")
{
const int p = 1000;
const int n = 100;

auto data = generateData(n, p, "quadratic", 1, 1, 0.01);

slope::Slope model;

model.setSolver("fista");

double alpha = 0.1;

BENCHMARK("Strong rule screening")
{
model.setScreening("strong");
model.fit(data.x, data.y, alpha);
};

BENCHMARK("No screening")
{
model.setScreening("none");
model.fit(data.x, data.y, alpha);
};
}

0 comments on commit 22b3f9a

Please sign in to comment.