- 博客(5)
- 收藏
- 关注
原创 种类并查集的万能公式
举两个例子: 食物链题目链接 #include<iostream> using namespace std; const int N=1e5+10; int f[N],d[N],n; void init(){ for(int i=0;i<=n;i++){ f[i]=i; } } int find(int x){ if(x==f[x]) ...
2020-07-03 21:59:26
345
原创 吴恩达第8周编程作业
Find Closest Centroids min() 函数会返回两个值,第一个是value,第二个是index;(中文意思) Compute Centroid Means 第一个for,遍历所有的data(X),把同为类的x加到对应centroids上,c 临时存放当前data X(i) 属于哪个类; += 和 ./ = 你懂的 第二个for,你懂的; PCA 注意 ./ 符号 Project Data Recover Data (PCA) ...
2020-06-24 21:52:51
175
原创 Regularized linear regression
cost function: gradient: 外部初始化: y = theta0 + theta1 * x1 + theta2 * x2 + theta3 * x3; 每一行是一个数据 样本, 这里有三个feature,两条数据(题目dataset太小,这个只是用于理解) X : y: x11 x12 x13 y1 x21 x22 x23 y2 m = size(X, 1); theta = [1 ; 1]; J = linearRegCostFunction( [ones(m,
2020-06-11 21:03:24
219
原创 吴恩达机器学习 第六周实验代码
1.linearRegCostFunction 2.learningCurve 3.polyFeatures 4.validationCurve
2020-06-11 21:00:31
219
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人