(self, choosers, alternatives, debug=False)
return pd.concat(results) if results else pd.Series()
Choose from among alternatives for a group of agents after
        segmenting the `choosers` table.

        Parameters
        ----------
        choosers : pandas.DataFrame
            Table describing the agents making choices, e.g. households.
            Must have a column matching the .segmentation_col attribute.
        alternatives : pandas.DataFrame
            Table describing the things from which agents are choosing.
        debug : bool
            If debug is set to true, will set the variable "sim_pdf" on
            the object to store the probabilities for mapping of the
            outcome.

        Returns
        -------
        choices : pandas.Series
            Mapping of chooser ID to alternative ID. Some choosers
            will map to a nan value when there are not enough alternatives
            for all the choosers.
Choose from among alternatives for a group of agents after
        segmenting the `choosers` table.
Choose from among alternatives for a group of agents after segmenting the choosers table .
def predict(self, choosers, alternatives, debug=False):
        """
        Choose from among alternatives for a group of agents after
        segmenting the `choosers` table.

        Parameters
        ----------
        choosers : pandas.DataFrame
            Table describing the agents making choices, e.g. households.
            Must have a column matching the .segmentation_col attribute.
        alternatives : pandas.DataFrame
            Table describing the things from which agents are choosing.
        debug : bool
            If debug is set to true, will set the variable "sim_pdf" on
            the object to store the probabilities for mapping of the
            outcome.

        Returns
        -------
        choices : pandas.Series
            Mapping of chooser ID to alternative ID. Some choosers
            will map to a nan value when there are not enough alternatives
            for all the choosers.

        """
        logger.debug('start: predict models in LCM group {}'.format(self.name))
        results = []

        for name, df in self._iter_groups(choosers):
            choices = self.models[name].predict(df, alternatives, debug=debug)
            if self.remove_alts and len(alternatives) > 0:
                alternatives = alternatives.loc[
                    ~alternatives.index.isin(choices)]
            results.append(choices)

        logger.debug(
            'finish: predict models in LCM group {}'.format(self.name))
        return pd.concat(results) if results else pd.Series()
def predict ( self , choosers , alternatives , debug = False ) : logger . debug ( 'start: predict models in LCM group {}' . format ( self . name ) ) results = [ ] for name , df in self . _iter_groups ( choosers ) : choices = self . models [ name ] . predict ( df , alternatives , debug = debug ) if self . remove_alts and len ( alternatives ) > 0 : alternatives = alternatives . loc [ ~ alternatives . index . isin ( choices ) ] results . append ( choices ) logger . debug ( 'finish: predict models in LCM group {}' . format ( self . name ) ) return pd . concat ( results ) if results else pd . Series ( )