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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package mlnet-predict --version 1.0.10
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 fileinput-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
- Basic Classification:
mlnet-predict "models/sentiment" "data/input.csv" --has-header true
- Image Classification with Custom Output:
mlnet-predict "models/image_classifier" "images/test" -o "results/predictions.csv"
- 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 | Versions 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.