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

  • Home
  • SEARCH
  • 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 6569327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:36:47+00:00 2026-05-25T14:36:47+00:00

I need to classify a dataset using Matlab MLP and show classification. The dataset

  • 0

I need to classify a dataset using Matlab MLP and show classification.

The dataset looks like

Click to view

What I have done so far is:

  1. I have create an neural network contains a hidden layer (two neurons
    ?? maybe someone could give me some suggestions on how many
    neurons are suitable for my example
    ) and a output layer (one
    neuron).

  2. I have used several different learning methods such as Delta bar
    Delta, backpropagation (both of these methods are used with or -out
    momentum and Levenberg-Marquardt.)

This is the code I used in Matlab(Levenberg-Marquardt example)

net = newff(minmax(Input),[2 1],{'logsig' 'logsig'},'trainlm');
net.trainParam.epochs = 10000;
net.trainParam.goal = 0;
net.trainParam.lr = 0.1;
[net tr outputs] = train(net,Input,Target);

The following shows hidden neuron classification boundaries generated by Matlab on the data, I am little bit confused, beacause network should produce nonlinear result, but the result below seems that two boundary lines are linear..

Click to view

The code for generating above plot is:

figure(1)
plotpv(Input,Target);
hold on
plotpc(net.IW{1},net.b{1});
hold off

I also need to plot the output function of the output neuron, but I am stucking on this step. Can anyone give me some suggestions?

Thanks in advance.

  • 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-25T14:36:47+00:00Added an answer on May 25, 2026 at 2:36 pm

    Regarding the number of neurons in the hidden layer, for such an small example two are more than enough. The only way to know for sure the optimum is to test with different numbers. In this faq you can find a rule of thumb that may be useful: http://www.faqs.org/faqs/ai-faq/neural-nets/

    For the output function, it is often useful to divide it in two steps:

    First, given the input vector x, the output of the neurons in the hidden layer is y = f(x) = x^T w + b where w is the weight matrix from the input neurons to the hidden layer and b is the bias vector.

    Second, you will have to apply the activation function g of the network to the resulting vector of the previous step z = g(y)

    Finally, the output is the dot product h(z) = z . v + n, where v is the weight vector from the hidden layer to the output neuron and n the bias. In the case of more than one output neurons, you will repeat this for each one.

    I’ve never used the matlab mlp functions, so I don’t know how to get the weights in this case, but I’m sure the network stores them somewhere. Edit: Searching the documentation I found the properties:

    • net.IW numLayers-by-numInputs cell array of input weight values
    • net.LW numLayers-by-numLayers cell array of layer weight values
    • net.b numLayers-by-1 cell array of bias values
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multiclass svm classification(6 class). I would like to classify it using
I have a Binary classification problem that I need to do in MATLAB. There
Need a little help with string formatting... I have a string like this: Bmw
I am using jQuery. Now I need to classify the two lists. If any
Let's say I have a dataset, which can be neatly classified using weka's J48
I need to classify words into their parts of speech. Like a verb, a
need ask you about some help. I have web app running in Net 2.0.
Need a function like: function isGoogleURL(url) { ... } that returns true iff URL
Need some help about with Memcache. I have created a class and want to
I have a join table that I'm using to find available services for an

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.