Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kNN of ML in action #2

Open
mimiao2017 opened this issue Oct 22, 2017 · 2 comments
Open

kNN of ML in action #2

mimiao2017 opened this issue Oct 22, 2017 · 2 comments

Comments

@mimiao2017
Copy link
Owner

No description provided.

@mimiao2017
Copy link
Owner Author

the diff between shape(a) and a.shape:
shape(a):retry:a.shape,the same thing

tile

numpy.sum
http://blog.csdn.net/shengmingqijiquan/article/details/53009753

argsort

to be continued

@mimiao2017
Copy link
Owner Author

basics about np.array

  1. when A is an array,A*B or multiply means elementwise product;
    A.dot(B)or dot(A,B) means martix product.
    when A is a matrix, multiply means elementwise product;
    A*B or A.dot(B) or dot(A,B) means martix product.
    when A ,B are of different types, multiply means elementwise product;
    A*B or A.dot(B) or dot(A,B) means martix product.

  2. generate a certain size random array:np.random.random([2,3])

  3. aoubt +=,TypeError: Cannot cast ufunc add output from dtype('float64') to dtype('int64') with casting rule 'same_kind'

  4. upcasting:不同类型的数据进行计算,结果的类型取更通用/精确的类型。

  5. 3D数组:创建一个3行4列2维数组:a = np.arange(24).reshape([2,3,4]).
    计算:axis=0,按维计算;axis=1,按列计算;axis=2,按行计算;
    2D数组:创建3行4列:a = np.arange(12).reshape([3,4]).
    计算:axis=0,按列计算;axis=1,按行计算;

  6. b.cumsum(axis=1),按行累加

7.universal functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant