• 大小: 29.08MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-27
  • 语言: 其他
  • 标签: Matlab  

资源简介

吴恩达coursera机器学习上的全部编程解答(自己做的,100%正确),代码也有注释

资源截图

代码片段和文件信息

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.

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

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

end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-10-16 14:19  machine-learning\
     文件        8196  2018-10-25 18:47  machine-learning\.DS_Store
     目录           0  2018-10-31 14:28  __MACOSX\
     目录           0  2018-10-31 14:28  __MACOSX\machine-learning\
     文件         120  2018-10-25 18:47  __MACOSX\machine-learning\._.DS_Store
     目录           0  2018-10-02 15:34  machine-learning\machine-learning-ex4\
     文件        6148  2018-10-05 14:17  machine-learning\machine-learning-ex4\.DS_Store
     目录           0  2018-10-31 14:28  __MACOSX\machine-learning\machine-learning-ex4\
     文件         120  2018-10-05 14:17  __MACOSX\machine-learning\machine-learning-ex4\._.DS_Store
     文件      356692  2017-03-13 18:40  machine-learning\machine-learning-ex4\ex4.pdf
     文件         268  2017-03-13 18:40  __MACOSX\machine-learning\machine-learning-ex4\._ex4.pdf
     目录           0  2018-10-19 10:00  machine-learning\machine-learning-ex4\ex4\
     文件        1502  2017-03-13 18:40  machine-learning\machine-learning-ex4\ex4\displayData.m
     目录           0  2018-10-31 14:28  __MACOSX\machine-learning\machine-learning-ex4\ex4\
     文件         212  2017-03-13 18:40  __MACOSX\machine-learning\machine-learning-ex4\ex4\._displayData.m
     文件        1067  2018-10-03 16:18  machine-learning\machine-learning-ex4\ex4\randInitializeWeights.m
     文件         268  2018-10-03 16:18  __MACOSX\machine-learning\machine-learning-ex4\ex4\._randInitializeWeights.m
     文件         137  2017-03-13 18:40  machine-learning\machine-learning-ex4\ex4\sigmoid.m
     文件         212  2017-03-13 18:40  __MACOSX\machine-learning\machine-learning-ex4\ex4\._sigmoid.m
     文件     7511764  2017-03-13 18:40  machine-learning\machine-learning-ex4\ex4\ex4data1.mat
     文件         212  2017-03-13 18:40  __MACOSX\machine-learning\machine-learning-ex4\ex4\._ex4data1.mat
     文件         263  2018-10-03 19:49  machine-learning\machine-learning-ex4\ex4\token.mat
     文件         700  2018-10-03 16:02  machine-learning\machine-learning-ex4\ex4\sigmoidGradient.m
     文件         212  2018-10-03 16:02  __MACOSX\machine-learning\machine-learning-ex4\ex4\._sigmoidGradient.m
     文件         841  2017-03-13 18:40  machine-learning\machine-learning-ex4\ex4\debugInitializeWeights.m
     文件         268  2017-03-13 18:40  __MACOSX\machine-learning\machine-learning-ex4\ex4\._debugInitializeWeights.m
     文件        5001  2018-10-19 10:00  machine-learning\machine-learning-ex4\ex4\nnCostFunction.m
     文件         384  2018-10-19 10:00  __MACOSX\machine-learning\machine-learning-ex4\ex4\._nnCostFunction.m
     文件        1095  2017-03-13 18:40  machine-learning\machine-learning-ex4\ex4\computeNumericalGradient.m
     文件         268  2017-03-13 18:40  __MACOSX\machine-learning\machine-learning-ex4\ex4\._computeNumericalGradient.m
     文件        8749  2017-03-13 18:40  machine-learning\machine-learning-ex4\ex4\fmincg.m
............此处省略580个文件信息

评论

共有 条评论