@@ -17,15 +17,22 @@ represent ML model accuracy. A metric can be logged multiple times.
17
17
- `value`: Double value of the metric being logged.
18
18
- `timestamp`: Unix timestamp in milliseconds at the time metric was logged.
19
19
- `step`: Step at which to log the metric.
20
+
21
+ # Returns
22
+ `true` if successful. Otherwise, raises exception.
20
23
"""
21
- logmetric (instance:: MLFlow , run_id:: String , key:: String , value:: Float64 ;
22
- timestamp:: Int64 = round (Int, now () |> datetime2unix),
23
- step:: Union{Int64, Missing} = missing ) =
24
- mlfpost (instance, " runs/log-metric" ; run_id= run_id, key= key, value= value, timestamp= timestamp, step= step)
24
+ function logmetric (instance:: MLFlow , run_id:: String , key:: String ,
25
+ value:: Float64 ; timestamp:: Int64 = round (Int, now () |> datetime2unix),
26
+ step:: Union{Int64, Missing} = missing ):: Bool
27
+ mlfpost (instance, " runs/log-metric" ; run_id= run_id, key= key, value= value,
28
+ timestamp= timestamp, step= step)
29
+ return true
30
+ end
25
31
logmetric (instance:: MLFlow , run:: Run , key:: String , value:: Float64 ;
26
32
timestamp:: Int64 = round (Int, now () |> datetime2unix),
27
- step:: Union{Int64, Missing} = missing ) =
28
- logmetric (instance, run. info. run_id, key, value; timestamp= timestamp, step= step)
33
+ step:: Union{Int64, Missing} = missing ):: Bool =
34
+ logmetric (instance, run. info. run_id, key, value; timestamp= timestamp,
35
+ step= step)
29
36
30
37
"""
31
38
logbatch(instance::MLFlow, run_id::String;
@@ -38,18 +45,33 @@ Log a batch of metrics, params, and tags for a run. In case of error, partial
38
45
data may be written.
39
46
40
47
For more information about this function, check [MLFlow official documentation](https://mlflow.org/docs/latest/rest-api.html#log-batch).
48
+
49
+ # Arguments
50
+ - `instance`: [`MLFlow`](@ref) configuration.
51
+ - `run_id`: ID of the run to log under.
52
+ - `metrics`: Metrics to log.
53
+ - `params`: Params to log.
54
+ - `tags`: Tags to log.
55
+
56
+ **Note**: A single request can contain up to 1000 metrics, and up to 1000
57
+ metrics, params, and tags in total.
58
+
59
+ # Returns
60
+ `true` if successful. Otherwise, raises exception.
41
61
"""
42
- logbatch (instance:: MLFlow , run_id:: String ;
62
+ function logbatch (instance:: MLFlow , run_id:: String ;
43
63
metrics:: MLFlowUpsertData{Metric} = Metric[],
44
64
params:: MLFlowUpsertData{Param} = Param[],
45
- tags:: MLFlowUpsertData{Tag} = Tag[]) =
65
+ tags:: MLFlowUpsertData{Tag} = Tag[]):: Bool
46
66
mlfpost (instance, " runs/log-batch" ; run_id= run_id,
47
67
metrics= parse (Metric, metrics), params= parse (Param, params),
48
68
tags= parse (Tag, tags))
69
+ return true
70
+ end
49
71
logbatch (instance:: MLFlow , run:: Run ;
50
72
metrics:: MLFlowUpsertData{Metric} = Metric[],
51
73
params:: MLFlowUpsertData{Param} = Param[],
52
- tags:: MLFlowUpsertData{Tag} = Tag[]) =
74
+ tags:: MLFlowUpsertData{Tag} = Tag[]):: Bool =
53
75
logbatch (instance, run. info. run_id; metrics= metrics, params= params,
54
76
tags= tags)
55
77
@@ -61,8 +83,14 @@ logbatch(instance::MLFlow, run::Run;
61
83
- `instance`: [`MLFlow`](@ref) configuration.
62
84
- `run_id`: ID of the run to log under This field is required.
63
85
- `datasets`: Dataset inputs.
86
+
87
+ # Returns
88
+ `true` if successful. Otherwise, raises exception.
64
89
"""
65
- loginputs (instance:: MLFlow , run_id:: String , datasets:: Array{DatasetInput} ) =
90
+ function loginputs (instance:: MLFlow , run_id:: String ,
91
+ datasets:: Array{DatasetInput} ):: Bool
66
92
mlfpost (instance, " runs/log-inputs" ; run_id= run_id, datasets= datasets)
67
- loginputs (instance:: MLFlow , run:: Run , datasets:: Array{DatasetInput} ) =
93
+ return true
94
+ end
95
+ loginputs (instance:: MLFlow , run:: Run , datasets:: Array{DatasetInput} ):: Bool =
68
96
loginputs (instance, run. info. run_id, datasets)
0 commit comments