Andrew Ng coursera上的《机器学习》ex1

ex1 Coursera Machine-Learning exercise1 课后题答案 jupyter/python 版本 Andrew ng 吴恩达 吴恩达Machine-Learning 课后练习jupyter版本答案 exercise1(系列持续更新) 答案链接:exercise1 求个star For this programming exercise, you are only required to complete the first part of the exercise to implement linear regress... 阅读详情

Andrew Ng coursera上的《机器学习》ex1

本系列文章是在coursera上学习Andrew Ng的《机器学习》之后,对练习题进行了一些总结。我是初学者,所以肯定存在很多错误,欢迎大家能够给我提意见。

按照课程所给的ex1的文档要求,ex1要求完成以下几个计算过程的代码编写:

exerciseNamedescription
warmUpExercise.mSimple example function in Octave/MATLAB
plotData.mFunction to display the dataset
computeCost.mFunction to compute the cost of linear regression
gradientDescent.m
  • Function to run gradient descent

1. warmUpExercise.m

要求通过写Octave/MATLAB代码返回一个5阶的单位矩阵。

 X = eye(5);

2. plotData.m

要求将二维的训练数据的x和y用图展示出来。

function plotData(x, y)
%PLOTDATA Plots the data points x and y into a new figure 
%   PLOTDATA(x,y) plots the data points and gives the figure axes labels of
%   population and profit.

% ====================== YOUR CODE HERE ======================
% Instructions: Plot the training data into a figure using the 
%               "figure" and "plot" commands. Set the axes labels using
%               the "xlabel" and "ylabel" commands. Assume the 
%               population and revenue data have been passed in
%               as the x and y arguments of this function.
%
% Hint: You can use the 'rx' option with plot to have the markers
%       appear as red crosses. Furthermore, you can make the
%       markers larger by using plot(..., 'rx', 'MarkerSize', 10);

figure; % open a new figure window

plot(x,y,'rx','MarkerSize',10);
ylabel('Profit in $10,000s');
xlabel('Population of City in $10,000s');


% ============================================================

end

其中传入的参数X,Y分别用下面的代码求出:

data = load('ex1data1.txt');
X = data(:, 1); y = data(:, 2);
m = length(y); % number of training examples

3. computeCost.m

要求:计算出线性回归函数中对应于只有一个特征值(X是二维的)的情况进行计算。
代价函数表达式

function J = computeCost(X, y, theta)
%COMPUTECOST Compute cost for linear regression
%   J = COMPUTECOST(X, y, theta) computes the cost of using theta as the
%   parameter for linear regression to fit the data points in X and y

% Initialize some useful values
m = length(y); % number of training examples

% You need to return the following variables correctly 
J = 0;

% ====================== YOUR CODE HERE ======================
% Instructions: Compute the cost of a particular choice of theta
%               You should set J to the cost.

J = sum((X*theta-y).^2)/(2*m);



% =========================================================================

end

其中传入的参数分别为:

X = [ones(m, 1), data(:,1)]; % Add a column of ones to x
theta = zeros(2, 1); % initialize fitting parameters

% Some gradient descent settings
iterations = 1500;
alpha = 0.01;

其中的X是一个m*2的矩阵,theta是一个2 1的矩阵,所以m个数据集的h(x)= X theta,与之前描述的h(x) = (theta^T ) * X 有一定的区别,需要注意。这些是通过数学的推导得到的结果。

4.gradientDescent.m

利用批量梯度下降来对参数进行最优化求解。梯度下降的公式如下:
theta = theta - α * sum(h(x)-y)*x /m
其中的sum可以用求和符号表示。在Octave中,可以转为矩阵来进行计算。

function [theta, J_history] = gradientDescent(X, y, theta, alpha, num_iters)
%GRADIENTDESCENT Performs gradient descent to learn theta
%   theta = GRADIENTDESENT(X, y, theta, alpha, num_iters) updates theta by 
%   taking num_iters gradient steps with learning rate alpha

% Initialize some useful values
m = length(y); % number of training examples
J_history = zeros(num_iters, 1);

for iter = 1:num_iters

    % ====================== YOUR CODE HERE ======================
    % Instructions: Perform a single gradient step on the parameter vector
    %               theta. 
    %
    % Hint: While debugging, it can be useful to print out the values
    %       of the cost function (computeCost) and gradient here.
    %
theta = theta - alpha*X'*(X*theta-y)/m;






    % ============================================================

    % Save the cost J in every iteration    
    J_history(iter) = computeCost(X, y, theta);

end

其中传入的参数:

X = [ones(m, 1), data(:,1)]; % Add a column of ones to x
theta = zeros(2, 1); % initialize fitting parameters

% Some gradient descent settings
iterations = 1500;
alpha = 0.01;
Ex01 [coursera] Machine learning - Stanford University - Andrew Ng Linear Regression 目录 Part1 ex1.m plotData.m computeCost.m gradientDescent.m prompt output figure output Part2 ex1_multi.m featureNormalize.m computeCostMulti gradientDescentMulti.m no... 阅读详情

相关推荐

Andrew NG机器学习线性回归编程作业

备注: Coursera上Andrew Ng的机器学习课程有8次编程作业。本帖记录我练习过程中学到的知识,希望对大家有帮助。 背景 在本次练习中,需要实现一个单变量的线性回归。假设有一组历史数据,现需要预测在哪个城市中开店利润比较好? 历史数据如下:第一列表示城市人口数,单位为万人;第二列表示利润,单位为10,000$ 5.5277 9.1302 8.51

越努力越幸运越幸福 1563

吴恩达(Andrew Ng)《机器学习》课程笔记(1): 第1周——机器学习简介,单变量线性回归——梯度下降法

吴恩达(Andrew Ng)在 Coursera 上开设的机器学习入门课《Machine Learning》: 课程地址:https://www.coursera.org/learn/machine-learning 目录 一、引言 1.1、机器学习(Machine Learning) 2.1、监督学习(Supervised Learning) (1) 什么是监督学习? (2...

TechArtisan6的博客 3896

COURSERA- 吴恩达机器学习 Machine Learning by Andrew NG

COURSERA —— Machine Learning by Andrew NG Week 1 Introduction Lesson 1 Welcome machine learning -Grew out of work in ai -New capability for computers Examples: • Database mining ◦ Large datasets from growth of automation/web. e.g., Web click data, medical

weixin_41460195的博客 502

Andrew Ng机器学习记录(一)

Andrew Ng 机器学习记录共三篇。本篇是关于 Andrew Ng 机器学习网易云公开课前 6 章的总结。全部课程共 18 章。观看课程视频可点击 Coursera 和网易云课堂。网易云课堂目前仅翻译到正则化,这篇小结也只到正则化之前,点击 B 站获取完整版。 在进行小结之前,我们先看一下本次小结内容的目录(目录中文翻译源自网易云课...

weixin_34390105的博客 174

斯坦福机器学习编程作业machine-learning-ex1,Linear Regression,线性回归

斯坦福机器学习编程作业machine-learning-ex1,Linear Regression,线性回归题目,满分,2015最新作业答案

Coursera andrewNG机器学习2016个人笔记完整版

Coursera andrewNG机器学习2016个人笔记完整版v4.21

Stanford-Andrew Ng《Machine Learning》week1

前言:机器学习是目前最激动人心的技术之一,你也许没有意识到自己每天都会多次用到学习算法,每当你使用Google或百度等搜索引擎时,它总是能给出令人满意的结果,原因就是Google或百度等公司使用的学习算法,学会了如何给网页排序。每次你使用Facebook或苹果的相片分类功能,它能识别出你朋友的照片,这也是机器学习。每当你阅读邮件时,你的垃圾邮件过滤器会帮助你过滤掉大量的垃圾邮件,这也是学习算法。 ......

不期而遇 704

【实战指南】DBeaver EE Windows版高效破解与配置全解析

本文详细解析了DBeaver EE Windows版的高效破解与配置方法,涵盖Java环境配置、破解包部署、配置文件修改等关键步骤,并提供了性能优化和数据库连接的最佳实践。适用于需要解锁企业版高级功能的数据库开发人员,帮助提升工作效率。

weixin_28837817的博客 1901

Coursera上10个值得去学习的机器学习课程(有字幕)

除此之外你还将获得可共享证书和课程证书,课程视频和阅读材料、练习测验、带同伴反馈的评分作业、带反馈的评分测验、评分编程作业。完成后你将获得可共享证书和课程证书。除此之外,你还将获得课程视频和阅读材料、练习测验、带同伴反馈的评分作业、带反馈的评分测验、评分编程作业。完成后你将获得可共享证书和课程证书。除此之外,你还将获得课程视频和阅读材料、练习测验、带同伴反馈的评分作业、带反馈的评分测验、评分编程作业。除此之外,你还将获得课程视频和阅读材料、练习测验、带同伴反馈的评分作业、带反馈的评分测验、评分编程作业。

加百力 的技术博客 6064

Xilinx FPGA中利用JTAG实现MicroBlaze调试信息输出

本文详细介绍了在Xilinx FPGA开发中,如何利用JTAG接口为MicroBlaze软核处理器实现调试信息输出的完整方案。通过配置调试模块、设置Vitis软件工程以及使用XSCT工具,开发者可以建立一条不依赖外部硬件的可靠调试通道,有效解决早期硬件验证阶段串口不可用的问题,大幅提升调试效率。

weixin_29201859的博客 289

家庭宽带IPv6避坑指南:如何通过DHCPv6-PD获取公网地址(附OpenWRT配置)

本文详细解析了家庭宽带IPv6的地址分配机制,重点介绍了通过DHCPv6-PD获取公网地址的方法,并提供了OpenWRT路由器的具体配置步骤。从路由器通告(RA)标记位到前缀委派(PD)流程,帮助用户解决IPv6部署中的常见问题,实现稳定高效的IPv6网络连接。

backprop5master的博客 1191

探索Andrew Ng的《机器学习》课程实践:Machine_Learning_AndrewNg

探索Andrew Ng的《机器学习》课程实践:Machine_Learning_AndrewNg 去发现同类优质开源项目:https://gitcode.com/ 1. 项目介绍 在快速发展的科技时代,机器学习已经成为数据科学领域的基石。Machine_Learning_AndrewNg 是一个开源项目,它提供了Andrew Ng在其Coursera在线课程中的“机器学习”课程的家庭作业解决方案。...

gitblog_00066的博客 738

海康威视门禁考勤设备数据对接实战:从被动推送到主动拉取

本文深入探讨了海康威视门禁考勤设备数据对接的两种核心方案:HTTP推送与SDK主动拉取。文章对比了两种方式的适用场景、技术实现与优缺点,为开发者提供了从设备配置、代码编写到工程化部署的完整实战指南,帮助读者根据项目规模、网络环境及数据稳定性要求,做出最合适的技术选型。

weixin_29284657的博客 670

ML - Coursera Andrew Ng - Week1 & Week2 & Ex1 - Linear Regression - 笔记与代码

Week 1和Week 2主要讲解了机器学习中的一些基础概念,并介绍了线性回归算法(Linear Regression)。 机器学习主要分为三类: 监督学习(Supervised Learning):已知给定输入的数据集的输出结果。监督学习是学习输入和输出之间的映射关系。根据输出值的类型监督学习问题可分为回归(regression)问题和分类(classification)问题。如果输出值是连续...

我有一颗大橙子的博客 390

30天入门 SAP BTP 开发系列之一:SAP 开发顾问为什么要学习 SAP BTP 开发?能带来哪些收获?

国内 SAP 开发顾问们的微信朋友圈,最近可能都被 SAP 和阿里这两家巨头宣布合作的重磅消息刷屏了吧。近日,德国软件巨头SAP SE与中国电商巨头阿里巴巴集团宣布建立战略合作伙伴关系。根据协议,阿里巴巴集团将利用 SAP Cloud ERP Private 强化企业基础设施,并采用联合上市策略为全球客户创造卓越价值。阿里巴巴将集成 SAP Business Suite,以简化系统维护与升级流程,并实现 AI 功能与核心业务流程的无缝整合。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 2381

Yocto系列讲解[入门篇] 1 - 快速入门熟悉Yocto的构建

yocto quick start up带大家快速上手

fulinux的博客 5万+

ML - Coursera Andrew Ng - Week4 & Ex3 - Neural Network 1 - 笔记与代码

Week 4主要讲解了神经网络(Neural Network, NN),用于处理更复杂的非线性回归问题。 对于non-linear hypothesis,我们可以构建多项式来搭建模型,但是如果有很多features的话,logistic regression的代价会很昂贵,神经网络就可以用来处理更复杂的非线性模型。 Model Representation 通过神经网络来表达假设函数。基础的神经由...

我有一颗大橙子的博客 333

基于Cesium实现,动态水面+大坝排水动画

一、绘制面状水域,使用水波纹理,进行渲染,水体透明,可以看到底色。三、使用粒子系统,将喷泉改变方向,加上重力设置,实现排水动画。二、绘制线状三维体,用作模拟大坝拦截效果。四、最后,模拟水位上升,进行淹没分析,

一醉千秋的专栏 1418

吴恩达ex3_吴恩达机器学习coursera作业题目+答案

【实例简介】题目+答案,很好用。解决了在线看coursera课程作业下载不了的问题。【实例截图】【核心代码】机器学习课程2014源代码├── mlclass-ex1-jin10.23│ ├── OGLdpf.log│ ├── computeCost.m│ ├── computeCostMulti.m│ ├── ex1.m│ ├── ex1_multi.m│ ├── ex1d...

weixin_29799209的博客 277

第11.4节 混合储能系统能量管理

混合储能系统(HESS)的能量管理策略采用分层架构实现多时间尺度优化:调度层(小时级)进行经济优化,协调层(秒级)基于频率分解分配功率,执行层(毫秒级)实现快速跟踪。深度强化学习(DRL)方法通过定义状态空间、动作空间和多目标奖励函数,能有效处理系统不确定性和多目标优化问题。HESS性能评估需综合技术指标(如调节性能Kp值、设备寿命指标)和经济指标(净现值NPV、平准化储能成本LCOS),并遵循"建模-仿真-实验"的闭环流程。

技术工作者 245

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

Coursera-ML-AndrewNg-ex1

Programming Exercise 1: Linear Regression 在本次练习中,你将实现线性回归并了解它的工作原理。目标是要运行脚本ex1.m和ex1_multi,为此你需要修改其他文件的函数 1 Simple MATLAB function 在程序中填空来实现返回一个5X5的单位矩阵 这只是一个热身程序 warmUpExercise.m function A = warmUpExercise() %WARMUPEXERCISE Example function in octave %

weixin_43608722的博客 259

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

Andrew Ng coursera上的《机器学习》ex4

Andrew Ng coursera上的《机器学习》ex4按照课程所给的ex4的文档要求,ex4要求完成以下几个计算过程的代码编写: exerciseName description sigmoidGradient.m compute the grident of the sigmoid function randInitializedWeights.m randomly in

LilyNothing的博客 5584

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

Andrew Ng coursera上的《机器学习》ex2

Andrew Ng coursera上的《机器学习》ex2按照课程所给的ex2的文档要求,ex2要求完成以下几个计算过程的代码编写: exerciseName description plotData.m function to plot 2D classification data sigmoid.m 是逻辑回归的定义函数 costFunction.m logisti

LilyNothing的博客 2395

Andrew Ng coursera上的《机器学习》ex8

Andrew Ng coursera上的《机器学习》ex8按照课程所给的ex8的文档要求,ex8要求完成以下几个计算过程的代码编写: 一、estimateGuasssian.m要求求出符合高斯函数的均值和方差。function [mu sigma2] = estimateGaussian(X) %ESTIMATEGAUSSIAN This function estimates the parame

LilyNothing的博客 3036

Andrew Ng coursera上的《机器学习》ex7

Andrew Ng coursera上的《机器学习》ex7按照课程所给的ex7的文档要求,ex7要求完成以下几个计算过程的代码编写: 一、findClosestCentroids.m要求是为每个数据点找到距离它最近的中心点。function idx = findClosestCentroids(X, centroids) %FINDCLOSESTCENTROIDS computes the ce

LilyNothing的博客 3040

Ex02 [coursera] Machine learning - Stanford University - Andrew Ng

Logistic Regression 目录 Part1 ex2.m plotData.m sigmoid.m costFunction.m plotDecisionBoundary.m predict.m prompt output figure output Part2 ex2_reg.m mapFeature.m costFunctionReg.m pro...

MoMo_qyc的博客 477
上一篇: Photo OCR
下一篇: Andrew Ng coursera上的《机器学习》ex2
LilyNothing
博客等级 码龄11年 191粉丝 77原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值