ComeçarComece de graça

Generate a 2d uniformly distributed dataset.

The aim of this lesson is to create a dataset that will be used to illustrate the basic principles of support vector machines. In this exercise we will do the first step, which is to create a 2 dimensional uniformly distributed dataset containing 600 datapoints.

Este exercício faz parte do curso

Support Vector Machines in R

Ver curso

Instruções do exercício

  • Set the number of data points, n.
  • Generate a dataframe df with two uniformly distributed variables, x1 and x2 lying in (0, 1).

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

#set seed
set.seed(42)

#set number of data points. 
n <- ___

#Generate data frame with two uniformly distributed predictors lying between 0 and 1.
df <- data.frame(x1 = ___, 
                 x2 = ___)
Editar e executar o código