Run doctests #69
Open
Run doctests #69
Annotations
2 errors and 1 notice
|
|
|
../../../.julia/packages/Documenter/eoWm2/src/utilities/utilities.jl#L47
invalid doctest block in docs/src/tutorial.md:51-117
Requires `julia> ` or `# output`
```jldoctest; output=false
using Plots
using MLFlowClient
using Random
# Parameters
αs = [0.0, 0.9, 0.98]
n = 100
"Method that generates price paths of length `n` based on `α`"
function getpricepath(α, n)
x = zeros(n + 1)
x[1] = 0.0
for t in 1:n
x[t+1] = α * x[t] + rand()
end
x
end
p = plot()
# Create MLFlow instance
mlf = MLFlow("http://localhost:5000/api")
# Initiate new experiment
experiment_id = createexperiment(mlf, "price-paths")
# Create a run in the new experiment
exprun = createrun(mlf, experiment_id)
# Log parameters and their values
for (idx, α) in enumerate(αs)
logparam(mlf, exprun, "alpha$(idx)", string(α)) # MLFlow only supports string parameter values
end
# Obtain pricepaths
pricepaths = [getpricepath(α, n) for α in αs]
# Log pricepaths in MLFlow
for (idx, pricepath) in enumerate(pricepaths)
plot!(p,
pricepath,
title="Random price paths",
label="alpha = $(αs[idx])",
xlabel="Timestep",
ylabel="Price"
)
# Log each point in the price path as a separate metric with step parameter
for (step, value) in enumerate(pricepath)
logmetric(mlf, exprun, "pricepath$(idx)", Float64(value); step=step-1)
end
end
# Save the price path plot as an image
plotfilename = "pricepaths-plot.png"
png(plotfilename)
# TODO: Upload the plot as an artifact when logartifact function is implemented
# See: https://github.com/JuliaAI/MLFlowClient.jl/issues/61
# logartifact(mlf, exprun, plotfilename)
# Keep the plot file since artifact upload is not yet available
# rm(plotfilename)
# complete the experiment
updaterun(mlf, exprun; status=RunStatus.FINISHED)
```
|
|
Consider using `julia-actions/cache` to speed up runs https://github.com/julia-actions/cache To ignore, set input `ignore-no-cache: true`
|
The logs for this run have expired and are no longer available.
Loading