mirror of
https://github.com/jlengrand/MachineLearningCoursera.git
synced 2026-03-10 08:31:20 +00:00
Week 3
Gets sigmoid method working.
This commit is contained in:
@@ -12,13 +12,14 @@ figure; hold on;
|
||||
% examples and 'ko' for the negative examples.
|
||||
%
|
||||
|
||||
% Find Indices of Positive and Negative Examples
|
||||
pos = find(y==1); neg = find(y == 0);
|
||||
% Plot Examples
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
plot(X(pos, 1), X(pos, 2), 'k+','LineWidth', 2, ...
|
||||
'MarkerSize', 7);
|
||||
plot(X(neg, 1), X(neg, 2), 'ko', 'MarkerFaceColor', 'y', ...
|
||||
'MarkerSize', 7);
|
||||
|
||||
% =========================================================================
|
||||
|
||||
|
||||
@@ -10,8 +10,7 @@ g = zeros(size(z));
|
||||
% vector or scalar).
|
||||
|
||||
|
||||
|
||||
|
||||
g = ones(size(z)) ./ (1 + exp(-z));
|
||||
|
||||
% =============================================================
|
||||
|
||||
|
||||
BIN
W3/machine-learning-ex2/ex2/token.mat
Normal file
BIN
W3/machine-learning-ex2/ex2/token.mat
Normal file
Binary file not shown.
Reference in New Issue
Block a user