AiDotNet

The comprehensive .NET machine learning library

AiDotNet provides everything you need to build, train, and deploy machine learning models in .NET applications.


Quick Navigation

Section Description
Getting Started Installation and first steps
Tutorials Step-by-step learning guides
API Reference Complete API documentation
Examples Code examples and samples

Features

  • Neural Networks: Dense, CNN, RNN, LSTM, Transformer architectures
  • Classical ML: Classification, Regression, Clustering, Dimensionality Reduction
  • Computer Vision: Image classification, object detection, segmentation
  • NLP: Text classification, embeddings, RAG pipelines
  • Audio: Speech recognition (Whisper), TTS, speaker diarization
  • Time Series: Forecasting, anomaly detection
  • GPU Acceleration: CUDA, OpenCL, Metal support
  • Cross-Platform: Windows, Linux, macOS

Installation

dotnet add package AiDotNet

Quick Example

using AiDotNet;
using AiDotNet.Classification;

// Train a classifier
var result = await new AiModelBuilder<double, Matrix<double>, Vector<double>>()
    .ConfigureModel(new RandomForestClassifier<double>(nEstimators: 100))
    .ConfigurePreprocessing()
    .ConfigureCrossValidation(new KFoldCrossValidator<double>(k: 5))
    .ConfigureDataLoader(new InMemoryDataLoader<double, Matrix<double>, Vector<double>>(features, labels))
    .BuildAsync();

// Make predictions
var prediction = result.Predict(newSample);

Try It Online

Check out the Interactive Playground to experiment with AiDotNet directly in your browser.