Class OptimizationResult<T, TInput, TOutput>.DatasetResult
Represents detailed results and statistics for a specific dataset (training, validation, or test).
public class OptimizationResult<T, TInput, TOutput>.DatasetResult
- Inheritance
-
OptimizationResult<T, TInput, TOutput>.DatasetResult
- Inherited Members
Remarks
This nested class encapsulates all the data and statistics related to model performance on a specific dataset. It includes the input features (X), target values (Y), model predictions, and various statistical measures that quantify different aspects of model performance. These statistics include error metrics (such as mean squared error, mean absolute error), prediction quality metrics (such as R-squared, correlation), and basic descriptive statistics for both the actual and predicted values. This comprehensive collection of information allows for thorough analysis of model performance on the dataset.
For Beginners: This class stores all the details about how the model performs on a specific dataset.
For each dataset (training, validation, or test), this stores:
- The actual input data (X) and target values (Y)
- The model's predictions
- Various error measurements (how far predictions are from actual values)
- Statistics about prediction quality (how well the model captures patterns)
- Basic statistics about both actual values and predictions
This detailed information helps you:
- Understand exactly how well your model is performing
- Identify specific strengths and weaknesses
- Compare performance across different datasets
- Diagnose issues like overfitting or underfitting
Constructors
DatasetResult()
Initializes a new instance of the DatasetResult class with empty data structures.
public DatasetResult()
Remarks
This constructor creates a new DatasetResult instance and initializes all properties to empty data structures. It creates empty matrices and vectors for the data and predictions, and empty statistics objects for the various statistical measures. This provides a clean starting point for storing dataset results. The empty data structures will be populated with actual data and statistics during the evaluation of the model on the dataset.
For Beginners: This constructor creates a new dataset result object with empty defaults.
When a new DatasetResult is created:
- All data structures (matrices, vectors) are initialized as empty
- All statistics objects are initialized as empty
This initialization is important because:
- It ensures consistent behavior regardless of how the object is created
- It prevents potential issues with uninitialized values
- It provides a clean slate for storing dataset results
You typically won't need to call this constructor directly, as it will be used internally when creating the OptimizationResult.
Properties
ActualBasicStats
Gets or sets the basic descriptive statistics for the actual target values.
public BasicStats<T> ActualBasicStats { get; set; }
Property Value
- BasicStats<T>
A BasicStats<T> object containing descriptive statistics for the actual values.
Remarks
This property contains basic descriptive statistics for the actual target values (Y) in the dataset. These statistics include measures such as mean, median, standard deviation, minimum, maximum, and others. They provide a summary of the distribution of the target variable and can be useful for understanding the data and interpreting the model's performance.
For Beginners: This contains summary statistics about the actual values in your dataset.
The actual basic statistics:
- Summarize the distribution of the actual target values
- Help you understand the data you're working with
- Provide context for interpreting model performance
Common statistics include:
- Mean: The average value
- Median: The middle value when sorted
- Standard Deviation: How spread out the values are
- Min/Max: The smallest and largest values
These statistics help you understand what you're trying to predict and provide context for evaluating your model's predictions.
ErrorStats
Gets or sets the error statistics for the model's predictions.
public ErrorStats<T> ErrorStats { get; set; }
Property Value
- ErrorStats<T>
An ErrorStats<T> object containing various error metrics.
Remarks
This property contains various error statistics that quantify the differences between the model's predictions and the actual target values. These statistics include measures such as mean squared error (MSE), root mean squared error (RMSE), mean absolute error (MAE), and others. Error statistics focus on the magnitude of prediction errors and provide different perspectives on the model's accuracy. Lower values for these metrics generally indicate better model performance.
For Beginners: This contains measurements of how far off your predictions are from the actual values.
The error statistics:
- Measure the size of prediction errors in different ways
- Lower values indicate better performance
- Different metrics emphasize different aspects of error
Common error metrics include:
- MSE (Mean Squared Error): Average of squared differences between predictions and actual values
- RMSE (Root Mean Squared Error): Square root of MSE, in the same units as the target variable
- MAE (Mean Absolute Error): Average of absolute differences between predictions and actual values
These metrics help you understand how accurate your model is and can guide you in improving it.
PredictedBasicStats
Gets or sets the basic descriptive statistics for the predicted values.
public BasicStats<T> PredictedBasicStats { get; set; }
Property Value
- BasicStats<T>
A BasicStats<T> object containing descriptive statistics for the predicted values.
Remarks
This property contains basic descriptive statistics for the model's predictions. These statistics include measures such as mean, median, standard deviation, minimum, maximum, and others. They provide a summary of the distribution of the predicted values and can be compared with the statistics for the actual values to assess how well the model captures the overall distribution of the target variable.
For Beginners: This contains summary statistics about your model's predictions.
The predicted basic statistics:
- Summarize the distribution of the values your model predicted
- Can be compared with the actual statistics to see if your model captures the overall distribution
- Help identify systematic biases in your predictions
Common statistics include:
- Mean: The average predicted value
- Median: The middle predicted value when sorted
- Standard Deviation: How spread out the predictions are
- Min/Max: The smallest and largest predictions
Comparing these with the actual statistics can reveal issues like:
- Predictions that are systematically too high or too low (comparing means)
- Predictions that don't capture the full range of variation (comparing standard deviations)
- Predictions that don't reach the extremes of the actual data (comparing min/max)
PredictionStats
Gets or sets the prediction quality statistics for the model.
public PredictionStats<T> PredictionStats { get; set; }
Property Value
- PredictionStats<T>
A PredictionStats<T> object containing various prediction quality metrics.
Remarks
This property contains various statistics that assess the quality of the model's predictions beyond simple error measurements. These statistics include measures such as R-squared (coefficient of determination), adjusted R-squared, correlation between predictions and actual values, and others. Prediction quality statistics focus on how well the model captures the patterns in the data and explains the variance in the target variable. Higher values for these metrics generally indicate better model performance.
For Beginners: This contains measurements of how well your model captures patterns in the data.
The prediction statistics:
- Assess how well your model explains the patterns in the data
- Higher values typically indicate better performance
- Focus on the relationship between predictions and actual values
Common prediction metrics include:
- R² (R-squared): Proportion of variance explained by the model (0-1, higher is better)
- Adjusted R²: R-squared adjusted for the number of predictors
- Correlation: How strongly predictions and actual values are related
These metrics help you understand how well your model captures the underlying patterns rather than just measuring error size.
Predictions
Gets or sets the model's predictions for the dataset.
public TOutput Predictions { get; set; }
Property Value
- TOutput
A vector of predicted values, one for each observation.
Remarks
This property contains the model's predictions for the dataset. Each element in the vector corresponds to an observation (row) in the input feature matrix X and represents the model's prediction for that observation. These predictions are compared with the actual target values (Y) to calculate various performance metrics and assess the model's accuracy.
For Beginners: This contains what your model predicted for each data point.
The predictions:
- Are the values your model output for each data point
- Each prediction corresponds to one row in the feature matrix
- Are compared to the actual values to measure performance
For example, if predicting house prices, this would contain your model's estimated price for each house in the dataset.
X
Gets or sets the input feature matrix for the dataset.
public TInput X { get; set; }
Property Value
- TInput
A matrix where each row represents an observation and each column represents a feature.
Remarks
This property contains the input feature matrix for the dataset, where each row represents an observation (data point) and each column represents a feature (input variable). This matrix contains the independent variables used to make predictions. It is stored to allow for further analysis, visualization, or reuse of the model with the same data.
For Beginners: This contains the input data used for making predictions.
The feature matrix:
- Contains all the input variables (features) for each data point
- Is organized with each row representing one observation
- Each column represents a different input variable
For example, if predicting house prices, this might contain features like square footage, number of bedrooms, location, etc. for each house.
Y
Gets or sets the target values for the dataset.
public TOutput Y { get; set; }
Property Value
- TOutput
A vector of target values, one for each observation.
Remarks
This property contains the target values (dependent variable) for the dataset. Each element in the vector corresponds to an observation (row) in the input feature matrix X. These are the actual values that the model attempts to predict. They are stored to allow for comparison with the model's predictions and calculation of various performance metrics.
For Beginners: This contains the actual values you're trying to predict.
The target values:
- Are what your model is trying to predict
- Each value corresponds to one row in the feature matrix
- Are used to calculate how accurate your predictions are
For example, if predicting house prices, this would contain the actual sale price for each house in your dataset.