Tensor – Data structure in ML
Tensor – a way to store numbers in container
Points about Tensor:
- 0-D Tensor is scalar
- 1-D Tensor is vector in ML or 1-D array in programming
- N-D tensor is collection of (N-1)D array/Tensor
- Statement – “Vector is 1-D tensor but has its own dimension”
- Example arr = [1,2,3] – its tensor dimension is 1 & vector dimension is 3 (since x,yz)
- 2-D Tensor / matrix
- R X C is a matrix or 2-D tensor
- 3-D tensor/matrix
- In addition of R and C, it has Depth (collection of 2-D matrix/2D tensor)
- Note: In ML 0 to 5D are ones comes in pictturs
- No. Of dimension Tensor = no. of axis = Rank
- Size of tensor = no of item = R X C
- Example of Tensor data
- 3D Tensor
- Time Series data
- 4D tensor
- Image
- 5-D tensor
- Video
- Domain knowledge – mp4, mpeg, mkv are the video encoder which makes raw format, large size video into small size video
- Video
- 3D Tensor
Tools and Lib for ML
- Anaconda- Contains packages for ML
- Jupyter Notebook
- Virtual env
- Using conda you can create venv
- Kaggle
- Pros
- Also has online version of Jupyternotebook
- Has kaggle data
- Pros
- Google collab
- Pros-
- Also has online version of Jupyternotebook
- It has GPU power Too – used for Deep learning
- Runtime – > Change runtime – > select GPU
- There is option to import kaggle data into collab – it needs few configs – like api key setup – which helps in download directly zip to collab which can be extracted with code and used
- It has GPU power Too – used for Deep learning
- Also has online version of Jupyternotebook
- Pros-

Image – Anaconda with base(root) having all libraries for data science & virtual env only required lib. so size remains manageable while deploying
E2E flow
Steps involved :
- Preprocessing , EDA , Feature selection
- panda lib useful
- Extract input and output cols
- panda lib useful
- scale the values
- Train & test data split
- sklearn lib useful
- model training
- sklearn lib useful
- Model evaluation & selection
- sklearn lib useful
- deploy
- can be deployed on any cloud platform (aws/gcp etc)- model can be exported post selection using pickle library