User Groups
- Apr 2: Ohio North Database Training
- Apr 4: Twin Cities .NET User Group
- Apr 10: Azure Cleveland
- Apr 18: GLUG.NET
- Apr 24: Cleveland C# User Group
Conferences
- May 3: Stir Trek
User Groups
Conferences
Machine learning tasks like regression and classification contain various algorithm implementations.
Some tasks may utilize the same algorithm, such as the SDCA algorithm in both Binary Classification and Regression tasks
In some cases, the problem you are trying to solve and the way your data is structured does not fit well into the current algorithm.
If so, consider using a different algorithm for your task to see if it learns better from your data.
A trainer identifies a single algorithm used for a single task (i.e. Trainer = Algorithm + Task).
Listed below is a summary of trainers available in ML.NET. For more info, see guidance on which algorithm to choose.
Trainer | Algorithm | Task | ONNX Exportable |
Binary classification | Yes | ||
Binary classification | Yes | ||
Multiclass classification | Yes | ||
Multiclass classification | Yes | ||
Regression | Yes | ||
Averaged Perceptron | Binary classification | Yes | |
Binary classification | Yes | ||
Multiclass classification | Yes | ||
Regression | Yes | ||
Symbolic stochastic gradient descent | Binary classification | Yes | |
Online gradient descent | Regression | Yes | |
Light gradient boosted machine | Binary classification | Yes | |
Light gradient boosted machine | Multiclass classification | Yes | |
Light gradient boosted machine | Regression | Yes | |
Light gradient boosted machine | Ranking | No | |
Fast Tree | Binary classification | Yes | |
Fast Tree | Regression | Yes | |
Fast Tree | Regression | Yes | |
Fast Tree | Ranking | No | |
Fast Forest | Binary classification | Yes | |
Fast Forest | Regression | Yes | |
Generalized additive model | Binary classification | No | |
Generalized Additive Model | Regression | No | |
Matrix Factorization | Recommendation | No | |
Field Aware Factorization Machine | Binary classification | No | |
One Versus All | Multiclass classification | Yes | |
Pairwise Coupling | Multiclass classification | No | |
KMeans | Clustering | Yes | |
Randomized Pca | Anomaly detection | No | |
Naive Bayes Multiclass | Multiclass classification | Yes | |
Prior | Binary classification | Yes | |
Linear Svm | Binary classification | Yes | |
Ld Svm | Binary classification | Yes | |
Ols | Regression | Yes |
Auto-GPT is an experimental project developed by Significant Gravitas. It’s an open-source Python application powered by GPT-4.
Unlike ChatGPT, Auto-GPT does not rely on human prompts to operate. It can self-prompt and tackle subsets of a problem without human intervention. It works by pairing GPT with AI agents that can make decisions and take actions based on a set of rules and predefined goals.
Auto-GPT is important and relevant because it showcases the potential of language models like GPT-4 to autonomously complete different types of tasks. It has the ability to write and execute its own code using GPT-4, allowing it to debug, develop, and self-improve recursively. One of the advantages of Auto-GPT is its ability to continuously self-improve. It can debug, develop, and enhance its own capabilities recursively.
Accessing Auto-GPT requires specific installed software and familiarity with Python, and an API key from OpenAI. It runs locally on a Mac, PC, or Docker image.
For a complete tutorial on how to use AutoGPT, visit https://youtu.be/v-5AWQlTFw8
For more info, see What is Auto-GPT and What Is the Difference Between ChatGPT vs Auto-GPT?
ML.Net has the capability of utilizing 7 different Machine Learning Tasks via the MLContext object:
Each task offers various performance metrics for evaluating the model after training is completed
These metrics are properties accessible via the Evaluate() method within each task object (i.e. MLContext.MLTask.Evaluate()
Sample Code Snippet
static void Main(string[] args)
{
MLContext mlContext = new MLContext();
// 1a. 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 } };
// 1b. Import training data
IDataView trainingData = mlContext.Data.LoadFromEnumerable(houseData);
// 2. Specify data preparation and model training pipeline
var pipeline = mlContext.Transforms.Concatenate("Features", new[] { "Size" })
.Append(mlContext.Regression.Trainers.Sdca(labelColumnName: "Price", maximumNumberOfIterations: 100));
// 3. Train model
var model = pipeline.Fit(trainingData);
//***** Model Evaluation
HouseData[] testHouseData =
{
new HouseData() { Size = 1.1F, Price = 0.98F },
new HouseData() { Size = 1.9F, Price = 2.1F },
new HouseData() { Size = 2.8F, Price = 2.9F },
new HouseData() { Size = 3.4F, Price = 3.6F }
};
var testHouseDataView = mlContext.Data.LoadFromEnumerable(testHouseData);
var testPriceDataView = model.Transform(testHouseDataView);
var metrics = mlContext.Regression.Evaluate(testPriceDataView, labelColumnName: "Price");
double rs = metrics.RSquared;
double rmse = metrics.RootMeanSquaredError;
}
Metrics Summary
Listed below is a summary of 6 various ML.NET Tasks and their metrics:
BinaryClassification | MulticlassClassification | Regression |
MAE (Mean Absolute Error) | ||
AreaUnderPrecisionRecallCurve | Log-Loss | MSE (Mean Squared Error) |
RMSE (Root Mean Square Error) |
Clustering | Ranking | AnomalyDetection |
Avg Distance | DCG | Area Under ROC Curve |
Davies Boulding Index | Normalized DCG | Detection Rate At False Positive Count |
NMI | | |
Reference: https://learn.microsoft.com/en-us/dotnet/machine-learning/resources/metrics
Microsoft introduced a new AI service called “Azure AI Content Safety Service” at the Build conference in May 2023. This new service will inspect for questionable content in any of the following categories.
The Content Safety service is intended to protect customers’ web sites and social media apps from receiving questionable comments or images.
Content maybe text, images, audio, video, or a combination of items (i.e. multi-modal).
Users can utilize filters to tweak the severity levels. For example, an outdoor equipment provider may allow images of knives or guns uploaded to their social media, but a school or church may like to prevent those images. Filters are set to Medium by default and can be increased. Turning the filter settings to be less restricted or turned off requires a written application to Microsoft to ensure the customer is trusted and low risk.
The AI Content Safety Service is built into Open AI and most Microsoft AI products. It’s used internally at Microsoft as well in public products like Bing Chat. The purpose is to uphold responsible AI principles provided by Microsoft.
using Azure;
using Azure.AI.ContentSafety;
using Microsoft.Extensions.Configuration;
using System.Reflection;
namespace AIContenSafety.ConsoleApp
{
internal class Program
{
static void Main(string[] args)
{
var config = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build();
string endpoint = config["AppSettings:endpoint"];
string key = config["AppSettings:key"];
string datapath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Images", "TestImage1.jpg");
ImageData image = new ImageData();
image.Content = BinaryData.FromBytes(File.ReadAllBytes(datapath));
var request = new AnalyzeImageOptions(image);
Response<AnalyzeImageResult> response;
try
{
ContentSafetyClient client = new ContentSafetyClient(new Uri(endpoint), new AzureKeyCredential(key));
response = client.AnalyzeImage(request);
}
catch (RequestFailedException ex)
{
Console.WriteLine("Analyze image failed.\nStatus code: {0}, Error code: {1}, Error message: {2}", ex.Status, ex.ErrorCode, ex.Message);
throw;
}
Console.WriteLine("Hate severity: {0}", response.Value.HateResult.Severity);
Console.WriteLine("SelfHarm severity: {0}", response.Value.SelfHarmResult.Severity);
Console.WriteLine("Sexual severity: {0}", response.Value.SexualResult.Severity);
Console.WriteLine("Violence severity: {0}", response.Value.ViolenceResult.Severity);
}
}
}
Provided in the solution is a folder containing a test image (shown below), called TestImage1.jpg. Naturally this image should be classified as violent content.
Executing the console application will load the test image specified above. All results are posted in the console window showing the type of content violating the safety guidelines. In addition, it shows the severity level of the content.
Get started in Studio https://aka.ms/contentsafetystudio
Visit product page to learn more https://aka.ms/contentsafety
Read the eBook https://aka.ms/contentsafetyebook