吴恩达 机器学习
cheetah023
这个作者很懒,什么都没留下…
展开
-
2020吴恩达 machine learning 编程作业 python实现 ex8_cofi
# -*- coding: utf-8 -*-"""Created on Sat Jul 4 16:49:40 2020@author: cheetah023"""import numpy as npimport scipy.io as sciimport matplotlib.pyplot as pltimport scipy.optimize as opt#函数定义def cofiCostFunc(params, Y, R, num_users, .原创 2020-07-04 23:01:21 · 450 阅读 · 0 评论 -
2020吴恩达 machine learning 编程作业 python实现 ex8
# -*- coding: utf-8 -*-"""Created on Sat Jul 4 01:40:18 2020@author: cheetah023"""import numpy as npimport scipy.io as sciimport matplotlib.pyplot as plt#函数定义def estimateGaussian(X): m,n = X.shape mu = np.zeros([n,1]) sigma2 = np..原创 2020-07-04 16:48:14 · 345 阅读 · 0 评论 -
2020吴恩达 machine learning 编程作业 python实现 ex7_pca
# -*- coding: utf-8 -*-"""Created on Fri Jul 3 23:50:18 2020@author: cheetah023"""import numpy as npimport matplotlib.pyplot as pltimport scipy.io as scidef featureNormalize(X): mu = np.mean(X,axis=0) sigma = np.std(X,axis=0,ddof=1) .原创 2020-07-04 01:38:04 · 360 阅读 · 0 评论 -
2020吴恩达 machine learning 编程作业 python实现 ex7
# -*- coding: utf-8 -*-"""Created on Fri Jul 3 18:23:49 2020@author: cheetah023"""import numpy as npimport scipy.io as sciimport matplotlib.pyplot as pltfrom skimage import io#函数定义def findClosestCentroids(X, centroids): #样本数量 m,n =...原创 2020-07-03 22:20:00 · 348 阅读 · 0 评论 -
2020吴恩达 machine learning 编程作业 python实现 ex6_spam
# -*- coding: utf-8 -*-"""Created on Fri Jul 3 08:09:20 2020@author: cheetah023"""import scipy.io as sciimport numpy as npfrom sklearn import svmfrom sklearn.metrics import accuracy_scoreimport pandas as pdimport re #regular expression for e-m.原创 2020-07-03 10:58:28 · 273 阅读 · 0 评论 -
2020吴恩达 machine learning 编程作业 python实现 ex6
# -*- coding: utf-8 -*-"""Created on Thu Jul 2 20:13:57 2020@author: cheetah023"""import numpy as npimport scipy.io as sciimport matplotlib.pyplot as pltfrom sklearn import svm#函数定义def plotData(X, y): pos = np.where(y == 1) neg = np.w.原创 2020-07-03 01:01:38 · 324 阅读 · 0 评论 -
2020吴恩达 machine learning 编程作业 python实现 ex5
# -*- coding: utf-8 -*-"""Created on Thu Jul 2 12:09:38 2020@author: cheetah023"""import numpy as npimport matplotlib.pyplot as pltimport scipy.io as sciimport scipy.optimize as opt#函数定义def linearRegCostFunction(theta, X, y, lamda): m,n .原创 2020-07-02 18:52:20 · 301 阅读 · 0 评论 -
2020吴恩达 machine learning 编程作业 python实现 ex4
# -*- coding: utf-8 -*-"""Created on Wed Jul 1 22:37:49 2020@author: cheetah023"""import numpy as npimport scipy.io as sciimport scipy.optimize as opt#函数定义def sigmoid(X): return 1 / (1 + np.exp(-X))def sigmoidGradient(X): g = sigmoid(.原创 2020-07-02 12:02:46 · 358 阅读 · 0 评论 -
2020吴恩达 machine learning 编程作业 python实现 ex3_nn
# -*- coding: utf-8 -*-"""Created on Wed Jul 1 20:28:57 2020@author: cheetah023"""import numpy as npimport matplotlib.pyplot as pltimport scipy.io as sciimport random as ra#函数定义def sigmoid(X): return 1 /(1 + np.exp(-X))def predict(theta1.原创 2020-07-01 21:13:45 · 244 阅读 · 0 评论 -
2020吴恩达 machine learning 编程作业 python实现 ex3
# -*- coding: utf-8 -*-"""Created on Wed Jul 1 17:28:18 2020@author: cheetah023"""import numpy as npimport matplotlib.pyplot as pltimport scipy.io as sciimport scipy.optimize as opt#函数定义def sigmoid(X): return 1 /(1 + np.exp(-X))def lrcos.原创 2020-07-01 19:54:07 · 355 阅读 · 0 评论 -
2020吴恩达 machine learning 编程作业 python实现 ex2_reg
# -*- coding: utf-8 -*-"""Created on Wed Jul 1 00:20:53 2020@author: cheetah023"""import numpy as npimport matplotlib.pyplot as pltimport scipy.optimize as opt#函数定义def sigmoid(X): return 1 /(1 + np.exp(-X))def mapFeature(x1, x2): deg.原创 2020-07-01 17:08:07 · 346 阅读 · 0 评论 -
2020吴恩达 machine learning 编程作业 python实现 ex2
# -*- coding: utf-8 -*-"""Created on Tue Jun 30 16:41:10 2020@author: cheetah023"""import numpy as npimport matplotlib.pyplot as pltimport scipy.optimize as opt#函数定义def sigmoid(X): return 1 /(1 + np.exp(-X))def costFunction(theta, X, y, .原创 2020-07-01 17:02:32 · 1327 阅读 · 2 评论 -
2020吴恩达 machine learning 编程作业 python实现 ex1_multi
# -*- coding: utf-8 -*-"""Created on Tue Jun 30 12:48:02 2020@author: cheetah023"""import numpy as npimport matplotlib.pyplot as plt#函数定义def featureNormalize(X): m = X.shape[0] mu = X.mean(axis=0) sigma = X.std(axis=0) mu_mat = .原创 2020-07-01 16:54:22 · 215 阅读 · 0 评论 -
2020 吴恩达 machine learning 编程作业 python实现 ex1
# -*- coding: utf-8 -*-"""Created on Mon Jun 29 16:01:13 2020@author: SWX"""import numpy as npimport matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3D#函数定义#输出对角矩阵def warmUpExercise(n): A = np.eye(n) return A#损失函数def com.原创 2020-07-01 16:43:52 · 259 阅读 · 0 评论