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.
Related
I encountered a very strange problem while using Matlab 2016a Using a neural network built into the Perceptron NNtool toolbox, I try to predict a nonlinear variable. However, during training, the values obtained are for testing and training and validation of NANs. I tried to change the learning speed and hide the layers, but nothing worked. Do you have any idea, why is this so? Any help is greatly appreciated!
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.
I have a following(fig 1) unlabeled training set which I am trying to detect the outliers, have come up with a procedure to label the data with 0:normal data and 1:outlier and want to train it with SVM.
I followed this instructions to train the SVM's model but when I am trying to predict the labels of same data I have trained the SVM it does not predict any(fig 2)!
fig 1: the support vectors after training
fig 2: the prediction of SVM model on the same data it has been training with
The output of prediction is not supposed to look like this!
The code I have used for prediction is:
out = predict(model, data');
Question:
What is wrong with my approach?
For what it worth, I have found the answer to my question and now its working fine.
The result of prediction after using a non-linear kernel, but I don't know why this happened?
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....