Skip to content

Commit f6a2dd1

Browse files
committed
DOC Add correct styling to literals in README.
1 parent 19536ef commit f6a2dd1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This module provides a bridge between `Scikit-Learn <http://scikit-learn.org/sta
66

77
In particular, it provides:
88

9-
1. a way to map DataFrame columns to transformations, which are later recombined into features
10-
2. a way to cross-validate a pipeline that takes a pandas DataFrame as input.
9+
1. A way to map ``DataFrame`` columns to transformations, which are later recombined into features.
10+
2. A way to cross-validate a pipeline that takes a pandas ``DataFrame`` as input.
1111

1212
Installation
1313
------------
@@ -32,7 +32,7 @@ Import
3232
Import what you need from the ``sklearn_pandas`` package. The choices are:
3333

3434
* ``DataFrameMapper``, a class for mapping pandas data frame columns to different sklearn transformations
35-
* ``cross_val_score``, similar to `sklearn.cross_validation.cross_val_score` but working on pandas DataFrames
35+
* ``cross_val_score``, similar to ``sklearn.cross_validation.cross_val_score`` but working on pandas DataFrames
3636

3737
For this demonstration, we will import both::
3838

@@ -68,16 +68,16 @@ The mapper takes a list of pairs. The first is a column name from the pandas Dat
6868
... (['children'], sklearn.preprocessing.StandardScaler())
6969
... ])
7070

71-
The difference between specifying the column selector as `'column'` (as a simple string) and `['column']` (as a list with one element) is the shape of the array that is passed to the transformer. In the first case, a one dimensional array with be passed, while in the second case it will be a 2-dimensional array with one column, i.e. a column vector.
71+
The difference between specifying the column selector as ``'column'`` (as a simple string) and ``['column']`` (as a list with one element) is the shape of the array that is passed to the transformer. In the first case, a one dimensional array with be passed, while in the second case it will be a 2-dimensional array with one column, i.e. a column vector.
7272

73-
This behaviour mimics the same pattern as pandas' dataframes `__getitem__` indexing:
73+
This behaviour mimics the same pattern as pandas' dataframes ``__getitem__`` indexing:
7474

7575
>>> data['children'].shape
7676
(8,)
7777
>>> data[['children']].shape
7878
(8, 1)
7979

80-
Be aware that some transformers expect a 1-dimensional input (the label-oriented ones) while some others, like `OneHotEncoder` or `Imputer`, expect 2-dimensional input, with the shape `[n_samples, n_features]`.
80+
Be aware that some transformers expect a 1-dimensional input (the label-oriented ones) while some others, like ``OneHotEncoder`` or ``Imputer``, expect 2-dimensional input, with the shape ``[n_samples, n_features]``.
8181

8282
Test the Transformation
8383
***********************
@@ -161,7 +161,7 @@ Only columns that are listed in the DataFrameMapper are kept. To keep a column b
161161
Working with sparse features
162162
****************************
163163

164-
`DataFrameMapper`s will return a dense feature array by default. Setting `sparse=True` in the mapper will return a sparse array whenever any of the extracted features is sparse. Example:
164+
``DataFrameMapper``s will return a dense feature array by default. Setting `sparse=True` in the mapper will return a sparse array whenever any of the extracted features is sparse. Example:
165165
166166
>>> mapper4 = DataFrameMapper([
167167
... ('pet', CountVectorizer()),
@@ -195,7 +195,7 @@ Changelog
195195

196196
* Use ``sklearn.pipeline.Pipeline`` instead of copying its code. Resolves #43.
197197
* Raise ``KeyError`` when selecting unexistent columns in the dataframe. Fixes #30.
198-
* Return sparse feature array if any of the features is sparse and `sparse` argument is `True`. Defaults to `False` to avoid potential breaking of existing code. Resolves #34.
198+
* Return sparse feature array if any of the features is sparse and ``sparse`` argument is ``True``. Defaults to ``False`` to avoid potential breaking of existing code. Resolves #34.
199199
* Return model and prediction in custom CV classes. Fixes #27.
200200

201201

0 commit comments

Comments
 (0)