3

这个文件 ex1.m,我用八度“打开”,但它什么也没做。前几行代码是....

%% Machine Learning Online Class - Exercise 1: Linear Regression

%  Instructions
%  ------------
% 
%  This file contains code that helps you get started on the
%  linear exercise. You will need to complete the following functions 
%  in this exericse:
%
%     warmUpExercise.m
%     plotData.m
%     gradientDescent.m
%     computeCost.m
%     gradientDescentMulti.m
%     computeCostMulti.m
%     featureNormalize.m
%     normalEqn.m
%
%  For this exercise, you will not need to change any code in this file,
%  or any other files other than those mentioned above.
%
% x refers to the population size in 10,000s
% y refers to the profit in $10,000s
%

%% Initialization
clear ; close all; clc

%% ==================== Part 1: Basic Function ====================
% Complete warmUpExercise.m 
fprintf('Running warmUpExercise ... \n');
fprintf('5x5 Identity Matrix: \n');
warmUpExercise()

fprintf('Program paused. Press enter to continue.\n');
pause;

等等......还有更多文件,我不知道如何让它运行......

4

1 回答 1

2

这看起来像是 www.coursera.org 提供的 Andrew Ng 在线机器学习课程的一部分 在尝试自己学习教程之后,您可能会更幸运地在课程网站的论坛中提出这些问题。

您需要首先在目录中拥有所有相关文件。然后实际完成任务。在您完成代码部分之前,这些分配中的大多数都不会执行任何操作。

该文件包含帮助您开始线性练习的代码。您将需要在本练习中完成以下功能:

 warmUpExercise.m
 plotData.m
 gradientDescent.m
 computeCost.m
 gradientDescentMulti.m
 computeCostMulti.m
 featureNormalize.m
 normalEqn.m

完成后,打开一个mac终端并cd到所在目录ex1.m。您可以通过启动octave并输入不带扩展.m名的文件名来运行程序。键入ex1。或者,octave -q ex1.m如果您不想在程序运行完成后进入 octave shell,您可以从终端键入。

于 2012-12-24T00:53:50.650 回答