Implementation of Machine Learning at Hackveda

NumPy Implementation
NumPy is a library used in Python Programming Language adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays.
Pre-Requisites
Basic Knowledge about python.
We will learn about:
1. Identity
2. Astype
3. Arange
4. Linspace
5. Indices
6. Data types
7. Reshape Function
8. Converting List into an Array
9. Slicing
Identity

Identity is used in Python to create the identity matrix. Identity matrix is a square matrix in which all the elements of the principal diagonal are ones and all other elements are zeros. The effect of multiplying a given matrix by an identity matrix is to leave the given matrix unchanged.
so the code is as shown below.

in this the number inside the identity function gives the size of identity matrix. the data type of this matrix is float.
Astype
Astype is used to change the data type in python programming language.
so for above example we will convert all the values into int data type.

so the data type of identity is now changed into integer data type.
Arange
Arange is used to return an array with evenly spaced elements as per the interval.
arange([start,] stop[, step,][, dtype])
Parameters:
start : [optional] start of interval range. By default start = 0
stop : end of interval range
step : [optional] step size of interval. By default step size = 1,
For any output out, this is the distance between two adjacent values, out[i+1] — out[i].
dtype : type of output array

