画出data数据 data数据 34.62365962451697,78.0246928153624,030.28671076822607,43.89499752400101,035.84740876993872,72.90219802708364,060.18259938620976,86.30855209546826,179.0327360507101,75.3443764369103,145.08327747668339,56.3163717815305,061.1066645368476…
sigmoid.m文件 function g = sigmoid(z)%SIGMOID Compute sigmoid functoon% J = SIGMOID(z) computes the sigmoid of z. g = zeros(size(z));  初始化g ,z可以是一个数,一个向量或者一个矩阵 % ====================== YOUR CODE HERE ======================% Instructions: Compute the si…
画decision boundary(直线) %% ============= Part 3: Optimizing using fminunc =============% In this exercise, you will use a built-in function (fminunc) to find the% optimal parameters theta. % Set options for fminuncoptions = optimset('GradObj', 'on', '…
统计FilmTrust(0.5-4.0分).CiaoDVD(1-5分).MovieLens(1-5分) 等 rating 数据集分值的分布:  以 统计FilmTrust(0.5-4.0分) 为例: MATLAB 代码如下: load('filmTrust_u_i_r.mat') % 载入数据 fprintf('This is filmTrust (0.5-4.0)......') FilmTrustD=D; % count1=count(D(:,),"0.5") % count2=c…
原文:http://blog.csdn.net/abcjennifer/article/details/7716281 本栏目(Machine learning)包括单参数的线性回归.多参数的线性回归.Octave Tutorial.Logistic Regression.Regularization.神经网络.机器学习系统设计.SVM(Support Vector Machines 支持向量机).聚类.降维.异常检测.大规模机器学习等章节.所有内容均来自Standford公开课machine…
%% ============ Part : Compute Cost and Gradient ============ % In this part of the exercise, you will implement the cost and gradient % for logistic regression. You neeed to complete the code in % costFunction.m % Setup the data matrix appropriately…
Regularized logistic regression :  plot data(画样本图) ex2data2.txt 0.051267,0.69956,1-0.092742,0.68494,1-0.21371,0.69225,1-0.375,0.50219,1-0.51325,0.46564,1-0.52477,0.2098,1-0.39804,0.034357,1-0.30588,-0.19225,10.016705,-0.40424,10.13191,-0.51389,10.385…
原文:http://blog.csdn.net/abcjennifer/article/details/7732417 本文为Maching Learning 栏目补充内容,为上几章中所提到单参数线性回归.多参数线性回归和 逻辑回归的总结版.旨在帮助大家更好地理解回归,所以我在Matlab中分别对他们予以实现,在本文中由易到难地逐个介绍.     本讲内容: Matlab 实现各种回归函数 ========================= 基本模型 Y=θ0+θ1X1型---线性回归(直线拟合…
Regularized logistic regression : mapFeature(将feature增多) and costFunctionReg ex2_reg.m文件中的部分内容 %% =========== Part 1: Regularized Logistic Regression ============% In this part, you are given a dataset with data points that are not% linearly separabl…
不同的λ(0,1,10,100)值对regularization的影响\ 预测新的值和计算模型的精度 %% ============= Part 2: Regularization and Accuracies =============% Optional Exercise:% In this part, you will get to try different values of lambda and % see how regularization affects the decisio…