build/lib/AutoMxL/Modelisation/Bagging.py
def bag_feature_importance(self, X):
        """Get features importance of the model by averaging importance of models fitted on the samples
        
        Parameters
        ----------
        X : DataFrame
            Input Dataset
            
        Returns
        -------
        dict
            {feature : importance}
            
        """
        # Init importance storage matrix
        mat_feat_imp = np.zeros((self.niter, len(X.columns)))

        #  for each fitted models
        for i in range(self.niter):
            # importances storage in matrix
            mat_feat_imp[i] = self.list_model[i].feature_importances_

        # Averaging importances
        list_feat_imp_moy = mat_feat_imp.sum(axis=0) / self.niter

        features_dict = dict(zip(X.columns, list_feat_imp_moy))

        return features_dict
Get features importance of the model by averaging importance of models fitted on the samples
        
        Parameters
        ----------
        X : DataFrame
            Input Dataset
            
        Returns
        -------
        dict
            {feature : importance}
            
        
Get features importance of the model by averaging importance of models fitted on the samples
Parameters

X : DataFrame
Input Dataset

Returns

dict
{feature : importance}
Get features importance of the model by averaging importance of models fitted on the samples Parameters X : DataFrame Input Dataset Returns dict { feature : importance }
def bag_feature_importance(self, X):
        mat_feat_imp = np.zeros((self.niter, len(X.columns)))
        for i in range(self.niter):
            mat_feat_imp[i] = self.list_model[i].feature_importances_
        list_feat_imp_moy = mat_feat_imp.sum(axis=0) / self.niter
        features_dict = dict(zip(X.columns, list_feat_imp_moy))
        return features_dict
def bag_feature_importance ( self , X ) : mat_feat_imp = np . zeros ( ( self . niter , len ( X . columns ) ) ) for i in range ( self . niter ) : mat_feat_imp [ i ] = self . list_model [ i ] . feature_importances_ list_feat_imp_moy = mat_feat_imp . sum ( axis = 0 ) / self . niter features_dict = dict ( zip ( X . columns , list_feat_imp_moy ) ) return features_dict
Get features importance of the model by averaging importance of models fitted on the samples
Parameters
Get features importance of the model by averaging importance of models fitted on the samples Parameters
"""Get features importance of the model by averaging importance of models fitted on the samples
        
        Parameters
        ----------
        X : DataFrame
            Input Dataset
            
        Returns
        -------
        dict
            {feature : importance}
            
        """ # Init importance storage matrix #  for each fitted models # importances storage in matrix # Averaging importances
self
X