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 8840763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:32:24+00:00 2026-06-14T10:32:24+00:00

I have a previous question here and I think im running into a problem

  • 0

I have a previous question here and I think im running into a problem because I cant shuffle the sample data and the indices of sample data (idx) at the same time.

I have a dataset called fulldata of which contains 49 thousand rows by 6 columns, I then have another dataset which is the class labels for fulldata (Book2) which contains numerous class labels which correspond to the exact rows in fulldata.

I wanted to only pick two class labels from fulldata (normal. and smurf.) of which I wanted 750 normal rows and 250 smurf rows.

I then wanted to shuffle randomly the new sample data (1000×6).

Up to this point was managed. But then I get stuck… Dan helped on the previous question but then I noticed that k1 outputs some of the other class labels from Book2 such as neptune etc and that shouldnt be the case… K1 should only contain smurf and normal class labels.

The reason why I ask this is because I want to use the baysian classifier in matlab and in order to use it I need:

Test_Data (unseen data)
Trainning_data (This is the sample data im trying to create above)
Target_class (this is the class labels that match exactly each row in sample data) 
  • 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-14T10:32:26+00:00Added an answer on June 14, 2026 at 10:32 am

    I think you want

    idx = [smurfIdx(a);normIdx(p)];
    

    And then make sure you use @Dan’s recommendation from the previous question, i.e.

    shuffle = randperm(1000);
    sample = sample(shuffle,:);
    K1 = Book2(idx (shuffle), :);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a related to a previous question I have asked here, see the
This question follows directly from my previous question here in SO . I think
I have come across html2canvas thanks to a previous question of mine. What I
As a followup to my previous question about determining camera parameters I have formulated
Related to my previous question , I have a string on the following format:
This is a follow up from my previous question I have this code basically
This question is related to my previous question . The storyline: I have an
I managed to get some help from a previous question and I have the
This is related to my previous question , but a different one. I have
In a follow-up to a previous question, let's say I have 3 tables, A,

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.