Flash Sale: Flat 70% + Addl. 25% Off on all Courses | Use Coupon DS25 in Checkout | Offer Expires InEnroll 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)
Taking you to the next exercise in seconds...
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