mlnet-predict 1.0.10

There is a newer version of this package available.
See the version list below for details.
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.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
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.11 237 1/7/2025
1.0.10 508 12/21/2024
1.0.9 305 12/19/2024
1.0.8 410 12/2/2024
1.0.7 534 5/24/2024
1.0.6 468 5/23/2024
1.0.5 444 5/23/2024
1.0.4 547 5/23/2024
1.0.2 426 5/23/2024
1.0.1 475 5/23/2024
1.0.0 474 5/23/2024