#NoPayJan Offer - Access all CloudxLab Courses for free between 1st to 31st JanEnroll Now >>
Now, we will split the data into training and test sets.
The iris dataset is divided into the following parts:
- feature_names, and other details
We are mostly interested in the data (which contains the samples divided into 4 features), and the target (which is the target variable, and contains the classes of flowers).
Here, the classes of flowers are 'setosa', 'versicolor', and 'virginica'. The features includes 'sepal length (cm)', 'sepal width (cm)', 'petal length (cm)', and 'petal width (cm)'.
data part of the dataset into
X variable, and
target part into
<< your code goes here >> = iris.data << your code goes here >> = iris.target
Next, split the
y variables into training and test sets using the
train_test_split function in a 70/30 ratio
X_train, X_test, y_train, y_test = train_test_split(<< your code goes here >>, y, test_size=<< your code goes here >>, random_state=42)
No hints are availble for this assesment
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here