Get Model Learning Curve

Returns the metrics for each epoch in a model. These metrics show you the f1 score, accuracy, confusion matrix, test accuracy, and so on for each training iteration performed to create the model.

Response Body

Name

Type

Description

Available Version

data

array

Array of learningcurve objects.

2.0

object

string

Object returned; in this case list.

2.0

learningCurve Response Body

Name

Type

Description

Available Version

epoch

date

Epoch to which the metrics correspond.

2.0

epochResults

string

N/A

2.0

metricsData

object

Model metrics values.

2.0

object

string

Object returned; in this case, learningcurve.

2.0

metricsData Response Body

Name

Type

Description

Available Version

confusionMatrix

array

Array of integers that contains the correct and incorrect classifications for each label in the dataset based on testing done during the training process.

2.0

f1

array

Array of floats that contains the harmonic mean of precision and recall for each label in the dataset. The corresponding label for each value in this array can be found in the labels array. For example, the first f1 score in the f1 array corresponds to the first label in the labels array.

2.0

labels

array

Array of strings that contains the dataset labels. These labels correspond to the values in the f1, confusionMatrix, precision, and recall arrays.

2.0

macroF1

float

Model-level f1 score. Average of all the per-label f1 scores.

2.0

precision

array

Array of floats that contains per-label precision values.

2.0

recall

array

Array of floats that contains per-label recall values.

2.0

testAccuracy

float

Accuracy of the test data. From your initial dataset, by default, 20% of the data is set aside and isn't used during training to create the model. This 20% is then sent to the model for prediction. How often the correct prediction is made with this 20% is reported as testAccuracy.

2.0

testLoss

float

Summary of the errors made in predictions using the validation data. The lower the number value, the more accurate the model.

2.0

trainingAccuracy

float

Accuracy of the training data. By default, 80% of the data from your dataset is left after the test accuracy set is set aside. This 80% is then sent to the model for prediction. How often the correct prediction is made with this 80% is reported as trainingAccuracy.

2.0

trainingLoss

float

Summary of the errors made in predictions using the training and validation data. The lower the number value, the more accurate the model.

2.0

Use the labels array and the confusionMatrix array to build the confusion matrix for an epoch. The labels in the array become the matrix rows and columns. Here's what the confusion matrix for the first epoch in the results.

hourly-forecast

current-weather

five-day-forecast

hourly-forecast

0

2

1

current-weather

0

8

0

five-day-forecast

0

1

0

Page Through Results

By default, this call returns learning curve data for 25 epochs. If you want to page through the results, use the offset and count query parameters.

Name

Type

Description

Available Version

count

int

Number of epochs for which to return metrics. Maximum valid value is 25. If you specify a number greater than 25, the call returns metrics for 25 epochs. Optional.

2.0

offset

int

Index of the epoch from which you want to start paging. Optional.

2.0

Here's an example of these query parameters. If you omit the count parameter, the API returns 25 epochs. If you omit the offset parameter, paging starts at 0.

curl -X GET -H "Authorization: Bearer <TOKEN>" -H "Cache-Control: no-cache"  "https://api.einstein.ai/v2/language/datasets?offset=100&count=20"

For example, let's say you want to page through all of the learning curve results and show 20 at a time. The first call would have offset=0 and count=20, the second call would have offset=20 and count=20, and so on.

If you want to find out the total number of epochs that were performed to create a model, make the call the get the training status and use the lastEpochDone value. This value will give you an idea of how much paging you need to do. See Get Training Status.

Language