I am trying to solve a regression problem by comparing different machine learning algorithms. So far i have tried Linear Regression) (accuracy: 0.88) and SVM ( Accuarcy : 0.84). Now i am trying to neural network for the same problem but i am getting a very low accuracy ( around 1 Percent!) I cant seem to figure out if i am using the same data, then why am i getting such low acccuracy using the neural network?
I have tried using different number of neurons but nothing seems to work. Here is the neural network that i am using Neural Network
I expect the accuracy to be somewhere near to SVM and linear regression but it does not seem to work. My labels look like this labels
My features look like this. features.Here is the output of the neural network Neural Network Output
Looks like you are doing a regression task on your data, accuracy is a classification metric and can only be used for classification, not regression, so your results are meaningless and you cannot compare regressors using accuracy.
Just use another metric like mean squared error or mean absolute error.
Related
I am trying to run my neural network code but it showed an error. My code as per below.. wondering what i missed out. I am trying to predict the MSE value for the model and compare it with Linear regression.
I am reading a lot of articles about neural networks and I found very different information. I understand that the supervised neural network can be also regression and classification. In both cases I can use the sigmoid function but what is the difference?
A single-layer neural network is essentially the same thing as linear regression. That's because of how neural networks work: Each input gets weighted with a weight factor to produce an output, and the weight factors are iteratively chosen in such a way that the error (the discrepancy between the outputs produced by the model and the correct output that should be produced for a given input) is minimised. Linear regression does the same thing. But in a neural network, you can stack several of such layers on top of each other.
Classification is a potential, but by far not the only, use case for neural networks. Conversely, there are classification algorithms that don't use neural networks (e.g. K-nearest neighbours). The sigmoid function is often used as an activation function for the last layer in a classifier neural network.
I have created a couple of models in MATLAB Neural Network Toolbox with a hundred of inputs and 10 outputs that correspond to different classes. At the end, NN gives a plot regarding a performance which is a number. What does this measure correspond to? Is it sum of errors from each outputs?
How can I know if NN is classifying well?
The performance metric depends on the performance function set in the neural network toolbox parameters. For instance, if performFcn is 'mse' then it will use the mean square error as the performance metric. See http://uk.mathworks.com/help/nnet/ug/analyze-neural-network-performance-after-training.html for more information on how Matlab sets these parameters. In general, when using anything like Neural Networks, it is important to understand what it is trying to optimise, and how, to avoid problems such as overfitting. There are a lot of parameters to tune!
Have a look at this answer for more detailed information
I have read this line about neural networks :
"Although the perceptron rule finds a successful weight vector when
the training examples are linearly separable, it can fail to converge
if the examples are not linearly separable.
My data distribution is like this :The features are production of rubber ,consumption of rubber , production of synthetic rubber and exchange rate all values are scaled
My question is that the data is not linearly separable so should i apply ANN on it or not? is this a rule that it should be applied on linerly separable data only ? as i am getting good results using it (0.09% MAPE error) . I have also applied SVM regression (fitrsvm function in MATLAB)so I have to ask can SVM be used in forecasting /prediction or it is used only for classification I haven't read anywhere about using SVM to forecast , and the results for SVM are also not good what can be the possible reason?
Neural networks are not perceptrons. Perceptron is on of the oldest ideas, which is at most a single building block of neural networks. Perceptron is designed for binary, linear classification and your problem is neither the binary classification nor linearly separable. You are looking at regression here, where neural networks are a good fit.
can SVM be used in forecasting /prediction or it is used only for classification I haven't read anywhere about using SVM to forecast , and the results for SVM are also not good what can be the possible reason?
SVM has regression "clone" called SVR which can be used for any task NN (as a regressor) can be used. There are of course some typical characteristics of both (like SVR being non parametric estimator etc.). For the task at hand - both approaches (as well as any another regressor, there are dozens of them!) is fine.
I am using the neural network toolbox that Matlab provides. I trained a NARX neural network for time series problems. I am trying to predict future values using the inputs I am giving to the neural network.
I am able to see the error graphs and the response for the testing and validation samples, but how do I test new samples? How can I make a prediction using the trained neural network? I could not find any documentation.
This was my attempt
>> net(input2')
ans =
[917.9814]
But no matter what the inputs are, I am getting the exact same output always....