@@ -26,6 +26,7 @@ function logparam(mlf::MLFlow, run::Union{String,MLFlowRun,MLFlowRunInfo}, kv)
26
26
end
27
27
end
28
28
29
+
29
30
"""
30
31
logmetric(mlf::MLFlow, run, key, value::T; timestamp, step) where T<:Real
31
32
logmetric(mlf::MLFlow, run, key, values::AbstractArray{T}; timestamp, step) where T<:Real
@@ -194,3 +195,37 @@ listartifacts(mlf::MLFlow, run::MLFlowRun; kwargs...) =
194
195
listartifacts (mlf, run. info. run_id; kwargs... )
195
196
listartifacts (mlf:: MLFlow , run_info:: MLFlowRunInfo ; kwargs... ) =
196
197
listartifacts (mlf, run_info. run_id; kwargs... )
198
+
199
+ """
200
+ logbatch(mlf::MLFlow, run_id::String, metrics, params, tags)
201
+
202
+ Logs a batch of metrics, parameters and tags to an experiment run.
203
+
204
+ # Arguments
205
+ - `mlf::MLFlow`: [`MLFlow`](@ref) onfiguration.
206
+ - `run_id::String`: ID of the run to log to.
207
+ - `metrics`: a vector of [`MLFlowRunDataMetric`](@ref) or a vector of
208
+ NamedTuples of `(name, value, timestamp)`.
209
+ - `params`: a vector of [`MLFlowRunDataParam`](@ref) or a vector of NamedTuples
210
+ of `(name, value)`.
211
+ - `tags`: a vector of strings.
212
+ """
213
+ logbatch (mlf:: MLFlow , run_id:: String ; tags= String[], metrics= Any[],
214
+ params= Any[]) = logbatch (mlf, run_id, tags, metrics, params)
215
+ function logbatch (mlf:: MLFlow , run_id:: String ,
216
+ tags:: Union{AbstractVector{<:String}, AbstractVector{Any}} ,
217
+ metrics:: Union{AbstractVector{<:MLFlowRunDataMetric}, AbstractVector{Any}} ,
218
+ params:: Union{AbstractVector{<:MLFlowRunDataParam}, AbstractVector{Any}} )
219
+ endpoint = " runs/log-batch"
220
+ mlfpost (mlf, endpoint;
221
+ run_id= run_id, metrics= metrics, params= params, tags= tags)
222
+ end
223
+ function logbatch (mlf:: MLFlow , run_id:: String ,
224
+ tags:: Union{AbstractVector{<:String}, AbstractVector{Any}} ,
225
+ metrics:: Union{AbstractVector{<:AbstractDict}, AbstractVector{Any}} ,
226
+ params:: Union{AbstractVector{<:AbstractDict}, AbstractVector{Any}} )
227
+ endpoint = " runs/log-batch"
228
+ mlfpost (mlf, endpoint; run_id= run_id,
229
+ metrics= MLFlowRunDataMetric .(metrics),
230
+ params= MLFlowRunDataParam .(params), tags= tags)
231
+ end
0 commit comments