Coursera机器学习week9 编程作业

Posted starry

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Coursera机器学习week9 编程作业相关的知识,希望对你有一定的参考价值。

estimateGaussian.m

mu = 1/m * sum(X);
sigma2 = 1/m * sum((X - repmat(mu, m, 1)).^2);

selectThreshold.m

predictions = (pval < epsilon);
fp = sum((predictions == 1) & (yval == 0));
fn = sum((predictions == 0) & (yval == 1));
tp = sum((predictions == 1) & (yval == 1));

prec = tp/(tp+fp);
rec = tp/(tp+fn);
    
F1 = 2 * prec * rec / (prec + rec);

cofiCostFunc.m

temp = (X*Theta‘).*R;
J = sum( sum( (temp - Y.*R).^2) )/2.0 + (lambda/2) * ( sum(sum( X.^2 )) + sum(sum( Theta.^2 )) );  
% J = sum( sum( (temp - Y.*R).^2) )/2.0 + (lambda/2) * ( sum(sum( X.^2 )) + sum(sum( Theta.^2 )) ) ;

X_grad = (temp - Y.*R) * Theta + lambda * X;
Theta_grad = (temp - Y.*R)‘ * X + lambda * Theta;

  

以上是关于Coursera机器学习week9 编程作业的主要内容,如果未能解决你的问题,请参考以下文章

Coursera机器学习week9 单元测试

吴恩达-coursera-机器学习-week9

Coursera机器学习week9 笔记

机器学习- 吴恩达Andrew Ng Week9 知识总结 Recommender Systems

机器学习- 吴恩达Andrew Ng Week9 知识总结 Anomaly Detection

机器学习- 吴恩达Andrew Ng Coursera学习总结合集,编程作业技巧合集