Skip to content

AggregationMetaInfo

## AggregationMetaInfo

The function presents the accuracy results of aggregation and stacking.

Parameters:

  • models_dict: dict
    A dictionary with LogitModel instances.
  • x_train: pd.DataFrame
    A pandas DataFrame with explanatory variables of the training set.
  • y_train: pd.Series
    A pandas Series with discrete dependent variable of the training set.
  • x_test: pd.DataFrame
    A pandas DataFrame with explanatory variables of the testing set.
  • y_test: pd.Series
    A pandas Series with discrete dependent variable of the testing set.

Returns:

  • final_data: pd.DataFrame
    A pandas DataFrame with accuracy results of different aggregation methods and stacking sorted by Gini.

Exceptions:

  • ValueError:
    Raised if the length of x_tarin and y_train are not identical
    Raised if the length of x_test and y_test are not identical

  • TypeError:
    Raised if x_train is not a pandas DataFrame object
    Raised if x_test is not a pandas DataFrame object
    Raised if y_train is not a pandas Series object
    Raised if y_test is not a pandas Series object

Example:

from combat.combat import AggregationMetaInfo
import pandas as pd

# Sample input data
models_dict = {1: model1  # LogitModel instance
              , 2: model2 # LogitModel instance
              , 3: model3 # LogitModel instance
              }
x_train = your_train_data
y_train = your_train_labels
x_test = your_test_data
y_test = your_test_labels

# Calculate accuracy results of aggregation and stacking
accuracy_info = AggregationMetaInfo(models_dict, x_train, y_train, x_test, y_test)
print("Accuracy Information:", accuracy_info)