As we discussed in one of our article about How and when does the Decision tree stop splitting? Gain Ratio is modification of information gain that reduces its bias. Gain ratio overcomes the problem with information gain by taking into account the number of branches that would result before making the split.It corrects information gain by taking the intrinsic information of a split into account.We can also say Gain Ratio will add penalty to information gain.
We already know how to calculate Gain or Information Gain

Where S1,S2…….Sn are the subset resulting partitioning S for Attribute A
For example:
From the below image I can say A is sunny where S1,S2…Sn are the subsets like {Yes,No}

Lets calculate Gain Ratio:
We already calculated Gain in our article Deriving Decision Tree using Entropy (ID3 approach)
PFB table.

Lets calculate Gain Ratio for Outlook:


Once we calculate for remaining variables below will the Gain Ratio for all variables.

Note:
The attribute with the maximum gain ratio is selected as the splitting attribute
Hey Viswateja3, do you have the gain ratios of wind and humidity flipped? The gain ratio is generally supposed to decrease the gain value in order to incorporate the number of variables in the column correct? If that is the case then you have gain increasing for the wind column after calculating the gain ratio.
LikeLike