Module Expr Str Import alias Import alias identifier ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore BinOpMult AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr TupleLoad Call NameLoad NameLoad NameLoad For TupleStore NameStore TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareLt Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad NameLoad body Raise Call NameLoad Str Assign SubscriptStore NameLoad ExtSlice Index NameLoad Slice Call AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad attr SubscriptLoad NameLoad Index NameLoad Return NameLoad decorator_list
N/A N/A 
Various functions for fitting categorical models.
Put functions specific to logistic regression in multinomial_fitter
 N/A copy N/A numpy np sklearn.cross_validation StratifiedKFold N/A common_math predict_proba_cv N/A N/A clf X y n_folds N/A 5 N/A N/A 
    Returns an out-of-sample clf.predict_proba(X, y).

    Parameters
    ----------
    clf : sklearn classifier with a predict_proba method
    X : 2-D numpy array or DataFrame
    y : 1-D numpy array or Series
        Use this along with StratifiedKFold to determine splits.
    n_folds: int

    Returns
    -------
    probas : np.ndarray or series

    Note
    ----
    After folds are created, each training sets need to be large enough to
    contain at least one member of each class.  This happens iff the number
    of members of each class is less than or equal to n_folds.
     N/A N/A X _ N/A N/A common_math pandas_to_ndarray_wrap X N/A N/A y _ N/A N/A common_math pandas_to_ndarray_wrap y N/A n_classes N/A len N/A N/A np unique y N/A clf N/A N/A copy deepcopy clf N/A cv N/A StratifiedKFold y n_folds n_folds N/A probas N/A N/A np nan N/A N/A np ones N/A N/A len y n_classes N/A N/A i N/A train test N/A enumerate cv N/A N/A N/A N/A len N/A N/A np unique N/A y N/A train n_classes N/A N/A N/A ValueError Training set did not contain samples from all classes.Try decreasing the number of folds or use more data N/A N/A probas N/A N/A test N/A N/A N/A N/A N/A clf fit N/A X N/A train N/A y N/A train predict_proba N/A X N/A test N/A probas N/A