Analysis of the function lab5

  1. np.concatenate (): an array stitching function numpy library. NOTE: General axis = 0, that is, the axial direction of the array is operated, the operation direction is another one axis, i.e., 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 (): returns a matrix of coordinates from the coordinate variables, wherein xv and yv are cross the longitudinal axis of coordinates, the matrix becomes Ravel function is a one-dimensional array, wherein xv.ravel () on the x-axis represents coordinates, yv.ravel () represents a coordinate on the y-axis.
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
classification accuracy score is the percentage of correct classification means all. This measure classification accuracy of the classifier is easier to understand, but it can not tell you respond to potential distribution of values, and it can not tell you the type of classifier mistakes.
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.

Guess you like

Origin blog.csdn.net/holddoor/article/details/83444167