lab5的函数简析

  1. np.concatenate() : 基于numpy库的一个数组拼接函数。注:一般axis = 0,就是对该轴向的数组进行操作,操作方向是另外一个轴,即axis=1。
    a = np.array([[1,2], [3,4]])
    b = np.array([[5,6]])
    np.concatenate((a, b), axis=0)
    out:array([[1, 2], [3, 4], [5, 6]])
  2. np.meshgrid() : 从坐标变量中返回一个坐标矩阵,其中 xv和yv分别是横纵轴的坐标,ravel函数是将矩阵变为一个一维的数组,其中xv.ravel()就表示x轴的坐标,yv.ravel()就表示了y轴的坐标。
nx,ny = (3,2)
    #从0开始到1结束,返回一个numpy数组,nx代表数组中元素的个数
    x = np.linspace(0,1,nx)
    #[ 0.   0.5  1. ]
    y = np.linspace(0,1,ny)
    # [0.  1.]
    xv,yv = np.meshgrid(x,y)
    '''
    xv
    [[ 0.   0.5  1. ]
     [ 0.   0.5  1. ]]
     yv
     [[ 0.  0.  0.]
      [ 1.  1.  1.]]
    '''

3.Remember that the form of data we will use always is
https://blog.csdn.net/o1101574955/article/details/70212126
4.accuracy_score
分类准确率分数是指所有分类正确的百分比。分类准确率这一衡量分类器的标准比较容易理解,但是它不能告诉你响应值的潜在分布,并且它也不能告诉你分类器犯错的类型。
5.These two ideas illustrate one of the most important reasons that learning is even feasible: we believe that most datasets, in either their unsupervized form {x}{x} , or their supervized form {y,x}{y,x} , live on a lower dimensional subspace. If we can find this subspace, we can then hope to find a methodd which rerpectively separates or fits the data.

猜你喜欢

转载自blog.csdn.net/holddoor/article/details/83444167
今日推荐