Wednesday, June 16, 2021

Predictive Auto-Scaling


Prediction is to undertand the future based on current or past date. Scaling is to adjust the resources. Hence Predictive auto-scaling does simplify the future resource needs via automation. The resource needed can be CPU, Memory, Storage or even Network resources. The automation there by simplifies the provision of any of these resources for a future state. This provision can be determined also reactively, proactivly or in hybrid manner. Prediction of auto scaling factors thus works with various parameters based on the determined behaviour of the system. We will see how Amazon positions the autoscaling in predictive scenarios.



Automation is carried out in 3 ways: Amazon EC2 servers, in Application itself or with the Amazon Web Servers. Within the EC2 this auto scaling is carried out as follows : By Simple and automatic capacity provision, Scaling of infrastucture up and down, by replacment of unhealthy instances, support for various purchase options, and via balancing capacity across avaliability zones. Applications autoscaling are carried out via individual service scaling by the applications like EC2 ( Spot fleet request), ECS(Service), DynamoDB ( tables and global secondary indexes(GSI)), SageMaker(Fleet), EMR(instance group), Aurora(Cluster), AppStream 2.0(Fleet) and Custom recources. Amazon Web Servers auto scaling leverages the existing EC2 Auto Scaling and Application Auto Scaling services. Allows the application developer to define theirs based on an AWS CloudFormation stack or resource tags.



Scaling options can be of manual, scheduled or dynamic. Predictive autoscaling new feature., and uses the machine learning techniques behind the scene. The forecasting metrics are to be defined in the modeling. Where and when to use this predictive scaling has to be determined aswell upfront. It can be achieved through AWS Auto Scaling console, SDK or CFN.



Predictive auto scaling builds a scaling schedule based on historical data to provide a baseline capacity. Dynamic scaling comes next by adding capacity as needed to the baseline capacity and acts as a complement [1].


Architecture: [2]
  1. Auto Scaling Group : similar EC2 instances for scaling and to a maximum allowed
  2. Launch Configuration : provides information to instantiance EC2 instances
  3. CloudWatch : is monitoring app for metrics deviations on CPU, Memory, loads
  4. Scaling Policy: Policies set for scale in and out or scale up and down.



[1] © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Auto Scaling How to use predictive scaling Chris Lewis Software Development Manager Amazon Web Services A P I 3 3 1 - R & A P I 3 3 1 - R 1 Usman Khalid Senior Software Development Manager Amazon Web Services

[2] M. N. A. H. Khan, Y. Liu, H. Alipour, and S. Singh, “Modeling the Autoscaling Operations in Cloud with Time Series Data,” Proceedings of the IEEE Symposium on Reliable Distributed Systems, vol. 2016-January, no. September, pp. 7–12, 2015.

Labels:

Monday, June 14, 2021

Machine Learning algorithms blogs surveyed

Motivation & Introduction:

Machine learning aim to develop computer programs that can access data and learn themselves. This automation without human interaction or intervention if mimicked similar to  the structures of brain then such programs or applications becomes an Artificial Intelligent systems. If they are as such used for constructive purpose to support technological advancements it is best way forward for human’s survival of fittest [1].

Methodology:

Questions like “Which algorithm to be used?”, “What are the types & techniques in Machine Learning algorithms?” forms the main hypothesis to be answered to through this survey[2].

Literature:

The main ideas to think for a problem solver with machine learning algorithms were: What is the Business problem, Is my Objective requirements Operational/Strategic, How will a model be implemented & Algorithms capability that matches with requirements. The 3 ways of possibility to define the requirements are: Traditional statistical techniques on fundamentals, self-learning is ML & Neural networks are deep learning.

Survey on Real-world application and Research Directions from cybersecurity, smart cities, healthcare, e-commerce, agriculture etc.,[3] is the actual motivation for anyone to start with selection and dissemination of such knowledge structures in the machine learning arena. This should start from fundamentally dealing with the hypothesis discussed here. How to Select the Right Machine Learning Algorithm [4] describes the 7 key factors to consider when you have to select the right machine learning algorithms. The basis again where to use which algorithm is dealt with in click [5].

Guide to choose the right machine learning algorithm [6]:

  •     Size of the training data 
  •     Accuracy and/or interpretability of the output
  •        Speed or Training time
  •        Linearity
  •        No. of features


Figure courtesy: Choose-ml-technique at serokell.io[7]

Essentials, Principles, Types & Examples [8]:

  •       Data Vs Algorithm – terms to understand
  •        Explainability vs Accuracy trade-offs
  •        Principle is Y=f(X) in supervised learning
  •        Types or Techniques:

o   Supervised

o   Un-Supervised

o   Semi-Supervised

o   Reinforcement 

·       Examples: Based on Space, time and Output

·       How to run ML Algorithms

     
Figure courtesy Hacker noon [9].

Commonly used ML algorithms in 2021[10]:

·       Supervised

o   Linear regression

o   Logistic regression (a subset of Neural network)

o   Decision tree, CART

o   SVM algorithm

o   Naive Bayes algorithm

o   KNN algorithm 

·       Unsupervised:

o   K-means

o   Random forest algorithm

o   Dimensionality reduction algorithms, PCA

o   Association, Apriori, ANN [11] 

·       Ensembling:

o   Ensembling (Bagging, Bootstrap sampling) [12]

o   Gradient boosting algorithm and AdaBoosting algorithm

·       Reinforcement, Q-learning, Model-based value estimations,

o   GAN, Self-trained Naive Bayes [13]


Figure courtesy: Hui Li,  ML Cheat Sheet [15] 

·        Further tour:

ML Algorithms goes into more detailed single algorithms under each time[14]Good works suggests trends in similar lines for all portfolios of technology and the specific one on ML gives similar  overview as all above at [17]Scikit-learn[18] cheat sheet is quiet eye-opener. Compare two or more algorithms as suggested with step by step algorithms selection with python code at [16].Good works suggests trends in similar lines for all portfolios of technology and the specific one on ML gives similar overview as all above at [17].  Scikit-learn[18] cheat sheet is quiet an eye-opener. 

Figure Courtesy Scikit-learn[18] Hacker noon

Case : for Azure ML[20] 

The use case steps suggested for setup of a business requirement from Microsoft Azure found to be practical with the available resources and parameter tuning in own cloud setup

1.       Business scenarios and the Machine Learning Algorithm Cheat Sheet

2.       Comparison of machine learning algorithms

3.       Requirements for a data science scenario

4.       Accuracy

5.       Training time

6.       Linearity

7.       Number of parameters

8.       Number of features


Case for Smarter cities:

The Digital Twin Paradigm for Smarter Systems and Environments: The Industry use cases , many of the above and Canonical correlation Analysis for feature extraction type of task [20].

Case with Experiment implementation:

Commonly used Machine Learning Algorithms (with Python and R Codes) [22].

 As final remarks of a job interview questions and the like on how to choose consists of first classify the decision into data related and problem related [21].

 Conclusion:

 The survey put forward the ideas around machine learning by answering the hypotheses on which algorithms to be picked when and what does each one do. Though the writing itself is not detailed enough, it is a good collection for answering the fundamental questions such that the reader gets an overview in the field of Machine learning.

 References:

[1]    https://www.expert.ai/blog/machine-learning-definition/

[2]    https://www.analytixlabs.co.in/blog/how-to-choose-the-best-algorithm-for-your-applied-ai-ml-solution/

[3]    Sarker, I.H. Machine Learning: Algorithms, Real-World Applications and Research Directions. SN COMPUT. SCI. 2, 160 (2021). https://doi.org/10.1007/s42979-021-00592-x

[4]    https://towardsdatascience.com/how-to-select-the-right-machine-learning-algorithm-b907a3460e6f

[5]   https://www.datacamp.com/community/news/which-machine-learning-algorithm-should-i-use-raluply88ph

[6]   https://www.kdnuggets.com/2020/05/guide-choose-right-machine-learning-algorithm.html

[7]   https://serokell.io/blog/how-to-choose-ml-technique

[8]   https://www.knowledgehut.com/blog/data-science/machine-learning-algorithms

[9]   https://hackernoon.com/choosing-the-right-machine-learning-algorithm-68126944ce1f

[10]  https://www.simplilearn.com/10-algorithms-machine-learning-engineers-need-to-know-article

[11]   https://www.dezyre.com/article/common-machine-learning-algorithms-for-beginners/202/

[12]  https://www.dataquest.io/blog/top-10-machine-learning-algorithms-for-beginners/

[13] https://searchenterpriseai.techtarget.com/feature/5-types-of-machine-learning-algorithms-you-should-know

[14]  https://machinelearningmastery.com/a-tour-of-machine-learning-algorithms/

[15] https://blogs.sas.com/content/subconsciousmusings/2020/12/09/machine-learning-algorithm-use

[16]https://analyticsindiamag.com/how-to-choose-the-best-machine-learning-algorithm-for-a-particular-problem

[17]  https://www.goodworklabs.com/machine-learning-algorithm

[18] https://hackernoon.com/hn-images/1*9gGtNn2EXW1Zog-bjdGsHQ.png

[19] https://docs.microsoft.com/en-us/azure/machine-learning/how-to-select-algorithms

[20] https://www.sciencedirect.com/topics/engineering/machine-learning-algorithm

[21] https://www.youtube.com/watch?v=gZWhVj-g8Mc

[22] https://www.analyticsvidhya.com/blog/2017/09/common-machine-learning-algorithms

Labels: ,