Skip to content

Commit fdbff71

Browse files
committed
revise linear regression ex
1 parent 1cb09cb commit fdbff71

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

mlflow/examples/LinearRegressionExample.js

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/**
2-
* @fileoverview Example of using MLflow.js for machine learning experiment tracking
3-
* This example demonstrates a simple linear regression model using TensorFlow.js
4-
* with MLflow tracking. It showcases:
2+
* @fileoverview Example of using MLflow.js for machine learning projects
3+
* The example creates a synthetic dataset and trains a linear regression model using TensorFlow.js,
4+
* tracking various metrics and parameters throughout the training process with MLflow tracking server.
5+
* It showcases:
56
* - Experiment and run management
67
* - Hyperparameter logging
78
* - Metric tracking
9+
* - Tagging
10+
* - Model registry
811
* - Model versioning
912
* - Artifact storage
1013
*
11-
* The example creates a synthetic dataset and trains a linear regression model,
12-
* tracking various metrics and parameters throughout the training process.
13-
*
1414
* @requires @tensorflow/tfjs-node
15-
* @requires mlflow-js
1615
*
1716
* @note Ensure MLflow server is running at http://localhost:5001 before executing
1817
*/
@@ -71,7 +70,7 @@ function createModel() {
7170
model.compile({
7271
optimizer: tf.train.sgd(HYPERPARAMETERS.learningRate),
7372
loss: 'meanSquaredError',
74-
metrics: ['mse', 'mae'],
73+
metrics: ['mae'],
7574
});
7675

7776
return model;
@@ -93,12 +92,6 @@ async function trainModel(model, xTrain, yTrain, runId) {
9392
timestamp: Date.now(),
9493
step: epoch,
9594
},
96-
{
97-
key: 'train_mse',
98-
value: logs.mse,
99-
timestamp: Date.now(),
100-
step: epoch,
101-
},
10295
{
10396
key: 'train_mae',
10497
value: logs.mae,
@@ -111,12 +104,6 @@ async function trainModel(model, xTrain, yTrain, runId) {
111104
timestamp: Date.now(),
112105
step: epoch,
113106
},
114-
{
115-
key: 'val_mse',
116-
value: logs.val_mse,
117-
timestamp: Date.now(),
118-
step: epoch,
119-
},
120107
{
121108
key: 'val_mae',
122109
value: logs.val_mae,

0 commit comments

Comments
 (0)