Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8196975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:38:33+00:00 2026-06-07T05:38:33+00:00

I have a dataset (where each data is a vector of attributes with their

  • 0

I have a dataset (where each data is a vector of attributes with their corresponding class label). I want to split the dataset to a training set and testing set. Is there anyway to do this automatically ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:38:34+00:00Added an answer on June 7, 2026 at 5:38 am

    The typical way to split a modeling data set into training, validation, and test sets is to use a random sample. That is, assign a random number between 0 and 1. If you want a 40/30/30 split, then rows where the value is between 0 and 0.4 are in training, between 0.4 and 0.7 in validatino, and 0.7 and 1.0 in test. There is nothing magical about the 40/30/30 slpit. It just happens to be the default in SAS Enterprise Miner (in fact, I often change it to 60/30/10).

    There are some tweaks and possible improvements to this. If you know there are important features for modeling, such as geography, then you can do a stratified sample. For this, you would sort the data by the columns and then essentially do an “every nth” record sample. I say “essentially”, because this is a little more complicated for a 40% split. To handle this, take the record 10 at a time, choose 4 for the training set, 3 for the validation set, and 3 for the test set. Which particfular ones you choose from the 10 are not important.

    A bigger issue is when you have hierarchical data, and virtually all data used for modeling is hierarchies. For instance, you might have customer data with a significant number of columns describing the customer’s census tract. If these variables are important as predictors, then you might consider sampling at the census tract level, rather than the customer level. That is, divide the census tracts into three groups (randomly), so 40% of customers go to the training set, 30% to the validation set, and 30% to the test set.

    You want to be sure that you partition the data, and no record falls into more than one group. If you don’t know what training, validation, and test sets are, then I would highly recommend that you get a book on data mining (such as “Data Mining Techniques for Marketing, Sales, and Customer Support, Third Edition” at http://www.amazon.com/Data-Mining-Techniques-Relationship-Management/dp/0470650931/ref=pd_sim_b_5).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two data sets, each dataset contains the pixel values of an image.
I have a data set with over 50,000 geocoded points (lat-long). Each point has
I have a dataset with one datatable. Now I want to set a filter
I have a dataset of n data, where each data is represented by a
I have a dataset that returns questions and answers from the database, each answer
I have a dataset that i am trying to set the default value as
My dataset currently has 12 rows of data. Each representing data for a month.
So I have a list, each element of which is a numeric vector. Each
I have a dataset that is showing the correct data, but putting it into
I have a data set that looks like this: 000 100 200 300 010

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.