{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "np.set_printoptions(precision=3, linewidth=100)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Introducing the `ColumnTransformer`: applying different transformations to different features in a scikit-learn pipeline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "*This work is supported by the Université Paris-Saclay Center for Data Science*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "
\n",
"Short summary: the ColumnTransformer
, which allows to apply different transformers to different features, has landed in scikit-learn (the PR has been merged in master and this will be included in the upcoming release 0.20). \n",
"
\n", " | pclass | \n", "sex | \n", "age | \n", "fare | \n", "embarked | \n", "
---|---|---|---|---|---|
0 | \n", "1 | \n", "female | \n", "29.0000 | \n", "211.3375 | \n", "S | \n", "
1 | \n", "1 | \n", "male | \n", "0.9167 | \n", "151.5500 | \n", "S | \n", "
2 | \n", "1 | \n", "female | \n", "2.0000 | \n", "151.5500 | \n", "S | \n", "
3 | \n", "1 | \n", "male | \n", "30.0000 | \n", "151.5500 | \n", "S | \n", "
4 | \n", "1 | \n", "female | \n", "25.0000 | \n", "151.5500 | \n", "S | \n", "