Skip to content

Commit

Permalink
updated to latest gadfly theme
Browse files Browse the repository at this point in the history
  • Loading branch information
benhamner committed Jan 31, 2015
1 parent 0ba21e5 commit 57b0589
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
16 changes: 8 additions & 8 deletions src/importance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ function Gadfly.plot(results::ImportanceResults)
importance = DataFrame(Feature=results.names, Importance=results.importances, Useful=[imp>0.0 ? "Yes":"No" for imp=results.importances])
importance = sort(importance, cols=[:Feature])
order = sortperm(importance[:Importance], rev=false)
p = plot(importance,
x="Importance",
y="Feature",
color="Useful",
Geom.bar(orientation=:horizontal),
Scale.y_discrete(order=order),
Guide.title(@sprintf("Best Score: %0.4f", results.best_score)))
compose(render(p), compose(context(), rectangle(), fill("white")))
plot(importance,
x="Importance",
y="Feature",
color="Useful",
Geom.bar(orientation=:horizontal),
Scale.y_discrete(order=order),
Guide.title(@sprintf("Best Score: %0.4f", results.best_score)),
Theme(background_color=color("white")))
end
12 changes: 6 additions & 6 deletions src/partial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ end
function Gadfly.plot(results::PartialFeatureResults)
df = DataFrame(Feature=results.values, Value=results.responses)

p = plot(df,
x="Feature",
y="Value",
Geom.line,
Guide.title(results.name))
compose(render(p), compose(context(), rectangle(), fill("white")))
plot(df,
x="Feature",
y="Value",
Geom.line,
Guide.title(results.name),
Theme(background_color=color("white")))
end
12 changes: 6 additions & 6 deletions src/sensitivity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ function Gadfly.plot(results::SensitivityResults)
rename!(data, :value, :Sensitivity)
sort!(data, cols=:Feature)
order = sortperm(aggregate(data, :Feature, median)[:Sensitivity_median], rev=true)
p = plot(data,
x="Feature",
y="Sensitivity",
Geom.boxplot(),
Scale.x_discrete(order=order))
compose(render(p), compose(context(), rectangle(), fill("white")))
plot(data,
x="Feature",
y="Sensitivity",
Geom.boxplot(),
Scale.x_discrete(order=order),
Theme(background_color=color("white")))
end
4 changes: 4 additions & 0 deletions test/sensitivity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ data = DataFrame(X1=vec(x[:,1]), X2=vec(x[:,2]), X3=vec(x[:,3]), Y=vec(y))

res = sensitivities(data, :Y, regression_forest_options())

println("X1: ", mean(res.data[:X1]))
println("X2: ", mean(res.data[:X2]))
println("X3: ", mean(res.data[:X3]))

@test mean(res.data[:X1])>mean(res.data[:X2])
@test mean(res.data[:X2])>mean(res.data[:X3])

0 comments on commit 57b0589

Please sign in to comment.