Table of Contents

Class AgentAssistanceOptionsBuilder

Namespace
AiDotNet.Models
Assembly
AiDotNet.dll

Provides a fluent interface for configuring which AI agent assistance features should be enabled during model building.

public class AgentAssistanceOptionsBuilder
Inheritance
AgentAssistanceOptionsBuilder
Inherited Members

Remarks

This builder class provides a chainable, fluent API for configuring agent assistance options. It allows you to selectively enable or disable specific agent capabilities such as data analysis, model selection recommendations, hyperparameter tuning suggestions, feature analysis, and meta-learning advice. By default, all features are disabled, requiring explicit opt-in for each capability you want to use. This design gives you fine-grained control over which AI assistance features are active and helps manage API costs by only enabling the features you need.

For Beginners: This class helps you choose which AI assistance features you want to use when building your machine learning models.

Think of it as a configuration menu where you can turn on or off different AI helper features:

  • Data Analysis: AI examines your data and points out patterns, issues, or characteristics
  • Model Selection: AI recommends which type of model would work best for your problem
  • Hyperparameter Tuning: AI suggests optimal settings for your chosen model
  • Feature Analysis: AI analyzes which input features are most important
  • Meta-Learning Advice: AI provides general best practices based on similar problems

Why use a builder:

  • You can chain method calls together for clean, readable code
  • You only pay for (and wait for) the AI features you actually use
  • You can easily enable/disable features without changing lots of code
  • All features start disabled for safety and cost control

For example, if you're building a house price prediction model and want AI help choosing the model and tuning it, but don't need data analysis, you would enable just ModelSelection and HyperparameterTuning. This keeps your API costs lower and makes the process faster.

Methods

Build()

Builds and returns the configured AgentAssistanceOptions instance.

public AgentAssistanceOptions Build()

Returns

AgentAssistanceOptions

An AgentAssistanceOptions instance with all configured settings.

Remarks

This method finalizes the configuration and returns the AgentAssistanceOptions object that can be passed to the AiModelBuilder. You typically call this method at the end of your fluent chain.

For Beginners: This finalizes your configuration choices and creates the options object.

You call this at the end of your configuration chain, like:

var options = new AgentAssistanceOptionsBuilder()
    .EnableDataAnalysis()
    .EnableModelSelection()
    .Build();

The returned options object is then passed to ConfigureAgentAssistance() in your model builder. Returns a fresh copy to prevent external mutation of builder state.

DisableDataAnalysis()

Disables AI-powered data analysis.

public AgentAssistanceOptionsBuilder DisableDataAnalysis()

Returns

AgentAssistanceOptionsBuilder

The current builder instance for method chaining.

Remarks

This method turns off data analysis assistance, useful if you want to disable a previously enabled feature or ensure it's explicitly disabled even if it was enabled by default in a template configuration.

DisableFeatureAnalysis()

Disables AI-powered feature analysis.

public AgentAssistanceOptionsBuilder DisableFeatureAnalysis()

Returns

AgentAssistanceOptionsBuilder

The current builder instance for method chaining.

Remarks

This method turns off feature analysis assistance, useful if you've already performed feature engineering or want to skip this analysis to reduce processing time and API costs.

DisableHyperparameterTuning()

Disables AI-powered hyperparameter tuning suggestions.

public AgentAssistanceOptionsBuilder DisableHyperparameterTuning()

Returns

AgentAssistanceOptionsBuilder

The current builder instance for method chaining.

Remarks

This method turns off hyperparameter tuning assistance, useful if you want to use default hyperparameters or have your own tuning strategy you prefer to follow.

DisableMetaLearningAdvice()

Disables AI-powered meta-learning advice.

public AgentAssistanceOptionsBuilder DisableMetaLearningAdvice()

Returns

AgentAssistanceOptionsBuilder

The current builder instance for method chaining.

Remarks

This method turns off meta-learning advice, useful if you're experienced with this type of problem or want to focus only on specific technical recommendations rather than general guidance.

DisableModelSelection()

Disables AI-powered model selection recommendations.

public AgentAssistanceOptionsBuilder DisableModelSelection()

Returns

AgentAssistanceOptionsBuilder

The current builder instance for method chaining.

Remarks

This method turns off model selection assistance, useful if you already know which model you want to use or want to reduce API calls and costs by skipping this feature.

EnableDataAnalysis()

Enables AI-powered data analysis that examines your dataset for patterns, anomalies, and characteristics.

public AgentAssistanceOptionsBuilder EnableDataAnalysis()

Returns

AgentAssistanceOptionsBuilder

The current builder instance for method chaining.

Remarks

When enabled, the AI agent will analyze your training data to identify characteristics such as data distributions, potential outliers, missing values, correlations between features, and other statistical properties. The agent provides insights about data quality issues and suggests preprocessing steps that might improve model performance.

For Beginners: This tells the AI to examine your data and give you insights about it.

What the AI looks for:

  • Unusual patterns or outliers (data points that don't fit the pattern)
  • Missing or invalid values
  • How your features relate to each other
  • Whether your data is balanced or skewed
  • Potential data quality issues

This is useful when:

  • You're working with unfamiliar data
  • You want to catch data quality issues early
  • You need guidance on data preprocessing
  • You want to understand your data better before modeling

For example, if you're predicting house prices, the AI might notice that 20% of your price values are missing, or that there's a very strong correlation between square footage and price.

EnableFeatureAnalysis()

Enables AI-powered feature analysis to identify important variables and suggest feature engineering improvements.

public AgentAssistanceOptionsBuilder EnableFeatureAnalysis()

Returns

AgentAssistanceOptionsBuilder

The current builder instance for method chaining.

Remarks

When enabled, the AI agent will analyze your input features to identify which ones are most important for predictions, detect redundant or highly correlated features, and suggest feature engineering techniques that might improve model performance. This can include recommendations for creating new features, transforming existing ones, or removing unhelpful features that add noise without predictive value.

For Beginners: This tells the AI to examine your input variables (features) and give advice about them.

What the AI analyzes:

  • Which features are most important for making predictions
  • Which features might be redundant or unhelpful
  • How features relate to each other
  • Whether creating new combined features would help

What you get:

  • Ranking of feature importance
  • Suggestions for new features to create (feature engineering)
  • Identification of features that could be removed
  • Recommendations for transforming features

This is useful when:

  • You have many features and want to know which matter most
  • You suspect some features aren't helping
  • You want ideas for improving your feature set
  • You're trying to simplify your model without losing accuracy

For example, when predicting house prices, the AI might tell you that square footage and location are very important, number of bathrooms is somewhat important, but exterior color doesn't matter at all. It might also suggest creating a new feature: "price per square foot" which could improve predictions.

EnableHyperparameterTuning()

Enables AI-powered hyperparameter tuning suggestions to optimize model configuration.

public AgentAssistanceOptionsBuilder EnableHyperparameterTuning()

Returns

AgentAssistanceOptionsBuilder

The current builder instance for method chaining.

Remarks

When enabled, the AI agent will suggest optimal hyperparameter values for your selected model based on your data characteristics and problem type. Hyperparameters are settings that control how the model learns, such as learning rate, tree depth, number of neurons, etc. The agent provides specific recommended values along with explanations of how each parameter affects model performance and why those values are appropriate.

For Beginners: This tells the AI to suggest the best settings for your chosen model.

What are hyperparameters:

  • Settings that control how your model learns (like learning speed, complexity, etc.)
  • Different from the parameters the model learns during training
  • Can dramatically affect how well your model performs
  • Usually require experimentation to find good values

How the AI helps:

  • Recommends specific values for each important setting
  • Explains what each setting does and why that value makes sense
  • Considers your data size, complexity, and characteristics
  • Saves you hours of manual tuning experiments

This is useful when:

  • You're using a complex model with many settings
  • You don't know where to start with hyperparameter values
  • You want to get better results without extensive manual tuning
  • You want to understand what each setting does

For example, if you're using a Random Forest, the AI might suggest using 100 trees with a max depth of 15, and explain that this balances model accuracy with avoiding overfitting for your dataset size.

EnableMetaLearningAdvice()

Enables AI-powered meta-learning advice that provides best practices and general recommendations.

public AgentAssistanceOptionsBuilder EnableMetaLearningAdvice()

Returns

AgentAssistanceOptionsBuilder

The current builder instance for method chaining.

Remarks

When enabled, the AI agent will provide high-level advice based on machine learning best practices and experiences with similar problems. This includes recommendations about data preprocessing, validation strategies, potential pitfalls to avoid, and general approaches that tend to work well for problems similar to yours. Meta-learning advice draws on patterns learned from many different machine learning projects.

For Beginners: This tells the AI to share general wisdom and best practices for your type of problem.

What you get:

  • General advice about your machine learning approach
  • Common mistakes to avoid for your type of problem
  • Recommended validation and testing strategies
  • Best practices from similar successful projects
  • Warnings about potential issues specific to your problem type

This is useful when:

  • You're tackling a new type of machine learning problem
  • You want to avoid common beginner mistakes
  • You need guidance on overall strategy, not just technical details
  • You want to benefit from experience with similar problems

For example, when building a time series forecasting model, the AI might advise:

  • Always split data chronologically, never randomly
  • Watch for seasonal patterns that repeat yearly
  • Consider testing on multiple time periods, not just one
  • Be careful about data leakage from future to past

This higher-level guidance complements the more specific technical recommendations from other features.

EnableModelSelection()

Enables AI-powered model selection recommendations based on your data characteristics and problem type.

public AgentAssistanceOptionsBuilder EnableModelSelection()

Returns

AgentAssistanceOptionsBuilder

The current builder instance for method chaining.

Remarks

When enabled, the AI agent will analyze your data and problem characteristics to recommend the most appropriate model type. The agent considers factors such as dataset size, feature dimensionality, linearity of relationships, presence of outliers, and computational constraints. It provides a recommended model type along with reasoning explaining why that model is a good fit for your specific use case.

For Beginners: This tells the AI to suggest which type of model would work best for your problem.

How it helps:

  • Recommends a specific model type (like Random Forest, Neural Network, etc.)
  • Explains why that model is a good choice for your data
  • Considers your data's characteristics (size, complexity, patterns)
  • Saves you from trying many models manually

This is useful when:

  • You're not sure which model to use
  • You want expert guidance on model selection
  • You're new to machine learning
  • You want to avoid obviously poor model choices

For example, if you have a small dataset with clear linear relationships, the AI might recommend Simple Regression and explain that more complex models would likely overfit with so little data.

Operators

implicit operator AgentAssistanceOptions(AgentAssistanceOptionsBuilder)

Implicitly converts the builder to an AgentAssistanceOptions instance.

public static implicit operator AgentAssistanceOptions(AgentAssistanceOptionsBuilder builder)

Parameters

builder AgentAssistanceOptionsBuilder

The builder to convert.

Returns

AgentAssistanceOptions

The configured AgentAssistanceOptions instance.

Remarks

This implicit conversion operator allows you to use the builder directly where an AgentAssistanceOptions is expected, without explicitly calling Build(). This makes the API more flexible and the code slightly cleaner.

For Beginners: This allows you to skip calling Build() in some cases.

Because of this operator, both of these work the same:

// Explicit Build() call
var options = new AgentAssistanceOptionsBuilder()
    .EnableDataAnalysis()
    .Build();

// Implicit conversion (no Build() needed)
AgentAssistanceOptions options = new AgentAssistanceOptionsBuilder()
    .EnableDataAnalysis();

C# automatically calls this conversion when needed, making your code slightly cleaner. Returns a fresh copy to prevent external mutation of builder state.