You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

utility.py 794 B

6 years ago
12345678910111213141516171819202122232425
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. def plot_decision_boundary(clf, X):
  4. w = clf.coef_.ravel()
  5. a = -w[0] / w[1]
  6. xx = np.linspace(np.min(X[:, 0]), np.max(X[:, 0]))
  7. yy = a * xx - clf.intercept_ / w[1]
  8. plt.plot(xx, yy)
  9. plt.xticks(())
  10. plt.yticks(())
  11. def plotEllipse(pos,P,edge='k',face='none',line_width='.1'):
  12. from numpy.linalg import svd
  13. from matplotlib.patches import Ellipse
  14. import math
  15. from numpy import pi
  16. from matplotlib.pyplot import gca
  17. U, s , Vh = svd(P)
  18. orient = math.atan2(U[1,0],U[0,0])*180/pi
  19. ellipsePlot = Ellipse(xy=pos, width=2.0*math.sqrt(s[0]), height=2.0*math.sqrt(s[1]), angle=orient,facecolor=face, edgecolor=edge, lw=line_width)
  20. ax = gca()
  21. ax.add_patch(ellipsePlot);
  22. return ellipsePlot

机器学习越来越多应用到飞行器、机器人等领域,其目的是利用计算机实现类似人类的智能,从而实现装备的智能化与无人化。本课程旨在引导学生掌握机器学习的基本知识、典型方法与技术,通过具体的应用案例激发学生对该学科的兴趣,鼓励学生能够从人工智能的角度来分析、解决飞行器、机器人所面临的问题和挑战。本课程主要内容包括Python编程基础,机器学习模型,无监督学习、监督学习、深度学习基础知识与实现,并学习如何利用机器学习解决实际问题,从而全面提升自我的《综合能力》。