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 ofx_tarinandy_trainare not identical
Raised if the length ofx_testandy_testare not identical -
TypeError:
Raised ifx_trainis not a pandas DataFrame object
Raised ifx_testis not a pandas DataFrame object
Raised ify_trainis not a pandas Series object
Raised ify_testis 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)