-
Notifications
You must be signed in to change notification settings - Fork 22
adds Dict{Symbol,DataFrame} as input for performance_profile #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lrsantos11
wants to merge
15
commits into
JuliaSmoothOptimizers:main
Choose a base branch
from
lrsantos11:dataframe
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
77e2c48
adds Dict{Symbol,DataFrame} as input for performance_profile
lrsantos11 874ca95
corrects test of DataFrames
lrsantos11 5d60df4
Update src/performance_profiles.jl
lrsantos11 21cfc6d
Update src/performance_profiles.jl
lrsantos11 dea02ca
Update src/performance_profiles.jl
lrsantos11 0db073a
Update src/performance_profiles.jl
lrsantos11 1082660
Put DataFrames before Plots.
lrsantos11 a3eac70
Put DataFrames before Plots.
lrsantos11 87064ff
adds Dict{Symbol,DataFrame} as input for performance_profile
lrsantos11 1b584c6
corrects test of DataFrames
lrsantos11 c0e4b01
Update test/runtests.jl
lrsantos11 361f7ab
Update test/runtests.jl
lrsantos11 e9fea0e
Update src/performance_profiles.jl
lrsantos11 967d883
Update src/performance_profiles.jl
lrsantos11 3b6688f
Update src/performance_profiles.jl
lrsantos11 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module BenchmarkProfiles | ||
|
||
using DataFrames | ||
import NaNMath | ||
using Requires | ||
using Printf | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,3 +129,26 @@ function performance_profile(b::AbstractBackend, | |
(x_plot, y_plot, max_ratio) = performance_profile_data(T, logscale=logscale, sampletol=sampletol, drawtol=drawtol) | ||
performance_profile_plot(b, x_plot, y_plot, max_ratio, xlabel, ylabel, labels, title, logscale; kwargs...) | ||
end | ||
|
||
performance_profile(b::AbstractBackend, T :: Array{Tn,2}, labels :: Vector{S}; kwargs...) where {Tn <: Number, S <: AbstractString} = | ||
performance_profile(b, convert(Array{Float64,2}, T), convert(Vector{AbstractString}, labels); kwargs...) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed this because it’s ambiguous. At some point I got a StackOverflow because of it. In addition, it’s not tested. |
||
|
||
""" | ||
performance_profile(b, stats, cost) | ||
Produce a performance profile comparing solvers in `stats` using the `cost` function. | ||
Inputs: | ||
- `b::AbstractBackend`: the backend used to produce the plot. | ||
- `stats::Dict{Symbol,DataFrame}`: pairs of `:solver => df`; | ||
- `cost::Function`: cost function applyed to each `df`. Should return a vector with the cost of solving the problem at each row; | ||
- if the cost is zero for at least one problem, all costs will be shifted by 1; | ||
- if the solver did not solve the problem, return Inf or a negative number. | ||
Examples of cost functions: | ||
- `cost(df) = df.elapsed_time`: Simple `elapsed_time` cost. Assumes the solver solved the problem. | ||
- `cost(df) = (df.status .!= :first_order) * Inf + df.elapsed_time`: Takes the status of the solver into consideration. | ||
""" | ||
function performance_profile(b::AbstractBackend, stats::Dict{Symbol,DataFrame}, cost, args...; kwargs...) | ||
solvers = keys(stats) | ||
dfs = (stats[s] for s in solvers) | ||
P = hcat([cost(df) for df in dfs]...) | ||
performance_profile(b, P, string.(solvers), args...; kwargs...) | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.