I used svmtrain in MATLAB R2016a, but now I'm using MATLAB R2019a. When use svmtrain like before I get an error that svmtrain does not exist.
What function replaced svmtrain in R2019a?
svmtrain() was deprecated and removed from the toolbox, hence it no longer works in newer versions of MATLAB. The official replacement is a suite of functions. You'll have to select which one you need depending on the problem requirements.
For one class SVM, it is fitcsvm
there is two important function for classifiaction data in matlab. insted of svmtrain in older version of matlab we use fitcsvm() in 2020ver:
https://www.mathworks.com/help/releases/R2019a/stats/fitcsvm.html
and here is replaced for svmclassify:
https://www.mathworks.com/help/releases/R2019a/stats/classreg.learning.classif.compactclassificationsvm.predict.html
Related
I am trying to construct a decision tree. I tried using the fitctree function and wrote:
ctree = fitctree(TrainingX,TrainingY);
such that TrainingX is the input matrix and TrainingY is the target matrix. An error appears saying that:
Undefined function 'fitctree' for input arguments of type 'double'.
I don't know what is the problem and what should I do to solve it. Could you please help me?
The reason why it is undefined is because fitctree requires the Statistics Toolbox in MATLAB. If you don't have the Statistics Toolbox, you can't use this function and you're SOL. Sorry!
Even with the Statistics Toolbox, fitctree is only available for recent editions of MATLAB (R2014a+). Check the release notes on the Statistics Toolbox for more details: http://www.mathworks.com/help/stats/release-notes.html. Go to where R2014a is and fully expand out all of the facts by clicking on Expand All. Where you see "Functions for classification methods and clustering", you'll see an entry for fitctree there.
The only option would be to upgrade your version of MATLAB to at least R2014a or above.
Good luck!
I would like to use the function evalclusters from the statistics toolbox in matlab, but matlab is unable to find the function when I call it.
help evalclusters
returns 'evalclusters not found.'
The statistics toolbox is installed [license('test','statistics_toolbox') returns '1'].
Thanks!
evalclusters was added with Matlab 2013b and extended with 2014a, it is not available in Matlab 2013a.
In case upgrading Matlab is not an option, current Octave Statistics package includes it as well. (Open-Source alternative to Matlab which basically uses the same syntax)
I am trying to compute the accuracy of the HMAX model. First, I used a simple nearest Neighbor Classifier, secondly the Support Vector Machine (SVM) classifier.
In my laptop, I have the 7.6.0(R2008a) MATLAB version, and I obtained great values of accuracy by using either the nearest neighbor or svm classifer. When I moved to work on my friend's laptop in which the R2013b matlab version is installed instead of 7.6.0(R2008a), I always got the same error by using the svm classifer.
Error in mexSVMTrain (line 1)
function [AlphaY, SVs, Bias, Parameters, nSV, nLabel] = mexSVMTrain(Samples, Labels, Parameters, Weight, Verbose)
Output argument "AlphaY" (and maybe others) not assigned during call to
"C:\Users\xxxx\Documents\MATLAB\aub matlab\osu-svm\mexSVMTrain.m>mexSVMTrain".
Please I need your help in order to resolve this problem. Any help will be very appreciated.
It's not a solution to your problem. Seems like the existed mexSVMTrain.dll in the old version Matlab needs to be recompiled to work in the new released version, but it is unclear how it is recompiled without any C source code for mexSVMTrain from OSU_SVM.
I would suggest you use libsvm for the SVM part instead.
I am trying to run a code which calls the function OLS. reg=ols(y,X). I am getting an error saying that ols is an undefined function for input of type double. Is ols a function in the econometrics toolbox or do we create a separate ols function? I have checked the working directory and the toolbox is added to the path. I don't know what the problem is.
I don't have ols either and I have the econometrics toolbox. I'm guessing you are looking for some functions in File Exchange, most likely the Toolkit on Econometrics and Economics Teaching.
Is fzero in the standard MATLAB package or is it part of the optimization package?
It's in both, but the supported arguments between them differ. You can compare at their respective documentation pages:
fzero (Standard Package)
fzero (Optimization Toolbox)
Can't it be both? (standard, with optimization extensions?)
A quick comparison shows that the optimization extension can take a "problem" input.