mlnet-predict 1.0.10

dotnet tool install --global mlnet-predict --version 1.0.10                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local mlnet-predict --version 1.0.10                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=mlnet-predict&version=1.0.10                
nuke :add-package mlnet-predict --version 1.0.10                

MLNetPredict

MLNetPredict is a command-line tool for making predictions using trained ML.NET models. It supports various machine learning scenarios and provides a simple interface for batch predictions.

Features

  • Supports multiple ML.NET scenarios:
    • Classification (binary and multi-class)
    • Regression
    • Forecasting
    • Recommendation
    • Text Classification
    • Image Classification
    • Object Detection
  • Automatic handling of model dependencies
  • Flexible input/output options
  • Support for different data formats (CSV, TSV)
  • Header detection and delimiter customization

Installation

To install MLNetPredict, you can use the .NET CLI:

dotnet tool install --global mlnet-predict

Usage

Basic syntax:

mlnet-predict <model-path> <input-path> [options]

Required Arguments

  • model-path: Path to the directory containing the .mlnet model file
  • input-path: Path to the input file or directory (for image-based tasks)

Options

  • -o, --output-path: Path to the output file or directory (optional)
  • --has-header: Specify if dataset file(s) have header row [true|false]
  • --separator: Specify the separator character used in the dataset file(s)

Examples

  1. Basic Classification:
mlnet-predict "models/sentiment" "data/input.csv" --has-header true
  1. Image Classification with Custom Output:
mlnet-predict "models/image_classifier" "images/test" -o "results/predictions.csv"
  1. Forecasting with TSV Input:
mlnet-predict "models/forecast" "data/timeseries.tsv" --separator "\t"

Input Data Format

Text-based Tasks (Classification, Regression, etc.)

  • Supported formats: CSV, TSV
  • Files should contain the required features as columns
  • Headers can be included or excluded (use --has-header option)

Image-based Tasks

  • Supported formats: JPG, JPEG, PNG, BMP, GIF
  • Input should be a directory containing image files
  • Output will be a CSV file with predictions for each image

Output Format

The output format varies depending on the machine learning task:

Classification

PredictedLabel,Score

For multi-class classification:

Top1,Top1Score,Top2,Top2Score,Top3,Top3Score

Regression/Recommendation

Score

Forecasting

PredictedValue,LowerBound,UpperBound

Image Classification

ImagePath,PredictedLabel

Object Detection

ImagePath,PredictedLabels,BoundingBoxes,Scores

Error Handling

The tool provides detailed error messages for common issues:

  • Missing or invalid model files
  • Unsupported input formats
  • Invalid data format
  • Missing required columns
  • Model loading errors
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.0.10 420 12/21/2024
1.0.9 258 12/19/2024
1.0.8 386 12/2/2024
1.0.7 533 5/24/2024
1.0.6 466 5/23/2024
1.0.5 442 5/23/2024
1.0.4 546 5/23/2024
1.0.2 424 5/23/2024
1.0.1 473 5/23/2024
1.0.0 472 5/23/2024