Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Evaluate the Model with Cross-Validation | Modeling
ML Introduction with scikit-learn
course content

Conteúdo do Curso

ML Introduction with scikit-learn

ML Introduction with scikit-learn

1. Machine Learning Concepts
2. Preprocessing Data with Scikit-learn
3. Pipelines
4. Modeling

Evaluate the Model with Cross-Validation

In this challenge, you will build and evaluate a model using both train-test evaluation and cross-validation.
The data is an already preprocessed Penguins dataset.
Some functions you will use:

Tarefa

Build a 4-nearest neighbors classifier and evaluate its performance using the cross-validation score first, then split the data into train-test sets, train the model using the training set, and evaluate it using the test set.

  1. Initialize a KNeighborsClassifier with 4 neighbors.
  2. Calculate the cross-validation scores of this model with the number of folds set to 3.
    Note: you can pass an untrained model to a cross_val_score() function.
  3. Use a suitable function to split X, y.
  4. Train the model using the training set.
  5. Evaluate the model using the test set.

Tarefa

Build a 4-nearest neighbors classifier and evaluate its performance using the cross-validation score first, then split the data into train-test sets, train the model using the training set, and evaluate it using the test set.

  1. Initialize a KNeighborsClassifier with 4 neighbors.
  2. Calculate the cross-validation scores of this model with the number of folds set to 3.
    Note: you can pass an untrained model to a cross_val_score() function.
  3. Use a suitable function to split X, y.
  4. Train the model using the training set.
  5. Evaluate the model using the test set.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Seção 4. Capítulo 5
toggle bottom row

Evaluate the Model with Cross-Validation

In this challenge, you will build and evaluate a model using both train-test evaluation and cross-validation.
The data is an already preprocessed Penguins dataset.
Some functions you will use:

Tarefa

Build a 4-nearest neighbors classifier and evaluate its performance using the cross-validation score first, then split the data into train-test sets, train the model using the training set, and evaluate it using the test set.

  1. Initialize a KNeighborsClassifier with 4 neighbors.
  2. Calculate the cross-validation scores of this model with the number of folds set to 3.
    Note: you can pass an untrained model to a cross_val_score() function.
  3. Use a suitable function to split X, y.
  4. Train the model using the training set.
  5. Evaluate the model using the test set.

Tarefa

Build a 4-nearest neighbors classifier and evaluate its performance using the cross-validation score first, then split the data into train-test sets, train the model using the training set, and evaluate it using the test set.

  1. Initialize a KNeighborsClassifier with 4 neighbors.
  2. Calculate the cross-validation scores of this model with the number of folds set to 3.
    Note: you can pass an untrained model to a cross_val_score() function.
  3. Use a suitable function to split X, y.
  4. Train the model using the training set.
  5. Evaluate the model using the test set.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Seção 4. Capítulo 5
toggle bottom row

Evaluate the Model with Cross-Validation

In this challenge, you will build and evaluate a model using both train-test evaluation and cross-validation.
The data is an already preprocessed Penguins dataset.
Some functions you will use:

Tarefa

Build a 4-nearest neighbors classifier and evaluate its performance using the cross-validation score first, then split the data into train-test sets, train the model using the training set, and evaluate it using the test set.

  1. Initialize a KNeighborsClassifier with 4 neighbors.
  2. Calculate the cross-validation scores of this model with the number of folds set to 3.
    Note: you can pass an untrained model to a cross_val_score() function.
  3. Use a suitable function to split X, y.
  4. Train the model using the training set.
  5. Evaluate the model using the test set.

Tarefa

Build a 4-nearest neighbors classifier and evaluate its performance using the cross-validation score first, then split the data into train-test sets, train the model using the training set, and evaluate it using the test set.

  1. Initialize a KNeighborsClassifier with 4 neighbors.
  2. Calculate the cross-validation scores of this model with the number of folds set to 3.
    Note: you can pass an untrained model to a cross_val_score() function.
  3. Use a suitable function to split X, y.
  4. Train the model using the training set.
  5. Evaluate the model using the test set.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

In this challenge, you will build and evaluate a model using both train-test evaluation and cross-validation.
The data is an already preprocessed Penguins dataset.
Some functions you will use:

Tarefa

Build a 4-nearest neighbors classifier and evaluate its performance using the cross-validation score first, then split the data into train-test sets, train the model using the training set, and evaluate it using the test set.

  1. Initialize a KNeighborsClassifier with 4 neighbors.
  2. Calculate the cross-validation scores of this model with the number of folds set to 3.
    Note: you can pass an untrained model to a cross_val_score() function.
  3. Use a suitable function to split X, y.
  4. Train the model using the training set.
  5. Evaluate the model using the test set.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Seção 4. Capítulo 5
Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
We're sorry to hear that something went wrong. What happened?
some-alt