Interface IExperimentTracker<T>
- Namespace
- AiDotNet.Interfaces
- Assembly
- AiDotNet.dll
Defines the contract for experiment tracking systems that log machine learning experiments.
public interface IExperimentTracker<T>
Type Parameters
TThe numeric data type used for calculations (e.g., float, double).
Remarks
An experiment tracker records information about machine learning experiments including parameters, metrics, and artifacts to enable reproducibility and comparison of different training runs.
For Beginners: Think of an experiment tracker as a lab notebook for machine learning. Just like a scientist records their experimental conditions and results, an experiment tracker logs all the details of your machine learning model training - what settings you used, how well it performed, and what models you created.
Key capabilities include:
- Creating and managing experiments (groups of related training runs)
- Logging hyperparameters (settings used for training)
- Recording metrics (performance measurements over time)
- Storing artifacts (models, plots, data files)
- Comparing different training runs
- Reproducing previous experiments
Why experiment tracking matters:
- Helps you keep track of what you've tried
- Makes it easy to reproduce good results
- Enables comparison between different approaches
- Provides audit trail for model development
Methods
CreateExperiment(string, string?, Dictionary<string, string>?)
Creates a new experiment to organize related training runs.
string CreateExperiment(string name, string? description = null, Dictionary<string, string>? tags = null)
Parameters
namestringThe name of the experiment.
descriptionstringOptional description of the experiment's purpose.
tagsDictionary<string, string>Optional tags to categorize the experiment.
Returns
- string
The unique identifier for the created experiment.
Remarks
For Beginners: An experiment is a collection of related training runs. For example, you might create an experiment called "House Price Prediction" and then have multiple runs within it trying different algorithms or settings.
DeleteExperiment(string)
Deletes an experiment and all its associated runs.
void DeleteExperiment(string experimentId)
Parameters
experimentIdstringThe ID of the experiment to delete.
DeleteRun(string)
Deletes a specific run.
void DeleteRun(string runId)
Parameters
runIdstringThe ID of the run to delete.
GetExperiment(string)
Gets an existing experiment by its ID.
IExperiment GetExperiment(string experimentId)
Parameters
experimentIdstringThe unique identifier of the experiment.
Returns
- IExperiment
An IExperiment object containing experiment details.
GetRun(string)
Gets an existing run by its ID.
IExperimentRun<T> GetRun(string runId)
Parameters
runIdstringThe unique identifier of the run.
Returns
- IExperimentRun<T>
An IExperimentRun object containing run details.
ListExperiments(string?)
Lists all experiments, optionally filtered by criteria.
IEnumerable<IExperiment> ListExperiments(string? filter = null)
Parameters
filterstringOptional filter expression.
Returns
- IEnumerable<IExperiment>
A list of experiments matching the criteria.
ListRuns(string, string?)
Lists all runs in an experiment, optionally filtered by criteria.
IEnumerable<IExperimentRun<T>> ListRuns(string experimentId, string? filter = null)
Parameters
Returns
- IEnumerable<IExperimentRun<T>>
A list of runs matching the criteria.
SearchRuns(string, int)
Searches for runs across all experiments based on criteria.
IEnumerable<IExperimentRun<T>> SearchRuns(string filter, int maxResults = 100)
Parameters
filterstringFilter expression for searching runs.
maxResultsintMaximum number of results to return.
Returns
- IEnumerable<IExperimentRun<T>>
A list of runs matching the search criteria.
StartRun(string, string?, Dictionary<string, string>?)
Starts a new training run within an experiment.
IExperimentRun<T> StartRun(string experimentId, string? runName = null, Dictionary<string, string>? tags = null)
Parameters
experimentIdstringThe ID of the experiment this run belongs to.
runNamestringOptional name for this specific run.
tagsDictionary<string, string>Optional tags to categorize the run.
Returns
- IExperimentRun<T>
An IExperimentRun object for logging metrics and parameters.
Remarks
For Beginners: A run represents a single training session with specific settings. Each time you train a model with different parameters, you start a new run.