资源简介

【模式识别小作业】逻辑回归模型(logistic regression model)+Matlab实现+UCI的Iris和Seeds数据集+分类问题 包含:完整全套代码+readme+报告

资源截图

代码片段和文件信息


clear;
clc;

data=load(‘iris1.txt‘); 
A1=data(:2); %Take the 2nd and 3rd attribute values to draw the picture
A2=data(:3); 

%Read previous calculation results
allattr=data(:1:4); 
beitadata=load(‘iris_baita.txt‘); 
baita=beitadata(:); 

m=1;
n=1;

for b=1:1:100 %Calculate the test results of the entire data set
    result(b)=baita(1)*allattr(b1)+baita(2)*allattr(b2)+baita(3)*allattr(b3)+baita(4)*allattr(b4)+baita(5);
    if result(b)<0  %The test result is negative and it means the first flower
        A1_shi(m)=A1(b1);
        A2_shi(m)=A2(b1);
        m=m+1;
    elseif result(b)>=0 %The test result is positive and it means the second flower
        A1_yuan(n)=A1(b1);
        A2_yuan(n)=A2(b1);
        n=n+1;
    end
end

%Draw various points
plo

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      21641  2019-10-06 16:34  1932938_JiahaoLu_assignment1\iris_dataset\image.jpg

     文件         55  2019-10-06 16:36  1932938_JiahaoLu_assignment1\iris_dataset\image_baita.txt

     文件       4551  2019-10-02 15:34  1932938_JiahaoLu_assignment1\iris_dataset\iris.data

     文件        784  2019-10-06 08:59  1932938_JiahaoLu_assignment1\iris_dataset\Iris.mat

     文件       1808  2019-10-06 08:59  1932938_JiahaoLu_assignment1\iris_dataset\iris1.txt

     文件         50  2019-10-06 10:13  1932938_JiahaoLu_assignment1\iris_dataset\iris_baita.txt

     文件        191  2019-10-06 10:32  1932938_JiahaoLu_assignment1\iris_dataset\iris_result.txt

     文件        368  2019-10-06 08:59  1932938_JiahaoLu_assignment1\iris_dataset\iris_test.txt

     文件       1440  2019-10-06 08:59  1932938_JiahaoLu_assignment1\iris_dataset\iris_train.txt

     文件       1765  2019-10-06 19:44  1932938_JiahaoLu_assignment1\iris_dataset\plotimage.m

     文件       4126  2019-10-06 19:33  1932938_JiahaoLu_assignment1\iris_dataset\regression.m

     文件        573  2019-10-06 20:19  1932938_JiahaoLu_assignment1\README.txt

     文件     196342  2019-10-06 23:35  1932938_JiahaoLu_assignment1\Report.docx

     文件       3249  2019-10-06 19:56  1932938_JiahaoLu_assignment1\seeds_dataset\regression.m

     文件        106  2019-10-06 19:57  1932938_JiahaoLu_assignment1\seeds_dataset\seeds_baita.txt

     文件       9300  2019-10-06 16:47  1932938_JiahaoLu_assignment1\seeds_dataset\seeds_dataset.txt

     文件       6345  2019-10-06 19:56  1932938_JiahaoLu_assignment1\seeds_dataset\seeds_dataset1.txt

     文件        275  2019-10-06 19:57  1932938_JiahaoLu_assignment1\seeds_dataset\seeds_result.txt

     文件        913  2019-10-06 19:56  1932938_JiahaoLu_assignment1\seeds_dataset\seeds_test.txt

     文件       5432  2019-10-06 19:56  1932938_JiahaoLu_assignment1\seeds_dataset\seeds_train.txt

     目录          0  2019-10-06 19:44  1932938_JiahaoLu_assignment1\iris_dataset

     目录          0  2019-10-06 23:36  1932938_JiahaoLu_assignment1\seeds_dataset

     目录          0  2019-10-06 23:35  1932938_JiahaoLu_assignment1

----------- ---------  ---------- -----  ----

               259314                    23


评论

共有 条评论