当前位置:首页>开发>正文

请教Matlab中SVM回归预测问题 怎么在MATLAB中做回归模型

2023-04-30 06:26:45 互联网 未知 开发

 请教Matlab中SVM回归预测问题 怎么在MATLAB中做回归模型

请教Matlab中SVM回归预测问题

en . -s 3是回归模型:

-s svm_type : set type of SVM (default 0)
0 -- C-SVC
1 -- nu-SVC
2 -- one-class SVM
3 -- epsilon-SVR
4 -- nu-SVR

==============
libsvm_options:
-s svm_type : set type of SVM (default 0)
0 -- C-SVC
1 -- nu-SVC
2 -- one-class SVM
3 -- epsilon-SVR
4 -- nu-SVR
-t kernel_type : set type of kernel function (default 2)
0 -- linear: u*v
1 -- polynomial: (gamma*u*v coef0)^degree
2 -- radial basis function: exp(-gamma*|u-v|^2)
3 -- sigmoid: tanh(gamma*u*v coef0)
4 -- precomputed kernel (kernel values in training_instance_matrix)
-d degree : set degree in kernel function (default 3)
-g gamma : set gamma in kernel function (default 1/k)
-r coef0 : set coef0 in kernel function (default 0)
-c cost : set the parameter C of C-SVC, epsilon-SVR, and nu-SVR (default 1)
-n nu : set the parameter nu of nu-SVC, one-class SVM, and nu-SVR (default 0.5)
-p epsilon : set the epsilon in loss function of epsilon-SVR (default 0.1)
-m cachesize : set cache memory size in MB (default 100)
-e epsilon : set tolerance of termination criterion (default 0.001)
-h shrinking: whether to use the shrinking heuristics, 0 or 1 (default 1)
-b probability_estimates: whether to train a SVC or SVR model for probability estimates, 0 or 1 (default 0)
-wi weight: set the parameter C of class i to weight*C, for C-SVC (default 1)
-v n: n-fold cross validation mode

怎么在MATLAB中做回归模型

y=[-6.33E-06
9.95E-07
1.85E-05
1.09E-05]

x1=[-2.28E-05
-6.33E-06
9.95E-07
1.85E-05]

x2=[1.33E-05
6.84E-06
7.86E-06
2.65E-05]

% y=a d1 d2 α1*x1 α2*x2 e
%根据你的公式 a d1 d2 e 只能被看成是一个数
%公式变为 y=c1*x1 c2*x2 c
c=regress(y,[x1 x2 ones(size(x1))])
disp( c1 c2 c3)
disp(c)

结果
c1 c2 c 0.6910 -0.6789 0.0000

也就是回归结果是
y=0.6910*x1-0.6789*x2

用matlab怎么做双对数回归模型,怎么求其中的参数?

%要求输入x1,x2,y,均按行向量输入x1u=log(x1)x2u=log(x2)yu=log(y)x0=ones(1,length(x1u))x=[x0,x1u,x2u]if rank(x)~=3 disp(方程组x的秩应为m 1)endb=pinv(x)*yuyn=x*byy=exp(yn)stem(y,b)hold onstem(yy,r)你试试看看还有没有什么问题

matlab进行回归分析

regress可以解决多元线性回归,非线性回归转换后也可以解
polyfit是一元的多项式回归,[p,S]=polyfit(x,y,2)
中的2是多项式中自变量的最高次数,即y=a b*x c*x^2

最新文章