@classmethod
    def predict_from_cfg(cls, choosers, alternatives, cfgname,
                         alternative_ratio=2.0, debug=False):
        logger.debug('start: predict from configuration {}'.format(cfgname))
        lcm = cls.from_yaml(str_or_buffer=cfgname)

        if len(alternatives) > len(choosers) * alternative_ratio:
            logger.info(
                ("Alternative ratio exceeded: %d alternatives "
                 "and only %d choosers") %
                (len(alternatives), len(choosers)))
            idxes = np.random.choice(
                alternatives.index, size=len(choosers) * alternative_ratio,
                replace=False)
            alternatives = alternatives.loc[idxes]
            logger.info(
                "  after sampling %d alternatives are available\n" %
                len(alternatives))

        new_units = lcm.predict(choosers, alternatives, debug=debug)
        print("Assigned %d choosers to new units" % len(new_units.dropna()))
        logger.debug('finish: predict from configuration {}'.format(cfgname))
        return new_units, lcm
Returns an iterator of approximately n values v1, v2, ... vn,
dataset/ETHPy150Open UDST/urbansim/urbansim/models/dcm.py/MNLDiscreteChoiceModel.predict_from_cfg--crossover with--dataset/ETHPy150Open clips/pattern/pattern/metrics.py/smoothrange