Machine Learning, Programming

Learn decision trees, Gini, pruning, and much more from scratch with hands-on in python

Image for post
Photo by Tim Foster on Unsplash

If you see, you will find out that today, ensemble learnings are more popular and used by industry and rankers on Kaggle. Bootstrap aggregation, Random forest, gradient boosting, XGboost are all very important and widely used algorithms, to understand them in detail one needs to know the decision tree in depth. In this article, we are going to cover just that. Without any further due, let’s just dive right into it.

Table of Content

  • Introduction to decision tree
  • Types of Decision Tree
  • How to Build a decision Tree from data
  • Avoid over-fitting in decision trees
  • Advantages and disadvantages of Decision Tree
  • Implementing a decision tree using…


Programming

Image for post
Photo by Tim Johnson on Unsplash

What is an API?

API stands for application programming interface; it is an intermediate interface for the website or mobile application to communicate with the backend logic. In simple terms Its like a messenger between requester and provider. A commonly used metaphor is a “waiter.” Think about it. The waiter is a messenger between the customers and the chefs in the kitchen. A waiter can understand the different requirements of customers, pass them to the chefs, and provide the dishes made by chefs back to the customers. Waiters are the essential middleman. The key benefits of waiters are that they can cater to all kinds of customers, and as customers are isolated from the kitchen, the business secrets are preserved(customers can’t steal your recipe). In this example, the waiter acts like an API. …


Previous part: Introduction to Processor Level Error Handling in Anypoint Platform(Mule 4) Part-2

Error handling scenario 9

A calling flow has an on error continue or propagate scope and a Try scope. Try scope has an on error continue scope. In try scope, the error occurs at processor labeled as E, and subsequent processors are not executed.

Image for post

As the flow is executing and the error occurs at the processor E, the error is thrown to the On Error continue scope of Try scope. After the last processor from this error scope is executed, the subsequent processors of Try scope are not executed and the Mule event is returned to calling flow without the error object. …


Previous part: Introduction to Processor Level Error Handling in Anypoint Platform(Mule 4) Part-1

Error handling scenario 8

A calling flow has an on error continue scope and a Try scope. Try scope has an on error propagate scope. In try scope, the error occurs at processor labeled as E, and subsequent processors are not executed.

Image for post

As the flow is executing and the error occurs at the processor E, the error is thrown to the On Error Propagate scope of Try scope. After the last processor from this error scope is executed, the subsequent processors of Try scope are not executed and the Mule event is returned to calling flow with the error object. Now calling flow also throws an error which is handled by its On Error Continue scope. …


Previous part: Introduction to Flow Level Error Handling in Anypoint Platform(Mule 4) Part-5

Handling Errors at Processor Level

For more fine-grain error handling of elements within a flow, processor level error handling is used. A “Try” scope is used for the same. Any number of processors can be added to a Try scope. The Try scope has its own error handling section to which one or more error scopes can be added.

Error handling scenario 7

A calling flow has an on error propagation scope and a Try scope. Try scope also has an on error propagation scope. …


Previous part: Introduction to Flow Level Error Handling in Anypoint Platform(Mule 4) Part-4

Error handling scenario 6

In this scenario, we will examine the effects of an error occurring in the child flow. the source flow will call the child flow and passes the Mule event to it. An error occurs in the event processor labeled E and subsequent processors are not executed. Child flow has an on error continue scope and calling flow has an on error continue or propagate scope(both will work in the same manner)present in them.

Image for post

When an error happens at processor E, the Event is passed to the on error continue scope of child flow. After the scope is executed, the error is not rethrown in the calling flow without executing further processors further processors of the calling scope are not suspended as the error response is not returned by child flow. A success message with payload is returned to the HTTP listener once calling flow execution ends. …


Previous part: Introduction to Flow Level Error Handling in Anypoint Platform(Mule 4) Part-3

Error handling scenario 5

In this scenario, we will examine the effects of an error occurring in the child flow. the source flow will call the child flow and passes the Mule event to it. An error occurs in the event processor labeled E and subsequent processors are not executed. Child flow has an on error propagate scope and calling flow has an on error continue scope present in them.

Image for post

When an error happens at processor E, the Event is passed to the on error propagate scope of child flow. After the scope is executed, the error is rethrown in the calling flow without executing further processors in calling flow and handled by calling flow’s On error continue scope. further processors of the calling scope are suspended and a success message with payload is returned to the HTTP listener. …


Previous part: Introduction to Flow Level Error Handling in Anypoint Platform(Mule 4) Part-2

Error handling scenario 4

In this scenario, we will examine the effects of an error occurring in the child flow. the source flow will call the child flow and passes the Mule event to it. An error occurs in the event processor labeled E and subsequent processors are not executed. The error is rethrown and the subsequent processors in calling flow also are not executed.

Image for post

The source flow and child flow, both have flow level error handlers with an on error propagate scope. When the error occurs at processor E, the Mule event is directed towards the first processor in on error propagate scope of child flow. After scope execution is completed, the error is rethrown to calling flow. …


Previous part: Introduction to Flow Level Error Handling in Anypoint Platform(Mule 4) Part-1

Error handling scenario 3

In this scenario, there is a flow level error handler with an On error continue scope. As the flow is executing and the error occurs at the event processor labeled E. Because of this processor P and any subsequent processors will never be executed as shown in the exhibit below.

Image for post

In this scenario, the Mule event is passed to the first processor of the flow level error handler. after all processors from an on error continue scope is executed, then the error does not gets rethrown and a success message is returned. …


Prerequisite for the article: Introduction to Error Handling in Anypoint Studio(Mule 4)

Error handling scenario 2

In this scenario, there is a flow level error handler with an On error propagate scope. As the flow is executing and the error occurs at the event processor labeled E. Because of this processor P and any subsequent processors will never be executed as shown in the exhibit below.

Image for post

In this scenario, the Mule event is passed to the first processor of the flow level error handler. after all processors from an on error propagate scope are executed, the error gets rethrown. …

About

Sanket Kangle

Software Engg, Data enthusiast, IIT KGP alumnus, Expertise in conceptualizing and scaling a business solution based on new-age technologies — AI, Cloud, API

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store