资源简介
参考我的个人博客:
分类器设计之logistic回归分析
http://blog.csdn.net/ranchlai/article/details/10022637
代码片段和文件信息
%
% Liscense Notification 2013
%
% Redistributions in source and binary forms with or without
% modification are totally FREE provided that you keep this keep this
% notification
%
% Descritption: This package demostrates how to use the logistic
% regression for classfication of 2D data.
% Author: Ranch Lai (ranchlai@hotmail.com)
% Release date: Aug 17 2013
%/
%%
clc;
clear;
close all;
%%
x = -10:0.1:10;
y = 1./(exp(-x)+1);
plot(xy‘g-x‘);
title(‘logistic function‘);
xlabel(‘x‘);ylabel(‘y‘);
%% generate random data
shift = 2;
n = 2;%2 dim
%y = 1./exp(-w‘*x+b)
N = 200;
x = [randn(nN/2)-shift randn(nN/2)*2+shift];
y = [zeros(N/21);ones(N/21)];
%show the data
figure;
plot(x(11:N/2)x(21:N/2)‘rs‘);
hold on;
plot(x(11+N/2:N)x(21+N/2:N)‘go‘);
title(‘2d training data‘);
%%
%training..
[wbcost] = logistic_train(xy1e-6100);
%%
disp(‘training ended‘);
figure;
plot(cost‘g-s‘);
xlabel(‘iterate‘);
ylabel(‘cost‘);
set(gca‘YScale‘‘log‘);
title(‘convergence curve‘);
%% plot the training data
figure;
plot(x(11:N/2)x(21:N/2)‘rs‘);
hold on;
plot(x(1N/2+1:N)x(2N/2+1:N)‘go‘);
%% visualize the classification aera
hold on;
for x = -shift*5:0.5:shift*5
for y=-shift*5:0.5:shift*5
if 1/(1+exp(w(1:2)‘*[x;y]+b)) > 0.5
plot(xy‘g.‘);
else
plot(xy‘r.‘);
end
end
end
title(‘classification result on training data‘);
%%
相关资源
- Logistic回归总结非常好的机器学习总结
- 标量场理论的回归和生成神经网络
- GM(11)模型与线性回归组合方法在矿
- 基于改进灰色模型的矿井瓦斯涌出量
- 果蝇优化算法优化支持向量回归程序
- 近代回归分析陈希孺
- 2009年第六届苏北数学建模联赛A题试题
- 基于神经网络及Logistic回归的混合信用
- 计量数据可用于经典线性回归模型的
- 案例数据-电影票房
- SVM算法-回归拟合程序.zip
- 基于曲线回归方程的矿井主排水泵永
- Logistic回归模型中拟合优度检验的无症
- 河北省地区收入差距影响因素的回归
- 基于Grid-Search_PSO优化SVM回归预测矿井
- 基于Ansys、FLAC3D和Fortran的某抽水蓄能
- 白垩系软岩交圈前冻结壁扩展速度研
- 时空地理加权回归软件及使用说明文
- 多分类Logistic回归及其统计推断
- GWR4.0软件32位
- 时空加权回归模型ARCGIS安装包
- 论文研究 - 肯尼亚阿西河镇当前和未
- 应用回归分析pdf
- 向量自回归模型VAR
- 偏最小二乘回归方法及其应用(书.王
- 基于神经网络的溶解度预测和回归分
- 线性统计模型 线性回归与方差分析
- 应用回归分析-何晓群
- 地理加权回归 (GWR)
- 1stopt 回归软件 破解版+适用教程.rar
评论
共有 条评论