吴恩达机器学习 作业
鱼儿冒个泡
这个作者很懒,什么都没留下…
展开
-
【吴恩达 机器学习】ex2 : logistic regression ——Python
logistic regression Python代码: import numpy as np import pandas as pd import matplotlib.pyplot as plt def sigmond(x): sig = 1 / (1 + np.exp(-x)) return sig def gradient_descend(X, Y, init_theta, alpha, iter_nums): theta = init_theta for i原创 2021-08-29 18:47:42 · 111 阅读 · 0 评论 -
【吴恩达 机器学习】ex2: logistic regression —— MATLAB
1、Logistic Regression MATLAB代码: % load the data dataset = load("C:\Users\LENOVO\OneDrive - 东南大学\桌面\机器学习\吴恩达作业\matlab\ex2\data\ex2data1.txt"); [m, n] = size(dataset); x1 = dataset(:, 1); x2 = dataset(:, 2); y = dataset(:, 3); X = [ones(size(y)), x1, x2]; X原创 2021-08-28 20:54:22 · 194 阅读 · 0 评论 -
【吴恩达 机器学习】ex1 gradient descend —— python
单变量线性回归 Python代码: import numpy as np import matplotlib.pyplot as plt import pandas as pd # cost function def cost_function(X, Y, theta): hyposis = np.dot(np.transpose(theta), X) - np.transpose(Y) cost = np.dot(hyposis, hyposis) / (2 * np.size(Y))原创 2021-08-25 18:22:14 · 118 阅读 · 0 评论 -
【吴恩达 机器学习】ex1: gradient descend——MATLAB
单变量线性回归 MATLAB代码: % load the data data = load("ex1data1.txt"); input = data(:, 1); output = data(:, 2); %scatter plot plot(input, output, 'rx', 'Markersize', 10); [r, c] = size(input); X = [ones(r, 1), input]; X = X'; Y = output; theta = zeros(2, 1); the原创 2021-08-24 14:20:15 · 185 阅读 · 0 评论