Enrollments closing soon for Post Graduate Certificate Program in Applied Data Science & AI By IIT Roorkee | 3 Seats Left
03 D 02 H : 57 M : 42 S Apply NowSo, as StratifiedShuffleSplit
is a class, we will first need to create an object of it.
The syntax of creating an object in Python is-
obj_name = Class_name(parameters)
You can refer to Python classes and objects to understand classed and object better.
Create an object of class StratifiedShuffleSplit
of name split_object
with parameters specified as-
n_splits = 1
- We specify it as 1
because we don;t want to perform cross validation here. We only want to perform stratified split.test_size = 0.2
- To split our dataset in a 80:20 train:test ratio.random_state = 42
- 42
is chosen arbitrarily.Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
Note - Having trouble with the assessment engine? Follow the steps listed here
Please login to comment
0 Comments
There are 2 new comments.