Module Expr Str ImportFrom alias ImportFrom alias Import alias identifier ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults kwarg body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad Call NameLoad NameLoad Str If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str keyword Str keyword NameLoad Assign NameStore Dict For TupleStore NameStore NameStore NameStore NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Dict Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad TupleLoad NameLoad Call NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str keyword Str keyword TupleLoad Num Num Num keyword NameLoad Assign NameStore Dict For TupleStore NameStore NameStore NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Dict Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str keyword Str keyword TupleLoad Num Num keyword NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad BinOpAdd Call NameLoad NameLoad Str Return Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str keyword Str keyword NameLoad Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore Dict For TupleStore NameStore NameStore NameStore NameLoad body If CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad Dict Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad Call NameLoad NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad BinOpAdd NameLoad Num NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad BinOpAdd NameLoad Num NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad BinOpAdd Call NameLoad NameLoad Str Return Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str keyword Str keyword NameLoad Assign NameStore ListLoad Assign NameStore ListLoad Assign NameStore Dict For TupleStore NameStore NameStore NameStore NameLoad body If CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad Dict Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad Call NameLoad NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad BinOpAdd NameLoad Num NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad BinOpAdd NameLoad Num NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad BinOpAdd Call NameLoad NameLoad Str Return Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword Call AttributeLoad NameLoad attr decorator_list
N/A N/A 
Base IO code for all datasets
 os.path dirname os.path join N/A numpy np Bunch N/A dict N/A N/A 
    Container object for datasets: dictionary-like object
    that exposes its keys and attributes.  __init__ N/A N/A self N/A kwargs N/A N/A N/A N/A dict __init__ self kwargs N/A N/A self __dict__ self N/A N/A load_movielens_r100k N/A N/A load_timestamp N/A False N/A N/A  Load and return the MovieLens dataset with
        100,000 ratings (only the user ids, item ids, timestamps
        and ratings).

    Parameters
    ----------
    load_timestamp: bool, optional (default=False)
        Whether it loads the timestamp.

    Return
    ------
    data: Bunch
        Dictionary-like object, the interesting attributes are:
        'data', the full data in the shape:
            {user_id: { item_id: (rating, timestamp),
                       item_id2: (rating2, timestamp2) }, ...} and
        'user_ids': the user labels with respective ids in the shape:
            {user_id: label, user_id2: label2, ...} and
        'item_ids': the item labels with respective ids in the shape:
            {item_id: label, item_id2: label2, ...} and
        DESCR, the full description of the dataset.

    Examples
    --------
    To load the MovieLens data::

    >>> from scikits.crab.datasets import load_movielens_r100k
    >>> movies = load_movielens_r100k()
    >>> len(movies['data'])
    943
    >>> len(movies['item_ids'])
    1682

     N/A base_dir N/A join N/A dirname __file__ data/ N/A load_timestamp N/A N/A data_m N/A N/A np loadtxt N/A base_dir movielens100k.data delimiter dtype int N/A data_movies N/A N/A N/A user_id item_id rating timestamp data_m N/A N/A N/A N/A data_movies setdefault user_id N/A N/A N/A N/A data_movies N/A user_id N/A item_id N/A timestamp N/A int rating N/A N/A data_m N/A N/A np loadtxt N/A base_dir movielens100k.data delimiter usecols N/A 0 1 2 dtype int N/A data_movies N/A N/A N/A user_id item_id rating data_m N/A N/A N/A N/A data_movies setdefault user_id N/A N/A N/A N/A data_movies N/A user_id N/A item_id N/A int rating N/A data_titles N/A N/A np loadtxt N/A base_dir movielens100k.item delimiter | usecols N/A 0 1 dtype str N/A data_t N/A N/A N/A item_id label data_titles N/A N/A N/A N/A data_t append N/A N/A int item_id label N/A data_titles N/A dict data_t N/A fdescr N/A open N/A N/A dirname __file__ /descr/movielens100k.rst N/A N/A Bunch data data_movies item_ids data_titles user_ids None DESCR N/A N/A fdescr read N/A load_sample_songs N/A N/A N/A N/A N/A  Load and return the songs dataset with
         49 ratings (only the user ids, item ids and ratings).

    Return
    ------
    data: Bunch
        Dictionary-like object, the interesting attributes are:
        'data', the full data in the shape:
            {user_id: { item_id: (rating, timestamp),
                       item_id2: (rating2, timestamp2) }, ...} and
        'user_ids': the user labels with respective ids in the shape:
            {user_id: label, user_id2: label2, ...} and
        'item_ids': the item labels with respective ids in the shape:
            {item_id: label, item_id2: label2, ...} and
        DESCR, the full description of the dataset.

    Examples
    --------
    To load the sample songs data::

    >>> from scikits.crab.datasets import load_sample_songs
    >>> songs = load_sample_songs()
    >>> len(songs['data'])
    8
    >>> len(songs['item_ids'])
    8

     N/A base_dir N/A join N/A dirname __file__ data/ N/A data_m N/A N/A np loadtxt N/A base_dir sample_songs.csv delimiter , dtype str N/A item_ids N/A N/A user_ids N/A N/A data_songs N/A N/A N/A user_id item_id rating data_m N/A N/A N/A user_id user_ids N/A N/A N/A N/A user_ids append user_id N/A N/A item_id item_ids N/A N/A N/A N/A item_ids append item_id N/A u_ix N/A N/A N/A user_ids index user_id 1 N/A i_ix N/A N/A N/A item_ids index item_id 1 N/A N/A N/A data_songs setdefault u_ix N/A N/A N/A N/A data_songs N/A u_ix N/A i_ix N/A float rating N/A data_t N/A N/A N/A no item_id N/A enumerate item_ids N/A N/A N/A N/A data_t append N/A N/A no 1 item_id N/A data_titles N/A dict data_t N/A data_u N/A N/A N/A no user_id N/A enumerate user_ids N/A N/A N/A N/A data_u append N/A N/A no 1 user_id N/A data_users N/A dict data_u N/A fdescr N/A open N/A N/A dirname __file__ /descr/sample_songs.rst N/A N/A Bunch data data_songs item_ids data_titles user_ids data_users DESCR N/A N/A fdescr read N/A load_sample_movies N/A N/A N/A N/A N/A  Load and return the movies dataset with
         n ratings (only the user ids, item ids and ratings).

    Return
    ------
    data: Bunch
        Dictionary-like object, the interesting attributes are:
        'data', the full data in the shape:
            {user_id: { item_id: (rating, timestamp),
                       item_id2: (rating2, timestamp2) }, ...} and
        'user_ids': the user labels with respective ids in the shape:
            {user_id: label, user_id2: label2, ...} and
        'item_ids': the item labels with respective ids in the shape:
            {item_id: label, item_id2: label2, ...} and
        DESCR, the full description of the dataset.

    Examples
    --------
    To load the sample movies data::

    >>> from scikits.crab.datasets import load_sample_movies
    >>> movies = load_sample_movies()
    >>> len(movies['data'])
    7
    >>> len(movies['item_ids'])
    6

     N/A base_dir N/A join N/A dirname __file__ data/ N/A data_m N/A N/A np loadtxt N/A base_dir sample_movies.csv delimiter ; dtype str N/A item_ids N/A N/A user_ids N/A N/A data_songs N/A N/A N/A user_id item_id rating data_m N/A N/A N/A user_id user_ids N/A N/A N/A N/A user_ids append user_id N/A N/A item_id item_ids N/A N/A N/A N/A item_ids append item_id N/A u_ix N/A N/A N/A user_ids index user_id 1 N/A i_ix N/A N/A N/A item_ids index item_id 1 N/A N/A N/A data_songs setdefault u_ix N/A N/A N/A N/A data_songs N/A u_ix N/A i_ix N/A float rating N/A data_t N/A N/A N/A no item_id N/A enumerate item_ids N/A N/A N/A N/A data_t append N/A N/A no 1 item_id N/A data_titles N/A dict data_t N/A data_u N/A N/A N/A no user_id N/A enumerate user_ids N/A N/A N/A N/A data_u append N/A N/A no 1 user_id N/A data_users N/A dict data_u N/A fdescr N/A open N/A N/A dirname __file__ /descr/sample_movies.rst N/A N/A Bunch data data_songs item_ids data_titles user_ids data_users DESCR N/A N/A fdescr read N/A