文件名称:L4_1
介绍说明--下载内容来自于网络,使用问题请自行百度
a)产生两个都具有200个二维向量的数据集和(注意:在生成数据集之前最好使用命令randn(‘seed’,0)初始化高斯随机生成器为0(或任意给定数值),这对结果的可重复性很重要)。向量的前半部分来自均值向量的正态分布,并且协方差矩阵。向量的后半部分来自均值向量的正态分布,并且协方差矩阵。其中是一个2*2的单位矩阵。
(b)在上述数据集上和分别属于+1类和-1类,请在上述数据集的两类中各随机抽取150个样本作为训练集,运用Logistic regression算法得到的分类面,然后对余下的各50个样本进行分类,画出测试样本及其分类面,统计错误率,给出每个样本属于该类别的概率值。(a) Generate the sum of two datasets with 200 two-dimensional vectors (Note: before generating the dataset, it is better to initialize the Gaussian random generator to 0 (or any given value) with the command randn ("seed", 0), which is important for the repeatability of the results). The first half of the vector comes from the normal distribution of the mean vector and the covariance matrix. The second half of the vector comes from the normal distribution of the mean vector and the covariance matrix. Where is a 2 * 2 identity matrix.
(b) On the above datasets, and belong to + 1 and - 1 classes respectively. Please randomly select 150 samples from each of the above data sets as the training set, use the logistic regression algorithm to get the classification surface, and then classify the remaining 50 samples, draw the test samples and their classification surface, count the error rate, and give the probability value of each sample belonging to this category.)
(b)在上述数据集上和分别属于+1类和-1类,请在上述数据集的两类中各随机抽取150个样本作为训练集,运用Logistic regression算法得到的分类面,然后对余下的各50个样本进行分类,画出测试样本及其分类面,统计错误率,给出每个样本属于该类别的概率值。(a) Generate the sum of two datasets with 200 two-dimensional vectors (Note: before generating the dataset, it is better to initialize the Gaussian random generator to 0 (or any given value) with the command randn ("seed", 0), which is important for the repeatability of the results). The first half of the vector comes from the normal distribution of the mean vector and the covariance matrix. The second half of the vector comes from the normal distribution of the mean vector and the covariance matrix. Where is a 2 * 2 identity matrix.
(b) On the above datasets, and belong to + 1 and - 1 classes respectively. Please randomly select 150 samples from each of the above data sets as the training set, use the logistic regression algorithm to get the classification surface, and then classify the remaining 50 samples, draw the test samples and their classification surface, count the error rate, and give the probability value of each sample belonging to this category.)
相关搜索: 罗杰斯特回归
(系统自动生成,下载前可以参看下载内容)
下载文件列表
文件名 | 大小 | 更新时间 |
---|---|---|
L4_1.py | 2928 | 2020-04-20 |
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.