Skip to content

Commit

Permalink
rename functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sth4nth committed Dec 25, 2015
1 parent cb99dd5 commit ab2203e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions chapter04/demo.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
k = 2;
n = 1000;
[X,t] = kmeansRnd(2,k,n);
[model, llh] = logitReg(X,t-1,0);
[model, llh] = logitBin(X,t-1,0);
plot(llh);
binPlot(model,X,t)
pause
Expand All @@ -12,6 +12,6 @@
k = 3;
n = 1000;
[X,t] = kmeansRnd(2,k,n);
[model, llh] = mnReg(X,t);
y = mnPred(model,X);
[model, llh] = logitMn(X,t);
y = logitMnPred(model,X);
spread(X,y)
2 changes: 1 addition & 1 deletion chapter04/logitReg.m → chapter04/logitBin.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [model, llh] = logitReg(X, t, lambda)
function [model, llh] = logitBin(X, t, lambda)
% Logistic regression for binary classification optimized by Newton-Raphson
% method.
% X: dxn data matrix
Expand Down
2 changes: 1 addition & 1 deletion chapter04/logitPred.m → chapter04/logitBinPred.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [y, p] = logitPred(model, X)
function [y, p] = logitBinPred(model, X)
% Prodict the label for binary logistic regression model
% model: trained model structure
% X: d x n testing data
Expand Down
2 changes: 1 addition & 1 deletion chapter04/mnReg.m → chapter04/logitMn.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [model, llh] = mnReg(X, t, lambda)
function [model, llh] = logitMn(X, t, lambda)
% Multinomial regression for multiclass problem (Multinomial likelihood)
% Written by Mo Chen ([email protected]).
if nargin < 3
Expand Down
2 changes: 1 addition & 1 deletion chapter04/mnPred.m → chapter04/logitMnPred.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [y, P] = mnPred(model, X)
function [y, P] = logitMnPred(model, X)
% Prodict the label for multiclass (multinomial) logistic regression model
% model: trained model structure
% X: d x n testing data
Expand Down

0 comments on commit ab2203e

Please sign in to comment.