Skip to main content
The predict command loads a trained model and generates predictions on new input data, with support for various output formats.

Usage

Options

Output Formats

The command supports multiple output formats:
  • csv: Comma-separated values (default)
  • json: JSON array format
  • npy: NumPy binary format (requires NumPy)
If --format is not specified, the format is inferred from the output file extension.

Examples

Basic prediction

Predict with custom output

JSON output format

Large batch size for GPU

NumPy output format

CPU-only prediction

Input Data

The --input parameter accepts:
  • Single file: CSV, JSON, or other supported formats
  • Directory: Loads all compatible files in the directory

Error Handling

Model not found

Input data not found

Prediction error

Batch Processing

For large datasets, adjust batch size based on available memory:
Performance Tip: Larger batch sizes generally provide better throughput on GPUs, while smaller batches may be necessary for CPU or limited memory scenarios.

Prediction Pipeline

1. Load trained model

2. Make predictions

The model processes input data in batches and generates predictions.

3. Save results

Predictions are saved in the specified format and location.

Best Practices

1. Use appropriate batch sizes

Match batch size to your hardware capabilities:

2. Choose the right output format

3. Organize prediction outputs

Store predictions in organized directories:

4. Use auto device selection

Let Neurenix choose the best available device:

Integration Examples

Batch prediction script

Python integration

See Also