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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:05:18+00:00 2026-05-27T05:05:18+00:00

I have a Binary classification problem that I need to do in MATLAB. There

  • 0

I have a Binary classification problem that I need to do in MATLAB. There are two classes and the training data and testing data problems are from two classes and they are 2d coordinates drawn from Gaussian distributions.

The samples are 2D points and they are something like these (1000 samples for class A and 1000 samples for class B):
I am just posting some of them here:

5.867766 3.843014
5.019520 2.874257
1.787476 4.483156
4.494783 3.551501
1.212243 5.949315
2.216728 4.126151
2.864502 3.139245
1.532942 6.669650
6.569531 5.032038
2.552391 5.753817
2.610070 4.251235
1.943493 4.326230
1.617939 4.948345

If a new test data comes in, how should I classify the test sample?

P(Class/TestPoint) is proportional to P(TestPoint/Class) * (ProbabilityOfClass).

I am not sure of how we compute the P(Sample/Class) variable for the 2D coordinates given. Right now, I am using the formula

P(Coordinates/Class) = (Coordinates- mean for that class) / standard deviation of points in that class).

However, I am not getting very good test results with this. Am I doing anything wrong?

  • 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-05-27T05:05:19+00:00Added an answer on May 27, 2026 at 5:05 am

    That is the good method, however the formula is not correct, look at the multivariate gaussian distribution article on wikipedia:

    P(TestPoint|Class)=
    enter image description here,

    where enter image description here is the determinant of A.

     Sigma = classPoint*classPoint';
     mu = mean(classPoint,2);
     proba = 1/((2*pi)^(2/2)*det(Sigma)^(1/2))*...
             exp(-1/2*(testPoint-mu)*inv(Sigma)*(testPoint-mu)');
    

    In your case, since they are as many points in both class, P(class)=1/2

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

Sidebar

Related Questions

If you have binary data that you need to encode, what encoding scheme do
I have a binary data file and need to retrieve some data from it.
I have binary data in a file that I can read into a byte
There are N different classes that can be observed in my problem and my
I have some binary data produced as base-256 bytestrings in Python (2.x). I need
I have a binary file of doubles that I need to load using C++.
I have a problem with binary type. I have binary file with data. Every
I have binary data in a file (a list of 32-bit integer values) that
I already have binary data read from a file. Most of the examples I
I am using libsvm for music classification. I have chosen binary classification. In training

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.