Skip to content

Commit

Permalink
respond to feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
gewarren committed Dec 18, 2024
1 parent 25c54a2 commit 3873697
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ To create an Azure Machine Learning workspace, the following are required:

An Azure Machine Learning compute is a cloud-based Linux VM used for training.

To create an Azure Machine Learning compute, the following are required:
To create an Azure Machine Learning compute, the following values are required:

- Name: A name for your compute between 2-16 characters. Names may only contain alphanumeric characters and hyphens.
- Compute size
- Compute size.

Model Builder can use one of the following GPU-optimized compute types:

Expand All @@ -44,10 +44,10 @@ To create an Azure Machine Learning compute, the following are required:
| Standard_NC24 | 24 | 224 | 1440 | 4 | 48 | 64 | 4 |

Visit the [NC-series Linux VM documentation](/azure/virtual-machines/nc-series?bc=%252fazure%252fvirtual-machines%252flinux%252fbreadcrumb%252ftoc.json&toc=%252fazure%252fvirtual-machines%252flinux%252ftoc.json) for more details on GPU optimized compute types.
- Compute priority
- Compute priority.

- Low-priority: Suited for tasks with shorter execution times. Can be impacted by interruptions and lack of availability. Usually costs less because it takes advantage of surplus capacity in Azure.
- Dedicated: Suited for tasks of any duration, but especially long-running jobs. Not impacted by interruptions or lack of availability. Usually costs more because it reserves a dedicated set of compute resources in Azure for your tasks.
- Low-priority: Suited for tasks with shorter execution times. Tasks can be impacted by interruptions and lack of availability. This option usually costs less because it takes advantage of surplus capacity in Azure.
- Dedicated: Suited for tasks of any duration, but especially long-running jobs. Tasks aren't impacted by interruptions or lack of availability. This option usually costs more because it reserves a dedicated set of compute resources in Azure for your tasks.

## Training

Expand Down
22 changes: 11 additions & 11 deletions docs/machine-learning/snippets/mldotnet-api/csharp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using Microsoft.ML;
using Microsoft.ML;
using Microsoft.ML.Data;

class Program
{
public class HouseData
public record HouseData
{
public float Size { get; set; }
public float Price { get; set; }
}

public class Prediction
public record Prediction
{
[ColumnName("Score")]
public float Price { get; set; }
Expand All @@ -21,23 +21,23 @@ static void Main(string[] args)

// 1. Import or create training data.
HouseData[] houseData = [
new HouseData() { Size = 1.1F, Price = 1.2F },
new HouseData() { Size = 1.9F, Price = 2.3F },
new HouseData() { Size = 2.8F, Price = 3.0F },
new HouseData() { Size = 3.4F, Price = 3.7F }
new() { Size = 1.1F, Price = 1.2F },
new() { Size = 1.9F, Price = 2.3F },
new() { Size = 2.8F, Price = 3.0F },
new() { Size = 3.4F, Price = 3.7F }
];
IDataView trainingData = mlContext.Data.LoadFromEnumerable(houseData);

// 2. Specify data preparation and model training pipeline.
var pipeline = mlContext.Transforms.Concatenate("Features", ["Size"])
EstimatorChain<RegressionPredictionTransformer<Microsoft.ML.Trainers.LinearRegressionModelParameters>> pipeline = mlContext.Transforms.Concatenate("Features", ["Size"])
.Append(mlContext.Regression.Trainers.Sdca(labelColumnName: "Price", maximumNumberOfIterations: 100));

// 3. Train model.
var model = pipeline.Fit(trainingData);
TransformerChain<RegressionPredictionTransformer<Microsoft.ML.Trainers.LinearRegressionModelParameters>> model = pipeline.Fit(trainingData);

// 4. Make a prediction.
var size = new HouseData() { Size = 2.5F };
var price = mlContext.Model.CreatePredictionEngine<HouseData, Prediction>(model).Predict(size);
HouseData size = new() { Size = 2.5F };
Prediction price = mlContext.Model.CreatePredictionEngine<HouseData, Prediction>(model).Predict(size);

Console.WriteLine($"Predicted price for size: {size.Size * 1000} sq ft = {price.Price * 100:C}k");

Expand Down

0 comments on commit 3873697

Please sign in to comment.