Domanda

This file ex1.m, I "open with" octave, but it doesn't do anything. the first few lines of code are....

%% 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;

etc.... There were more files, I'm not sure how to get this to run...

È stato utile?

Soluzione

This looks like part of Andrew Ng's Online Machine Learning class offered from www.coursera.org You might have more luck asking these questions in the forums at the class website after attempting to follow the tutorials yourself.

You need to have all of the relevant files in the directory first. Then actually complete the assignment. Most of those assignments do nothing until you complete the code section.

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

After you are done, open a mac Terminal and cd to the directory where ex1.m is located. You can run the program by starting octave and entering the name of the file without the .m extension. Type ex1. Alternatively, you could type octave -q ex1.m from the terminal if you don't want to be in the octave shell after the program is done running.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top