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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:47:19+00:00 2026-05-16T03:47:19+00:00

I have a training set that has input and outputs in this way: Input:

  • 0

I have a training set that has input and outputs in this way:

Input:
0.832 64.643
0.818 78.843
1.776 45.049
0.597 88.302
1.412 63.458
1.468 49.535
1.985 33.387
2.073 30.279
1.431 55.231
1.116 68.521
1.617 44.362
2.159 66.512

Output:
0 0 1
0 0 1
0 1 0
0 0 1
0 0 1
1 0 0
0 0 1
1 0 0
1 0 0
0 0 1
0 0 1
0 1 0
1 0 0
1 0 0
0 1 0
0 1 0

I need to implement one linear layer neural network that can represent the data set best in MATLAB. What would be the algorithm to do it in MATLAB?

The target output is “1 for a particular class that the corresponding input belongs to and “0 for the remaining 2 outputs.

  • 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-16T03:47:20+00:00Added an answer on May 16, 2026 at 3:47 am

    Consider this example of training a feed-forward ANN of one hidden layer (with 3 nodes).
    Since your data seems to have more output points than input, I’m using a demo dataset, but the idea is the same:

    %# load sample data
    laod simpleclass_dataset
    input = simpleclassInputs;          %# 2x1000, 2-dimensional points
    output = simpleclassTargets;        %# 4x1000, 4 classes
    
    %# split data into training/testing sets
    trainInd = 1:500;
    testInd = 501:1000;
    
    %# create ANN and initialize network weights
    net = newpr(input, output, 3);
    net = init(net);
    net.trainParam.epochs = 25;        %# max number of iterations
    
    %# learn net weights from training data
    net = train(net, input(:,trainInd), output(:,trainInd));
    
    %# predict output of net on testing data
    pred = sim(net, input(:,testInd));
    
    %# classification confusion matrix
    [err,cm] = confusion(output(:,testInd), pred);
    

    The output is:

    err =
         0.075075
    cm =
        81     0     0     0
         0    82     0     0
         9     0    52    16
         0     0     0    93
    

    Obviously you will need access to the Neural Network Toolbox.

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

Sidebar

Related Questions

Say you want to take CMU's phonetic data set input that looks like this:
I'm training code problems like UvA and I have this one in which I
I have a set of sensor signal samples (containing roughly 10 readings that both
I have a table called training . It has a column named locations .
I have a list-generic that has a property (class type). I need a sort
This problem has been bothering me for sometime now, I have not settled on
So I have a library I'm working on that has, or will have, optimised
I'm training with Azure environment and I have some trouble with the object CloudDriver
I have very little experience with ASP.NET and I am doing some self-training before
I have 2 data frames. One is training data ( pubs1 ), the other

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.