Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Transformation Grid | Section
Practice
Projects
Quizzes & Challenges
Questionários
Challenges
/
Data Preprocessing and Feature Engineering

bookChallenge: Transformation Grid

Tarefa

Swipe to start coding

You are given the Titanic dataset from the seaborn library. Your goal is to perform data transformation using pandas and scikit-learn.

Perform the following steps:

  1. Load the dataset with sns.load_dataset("titanic").
  2. Fill missing values in age and embarked (mean and mode).
  3. Encode the categorical columns sex and embarked using pd.get_dummies() (drop the first category to avoid redundancy).
  4. Scale the numeric columns age and fare using StandardScaler.
  5. Create a new column family_size = sibsp + parch + 1.
  6. Return the transformed dataset as transformed_data.

Print .head() to preview the result.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 8
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

close

bookChallenge: Transformation Grid

Deslize para mostrar o menu

Tarefa

Swipe to start coding

You are given the Titanic dataset from the seaborn library. Your goal is to perform data transformation using pandas and scikit-learn.

Perform the following steps:

  1. Load the dataset with sns.load_dataset("titanic").
  2. Fill missing values in age and embarked (mean and mode).
  3. Encode the categorical columns sex and embarked using pd.get_dummies() (drop the first category to avoid redundancy).
  4. Scale the numeric columns age and fare using StandardScaler.
  5. Create a new column family_size = sibsp + parch + 1.
  6. Return the transformed dataset as transformed_data.

Print .head() to preview the result.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 8
single

single

some-alt