資源簡介
多分類邏輯回歸.zip

代碼片段和文件信息
function?[h?display_array]?=?displayData(X?example_width)
%DISPLAYDATA?Display?2D?data?in?a?nice?grid
%???[h?display_array]?=?DISPLAYDATA(X?example_width)?displays?2D?data
%???stored?in?X?in?a?nice?grid.?It?returns?the?figure?handle?h?and?the?
%???displayed?array?if?requested.
%?Set?example_width?automatically?if?not?passed?in
if?~exist(‘example_width‘?‘var‘)?||?isempty(example_width)?
example_width?=?round(sqrt(size(X?2)));
end
%?Gray?Image
colormap(gray);
%?Compute?rows?cols
[m?n]?=?size(X);
example_height?=?(n?/?example_width);
%?Compute?number?of?items?to?display
display_rows?=?floor(sqrt(m));
display_cols?=?ceil(m?/?display_rows);
%?Between?images?padding
pad?=?1;
%?Setup?blank?display
display_array?=?-?ones(pad?+?display_rows?*?(example_height?+?pad)?...
???????????????????????pad?+?display_cols?*?(example_width?+?pad));
%?Copy?each?example?into?a?patch?on?the?display?array
curr_ex?=?1;
for?j?=?1:display_rows
for?i?=?1:display_cols
if?curr_ex?>?m?
break;?
end
%?Copy?the?patch
%?Get?the?max?value?of?the?patch
max_val?=?max(abs(X(curr_ex?:)));
display_array(pad?+?(j?-?1)?*?(example_height?+?pad)?+?(1:example_height)?...
??????????????pad?+?(i?-?1)?*?(example_width?+?pad)?+?(1:example_width))?=?...
reshape(X(curr_ex?:)?example_height?example_width)?/?max_val;
curr_ex?=?curr_ex?+?1;
end
if?curr_ex?>?m?
break;?
end
end
%?Display?Image
h?=?imagesc(display_array?[-1?1]);
%?Do?not?show?axis
axis?image?off
drawnow;
end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-06-22?08:05??多分類邏輯回歸\
?????文件????????1502??2013-11-12?01:39??多分類邏輯回歸\displayData.m
?????文件?????????963??2015-06-22?08:02??多分類邏輯回歸\ex3.m
?????文件?????7511764??2013-11-12?01:39??多分類邏輯回歸\ex3data1.mat
?????文件????????8749??2015-02-26?07:07??多分類邏輯回歸\fmincg.m
?????文件?????????412??2015-06-22?07:49??多分類邏輯回歸\lrCostFunction.m
?????文件????????1081??2015-06-22?08:02??多分類邏輯回歸\oneVsAll.m
?????文件?????????690??2015-06-22?08:01??多分類邏輯回歸\predictOneVsAll.m
?????文件?????????137??2013-11-12?01:39??多分類邏輯回歸\sigmoid.m
評論
共有 條評論