Showing posts with label Digitisation. Show all posts
Showing posts with label Digitisation. Show all posts

Monday, April 26, 2021

Learning Process of Machine Learning Algorithms - a precursor article


* Even though Supervised Learning is the most popular and frequently used algorithms among all the learning processes , all the machine learning algorithms respond to the same logic that is reading of miniscule or multiple sets of data at   a time and find meaningful patterns from the cited parameteric dataset , which will also find out the best contributing features from the data and then find out if any applicable models from the data


* The central most idea for a learning process is that one can represent reality using a mathematical function which the algorithm doesn't  know in advance  but will comprehend from the data and then can guess some of the important findings and predictions from the data . This concept is the core idea for all kind of machine learning algorithms


* As witnessed from several readings , all of the experts on the subject of machine learning do put their word on the reliability of Supervised Machine Learning and Classification as the most pivotal of all the learning types and provides explanations of the inner functioning which one can extend to other types of machine learning approaches as well


* The objective of the supervised learning classifier is to assign a class to an example after having examined some of the characteristics of the example . Such characteristics are called as "features" and they are both quantitative (numeric values) or qualitative(string labels) .


* In order to assign classes correctly , a classifier must first examine a certain number of known examples correctly , where the classifier must first examine a certain number of known examples closely ( example that one  can already have  a class assigned to them ) , where each one of the algorithms is accompanied by the same kinds of features as the examples that dont have any classes


* The training phase involves observation of many examples by the classifier that helps the algorithm to learn more about the learning process so that it can provide an answer in terms of a class whenever it sees an example without a class


 * We can relate to what happens in a training process by imagining a child learning to distinguish trees from other objects . This is not a first time process for a child to learn the attributes of a tree for first time , rather when a child sees a tree it also gets to learn associated attributes which also resembles that of a tree . Gradually this becomes a process which keeps continuing from time to time , again and again whenever perception occurs using the visual faculties of  the eye and processing by the brain infused with the conscious recognition of the environment . So whenever an image of a tree comes to the mind , the perception is kindled again and then one gets to adapt oneself with the picture of a tree .


* So , whenever a similar tree bearing leaves , green texture , a brown sap comes about in the mind of the child , one gets mentally attuned to the perception which also helps in recognition of other such similar objects in and around oneself . All these help a child create an idea of what a tree looks like by contrasting the display of tree features with the images of other different objects such as pieces of furniture that are made of wood but do not share other such characteristics of a tree .


* A Machine Learning Algorithm's classifier works in the same process . The machine learning algorithm builds its cognitive capabilities by creating a mathematical formulation which includes all the given features in such a way that it creates a function which can distinguish one class from another .

* Being able to express such mathematical formulation , is the representation capability of a classifier . From a mathematical perspective , one can express the representation process in machine learning using the concept which is called as "Mapping" . Mapping is a process which takes place when one discovers the construction of a function by observing the outputs of a function . This means that the process of mapping is   a retrospective one where one has to assume that this process takes place from the determination of the output by proper consideration of the input . One can   say that a successful mapping process of a machine learning process is similar to a child internalising the idea of an object where the child develops the required skills of learning from the environment and then using the knowledge acquired to distinguish the given set of objects when the need is called for .The child now after internalising the things , understands the abstract rules derived from the facts of the world in an effective manner so that when the child will see a tree , the child will immediately recognise the tree when a situation arises .


* Such a representation ( using abstract rules derived from real-world facts ) is possible because the learning algorithm has many internal parameters which constitutes of vectors and matrices of values . The dimension and type of internal parameters delimits the kind of target functions that an algorithm can learn . An optimisation engine in the algorithm changes the parameters from their initial values during the process of learning to represent the target's hidden function . I think the above paragraph is a bit complex to understand as it needs some explanatory level diagrams which could help suffice the need for proper understanding of the mentioned jargons .


The construct of any applicable Machine Learning Algorithm based on any mathematical construct with employment of statistical formulations of hypothesis conjectures would be covered under a separate title under the series of Learning Process of Machine Learning algorithms



Monday, April 19, 2021

Using Vectorisation Effectively in Python and R – a revision example

 


    ========================================================

     Using Vectorisation Effectively in Python and R – instance example

    ========================================================


·        While performing Matrix Operations, such as Vector Multiplication , its very hard to consider that the computer does all the forms of hard work .  What does one need to do while working on numbers in a Vectorised form?

 ·        So , while one is working upon numbers , one needs to put the numbers in the form of matrices , vectors and constants and then one can sum , subtract , divide and then multiply the numbers .

 ·        These operations can be performed upon any number which is in the form of Vectors .

 ·        So , when one deals with these vectorised form of numbers in Machine Learning , then one should also have a good ( good is a relative value that lies in between novice and expert ) understanding and know how on how to feed the vectorised data to the algorithm over which the encoded function is going to work upon , which would help the programmer to know and understand the results obtained after the processing of the data is done .

 ·        In order to obtain a correct result , one may need to feed the right data to the right algorihtm .

 ·        In Python, Numpy package offers all the functionality needed to create and manipulate the matrices . The "ndarray" objects allow fast creation of an array , such as a multidimensional matrix by starting with data which are queued into the lists

 ·        The term "ndarray" means "n-dimensional array" which implies that one can create arrays of multiple dimensions like one-dimensional array , 2 dimensional array , 3 dimensional array and so on .

 

 

=========================================

Using a simple Vector for creation of a Numpy List

=========================================

 

import numpy as np

y = np.array([43, 45,47,49,51])

print(y)

print(y.shape)

 

Output

[43,45,47,49,51]

(5,)

 

==================================

==================================

 

* The method "shape" can promptly inform someone about the shape of a matrix . In the above given example , one can see that the shape of the matrix is just a one-dimensional entity which reports only three rows and no columns which means that the object is a vector

 * In order to create matrices made of rows and columns , one can make use of lists of list items .

 * The contents of the list inside the main list are the rows of one's matrix

 

==================================

==================================

import numpy as np

X = np.array([1.1,1,545,1],[4.6,0,345,2],[7.2,1,754,3])

print(X)

 

==================================

==================================

 * The output of the following operation would yield a vector which one can reshape into any desired form of rows and columns .

 * Here , the numbers are filled into the new matrix stacked into it in the form of row data which is occupied from the top most to the lowermost elements of the array which are stored in the output object "X" which would store in it all the elements in an iterative manner containing all the elements in i,j manner . Elements in an iterative manner containing all the elements in i,j manner .

 * Operations with addition and subtractions with scalars using the numpy "ndarray" is the best method of performing any operation .

 

* One can do the following operation - sum , subtract , multiply or divide using the severall standard operators applicable over Python language in the given manner . Lets take two data-array objects .. a and b

 ==================================

a = np.array([[1,1],[1,0]])

b = np.array([[1,0],[0,1]])

print(a - b)

[[ 0 1] [1 -1]]

==================================

a = np.array([[0,1],[1,-1]])

print(a * -2)

[[ 0 -2 ]

[ 2 -2 ]]

==================================

 * In order to perform multiplication on vectors and matrices , one needs to use the "np.dot" function . The input for this function is two arrays which are of compatible sizes to multiply according to the given order

 ==================================

X = np.array([[4,5],[2,4],[3,3]])

b = np.array([3,-2])

print(np.dot(X,b))

[ 2 -2  3 ]

B = np.array([3,-2],[-2,5])

print(np.dot(X,B))

 ==================================


 * The same form of multi-dimensional array output can be also produced by an array which one can find in the below set of code . One does not need any additional set of libraries while using R , R performs the tasks using standard functions as given in the below set of code .

 

* One can define the dimensions of one's vector using the "length()" function . But one can use the dis() function instead for the matrices , because applying the length() function to a matrix shows the output to carry only some number of elements in it .

 


Ref : Machine Learning in R and Python - 

Friday, April 16, 2021

Python Program to create a Static Method - with sample code

 

Python Program to create a Static Method

 

# A Python Program can be used to create a static method which can be used to calculate the square root value of a given number

static method for finding square root value

 

import math

class Sample:

@staticmethod

def calculate(x):

result = math.sqrt(x)

return result

 

# accept a number from keyboard

num = float(input('Enter a number:'))

# call the static method and pass the number

res = Sample.calculate(num)

print(' The square root of {} is {:.2f}'.format(num,res))

 

Output

Enter a number : 49

The square root of 49 is 7

 

Thursday, April 15, 2021

Tech Commandments for a safer digital life - 5 principles to adhere to when using Internet

 

Tech Commandments for a safer digital life

 

* Technology has become a mammoth sized factor in our daily lives and to top it all , Technology is always on the change which means that one should always stay vigil of the changes happening around us as many perpetrators and miscreants are on the lookout for finding new ways to infiltrate into the loopholes that we set knowingly or unknowingly which leads them directly in hold of sensitive information which can lead to a big devastation if left unguarded and unprotected

 

* Some experts from leading security firms assert that one should always remember that any piece of our identity that we post online could eventually be used by fraudsters and hijackers / hackers to pervade into our online accounts for which one needs to keep oneself and connected members safe when online . These days bots ( trackers) can track any account and collect account information at any point of time

 

* Therefore in order to keep oneself on the guard and stay safe , some of the commandments that one needs to adhere to all the time are the following :

 

1) One should not overshare personal info

As many of us use high ended camera phones with very high or unlimited storage capacity , one gets into a clicking mode and becomes a self-proclaimed cameraman / photographer . But these days thanks to highly developed AI programs which can take even pictures as input parameters and retrieve all relevant information from the photo , one should stay vigil about the photos that one clicks , location , people in that photo , context and backdrop for that photo and several other factors before one gets into clicking mode to showcase one's photography skills

 

2) One should not use Weak and Easy to crack passwords

We all have a tendency to associate easy passwords which are small and easy to remember for all of our accounts as we normally want to skip ahead of all the mental work of recalling big and complex things whenever we want to get into our accounts .. be it social media accounts , bank accounts , insurance accounts

(and Swiss Bank Deposit accounts too .. ) . As mentioned , these days tracker bots can track all the gateways of access that an individual leaves upon their online pathways , so unrecognised and unregulated access into our trails can beonline pathways , so unrecognised and unregulated access into our trails can be

discovered by bots and provide the information to the collecting agency which is on the lookout of such paths which could be exploited . Many such agencies pass on these trail paths to hackers to peek into and steal out money / documents .. anything precious to them (remember .. "precious" of LOTR , one can turn into

Gollum for such "precious" things ) . Therefore , always make use of stronger and lengthier passwords which is one's somewhat safety check for stopping unwanted and malicious intrusion . Many people make use of password managers who make use of multiple accounts , but this is also vulnerable as these are stored in the form of either xml , json objects in the form of cookies which could be again collected from the browser plugins that one uses on a regular basis . Thats why , one should also try disconnecting from cookie storage from browser when one closes the session . And thus , the best thing to do is to note down all the important passwords over a piece of paper and keep them at a safe storage space .

 

 

3) One should use Multi-factor authentication or two-step verification

 

 

These days password comprehension can be done is so different forms by hackers that , if someone wants to any way hack into some account , then they will eventually get into the account and that too using several tools . Thats why most of the security experts recommend that one should make use of multifactor authentication (two-factor , three-factor etc) in order to access a given account which involves a user's verification before logging into account using a system of OTP over phone and authenticator apps that send temporary always changing codes that ensure that the user who is using the account is the real one and not a dummy or someone else

 

 

4) One should not share data about friends and Contacts

 

This comes as a completely new method of data siphoning which occurs when someone accepts any permissions to any app or software over the phone . This makes the app-owner a party to the shared information as requested by the app within the permission page of the application . Therefore, one thing that one needs to keep in mind is to keep a check over the permission page of the

applications that one installs .Best is .. one should try to limitise one's wants , keep few applications and software over one's phone and do not install those software that require a lot of permissions to be accepted before making use of the software .

 

5) One should always stay vigilant and skeptical

These days all the security experts accept the one rule of thumb for all security practices -- " Trust No One in this Greed Infested World" . Whenever you recieve any call ,message , email soliciting any personal information .. then do not trust any of message , email soliciting any personal information .. then do not trust any of the mails . This could be a phishing attack from someone who wants to profit out of undoubting people who out of trust and foolishness get entrapped in their untrustworthy traps , thereby losing security over their devices and mediums .Fraudsters nowadays can embed malware over legitimate looking emails within hyperlinks which once clicked could install unsuspecting software over your system all without anyone's coming to know of such a background activity running on your system . Therefore, whenever any suspicion occurs , always opt out of such apps , softwares , emails , anything (sigh ... wish I had known these earlier )

 

 

These days I personally feel .. the days of Nokia 1100 and Nokia 1600 , movies without real-looking CGI , games like Tetris and Mario were the best .

 

Fast Spreading Digital Adaptation in Emerging Nations and the associated "Theory of Everything" in the trade and commerce world - An article by Vivek Dash

 

Fast Spreading Digital Adaptation in Emerging Nations and the theory of Everything 

 

* Emerging economies have been struggling with growth through the 2010's and still the feeling of pessimism clouds over the present decade whether the steadfast growth trend could be seen to be going strong or whether the trend would be gauged down as it is being seen that People have accrued high amounts of debt during the ongoing pandemic which has become a detrimental factor to growth in not only emerging countries but also countries which are developed like USA , Russia , China , Japan , Germany , France , UK , Finland as questions over Growth tapping and keeping the same pace steady even during a pandemic period is of paramount importance to all

 * The answer to all the woes shrouding the question of development even during such cloudier and gloomy economic conditions, looming large and widespread is the harnessing of the Digital Revolution and Digital Adaptation. As most of the emerging nations have started adopting cutting edge technology at a much lower and lower cost which has allowed the countries to fuel domestic demand and overcome traditional obstacles to growth .

 * According to Reports , the number of smartphone users across the globe has skyrocketed from 150 million to 4 billion worldwide which approximates the total number of such people with a Smartphone device as nearly equals to or over half of the entire world's population . This has enabled most of the residents of the emerging world to access vital consumer and professional services over a phone which is no less than a computer in its kind and is much advanced than the personal computers which were there just a decade back .

 * According to reports from BCG - Boston Consulting Group , since 2014 more than 10,000 tech firms have been launched in emerging markets with half of them outside China

 * As per current trends and reports , India is having almost equal number of technology players as France and Germany and the number of such companies are growing much faster year on year .

* As per some key metrices and data collected by popular editorials , the onslaught and adaptation of digital revolution is much more in emerging economies than that of developed nations and has been growing at a much higher rate year on year .

 * Another report collected from some major editorials state that among the top 30 nations by revenue from digital services as share of GDP more than top 30 nations by revenue from digital services as share of GDP , more than half of them are in the emerging world . In such a scenario, it has emerged that Indonesia is much more advanced that countries such as Sweden and Finland which are Europe's most tech savvy nations

 * India ranks 12th in terms of digital revenues as a share of the economy

 * Since 2017 , digital revenue has grown in emerging countries at an annual pace of 26% compared to 11% in the developed nations

 * Led by e-commerce, the pace of growth in India has been even faster with revenues growing nearly 33% on year over year

* The European Centre for Digital Competitiveness scores G20 nations by the pace of progress in the digital ecosystem and "mindset" and thus puts four emerging nations in the top 5 category - Saudi Arabia , Indonesia , China and Argentina

 * The pressing question that has emerged from all this competitive talk is how have the developing nations adopted to digital technologies faster than the developed nations ? The widely acknowledged answer to such a question has come in the form of a simple answer that is Habit and tenacity. When some are wearing off and losing out on sheen as a result of their comfort seeking, some others rise who have the tenacity to struggle and get more resources for themselves as prize and with analogy it can be only reduced a cyclic process of growth and decay , decay and growth which applies to everyone be it person , society , principles , economies and even countries and continents .. and as well as the planet too (too much philosophy in an nutshell .... )

* The digital divide and access to information and services is narrowing down which used to be the key parameters upon which the developed nations had been brought up and this is trickling down to developing and under-developed nations too .

 * In the last decade alone , the number of internet users have doubled in the G20 nations which is astounding as a decade back access to internet was a distant dream for so many . (I first lay my hands upon internet services in the year 2008 , and the first time I got to own a computer was in the aftermath of 2003 ) . From that to this has been years marked with a boom in technological development which has been significantly very high in the last two decades alone compared to what the last century or any of the centuries ever saw in the history of the world .

 * Robustness of the governments to improve productivity by moving more and more services over to online format in order to make them more transparent and less vulnerable to corruption , which is one of the biggest deterrents / obstacles / vulnerabilities to corruption , which is one of the biggest deterrents / obstacles of doing business in the emerging world , which thereby creates a greater sense of trust and cooperation which in turn facilitates higher economic growth .

 * According to reports , the signle most factor for such kind of marked development to occur , the cost of starting or opening up business is a major driving factor which deters entrepreneurs from taking their feet out to start a business , innovation or self-sustained effort ; but since the cost of such factors has been in the decline in emerging or developing countries coupled with their in government support, guidance, motivation and cooperation such prospective entrepreneurs get a guided push for starting up as they can start their businesses and tools on their own and affordably , which these days could be just monitored and controlled within the grasp of their palms over a smartphone with internet .

 

* But as economies start evolving and growing, chances may arise that the things which catapulted such growth coupled with the rise of globalisation and access to great quality products from around the globe through way-to-go retail apps would slowly and slowly come down again and perhaps this could be a smaller miniscule side-effect of indigenisation which is again a cyclic effect which takes into factor indigenisation and globalisation which would also go all the time (You see ... one has to always keep in mind the cyclic effect of all things to understand all concepts of science , arts , culture , trade , war and even peace ... which encompasses the all round "theory of everything" )