A.K.A Predictive Analytics.
The word Machine Learning itself sounds very exciting and every single day its usage is only getting bigger and bigger..
The closest definition of ML I’ve come across is as below..
A Computer Program is said to learn from Experience E, with respect to some class of Task T and a Performance Measure M… If its Performance at the tasks in T, as measured by M improves with Experience E
ML lets us find patterns in existing data, with the help of which a model is created. Now this model will be used to do predictive analysis or learning by recognizing patterns in the new data.
Some technical Jargons:
- Training Data
- Supervised Learning
- Unsupervised Learning
- Reinforcement Learning
- Target Value – What you are trying to predict
- Regression [Supervised Learning]
- Classification [Supervised Learning]
- Clustering [Unsupervised Learning]
- Model [Is responsible for making the prediction]
- Decision Trees
- Neural Networks
- K Means
To be Continued..
Some assorted notes regarding Tensor Flow.
Current version = TF1.3.. On Windows, TF1.3 can be instaled IF and Only If Python Version 3.5.2 is installed [ and not any other version]
TF is a low level library which provides an interface for
- Expressing ML algorithms and
- An Implementation for executing such ML algorithms..
- Open Source
- Scale able
- From Google
All data in TF are termed as Tensors, representing an n-dimensional array. These Tensors flow between different operations to produce the output and hence the name – TensorFlow
Training a Model with TF..
- Data Preparation
- Loss Calculation
Who said you cant make code look like a piece of art?
Cheers to Chaining Design Pattern – A must know for developers..
Here is a self explanatory example..
While working on MongoDB, I accidentally ran a find() count query incorrectly which resulted in something interesting.
While I wanted to execute db.team.find().count(), I ended up hitting enter key a bit too sooner and resultant query in the mongo shell was db.team.find().count [yeah, without the ()]
While I was expecting an error, the shell actually responded with the function definition of count() method and it goes as below..
So, above is what exactly happens when we call find().count() in the shell.
So with this, you can start looking into the design and implementation of shell functions and understand the login underneath.
Interpreting the query definition ourselves, we can get the count of collection as below as well.
- Grab a collection into variable v.
- Find the count of v
- use the convertToCountCmd to get the json object
- var cmd1 = v._convertToCountCmd()
- Execute the runReadCommand to get the details of count.
- Will give the exact count needed.
Below picture depicts the same.
Well, Now thats fun..
Also, Here is how the find() method definition looks like..
One final thought before ending this blog post, will MongoDB allow us to extend the functionality of these methods? For Ex, can i create my own custom Count method using or my own shell function ? At this moment i’m not sure..
Calling all #Mongo experts to answer 🙂
Directives in AngularJS helps in extending the power of HTML.
The important responsibilities of directives are
- DOM manipulation [ng-show]
- Relieving view events [ng-click]
- Widgets [via custom directives]
AngularJS provides a set of build in directives like ng-bind, ng-class etc.
Custom Directives can also be written quite easily. We can either use
- Link function of the directive to define how the directive should behave.
- Create a Directive Controller and put the logic.
Directives in your View/HTML can be written as:
- Element Names or Tags (E)
- Attributes (A)
- Classes (C)
- HTML Comments (M)
(E, A C or M are restriction types)
Note : Angular normalizes an element’s name or tag to map elements and directives. More details can be found here.
Custom Directive Code Snippet:
Few important points to note here:
- Angular doesn’t complain if there are multiple directives with the same name declared on a page.
- While loading the Dynamic DOM, Angular compiles all the directives [including ones with same name as in our examples] but only executes the first directive.
- Changing the order of the directive declarations having the same name impacts your output.
- Hence its vital to name directives uniquely.
My next post will talk more about
Requiring Directives within another and isolation of scope.
MEAN and How..
MEAN is one of the leading full stack java script application development stack which is currently widely used across industry to build large scale DIRTy [Data Intensive Real Time ] applications.
Of course we’ve had LAMP, WAMP and other full stack frameworks during the yester decades. However, MEAN beats them all in many ways and importantly it is Platform independent. Your Code will work on Linux, windows and heck even mac.
The essence of MEAN is Java script and i’ll continue to blog about a few things here for the betterment of the world 😛