Tuesday, 5 September 2023

Road Trip Southern to Northern California in Pictures

We had planned to travel along the CA -1 (Pacific Coast Highway). However, parts of the highway were closed but we still had loads of fun visiting these places. It was extremely hot in California a couple of days before the road trip but thankfully the weather God decided to be generous and we were blessed with very pleasant weather during the road trip. 

Here are the stops and the stunning views along our road trip. 

1. Morro Bay - Finally explored the Panoramic mode of the phone because of the wide landscape 😆









2. Paso Robles - Street photos: A wonderful stop mid-journey. The place is famous for its wineries and olive groves. 











3. Carmel by the Sea - A must-stop place. Simply walking on the streets of this place is fun. 












We then did a tour of the 17-mile drive which surprisingly has 17 spots. It is a scenic drive through the Pacific coastline which lies in the Monterey Peninsula of California. The next few photos are from the 17-mile drive. 

4. The Landscape












5. Pebble Beach and the Restless Sea















6. Lone Cypress Tree















7. Pescadero Point - Ghost Tree















And a few other snaps: 










Saturday, 11 January 2020

An encounter with a wise man


I recently visited an ISKCON temple along with my friend and I had a very interesting encounter with a wise man. We were having the Prasad after the darshan when I spotted a person who seemed to radiate positive energy. Generally, I don’t talk to strangers but an interaction with this person seemed imminent.

‘How did you find this temple?’ was the first question I asked. ‘It was good but there are certain things that I can’t comprehend. First of all, there are signboards all over the place which say that chanting the Lord’s name for so and so times will help you in overcoming the challenges of the Kalyug. I’m perplexed looking at these signboards. I understand that chanting the Lord’s name will help in building your courage and faith but it is an individual’s responsibility to go face to face with the challenges and come out at the top. That’s the essence of Karma. I felt that the element of faith could have been better explained to the masses. What do you think about it?’
I replied ‘I couldn’t agree more with what you just said. I think they have put up these boards as people look for an idol, for a god that can come to their rescue when the times are tough. In these situations, it becomes difficult to grasp the real meaning of faith and courage. So I would say that these boards may be a source of strength for a lot of people and that’s why these boards are up.’
The man seemed to like my answer and he continued ‘I like how you are trying to balance the scenario.’

I then moved on to the topic of the temple’s aesthetics. I said ‘No doubt the temple is beautiful but a lot of money has been invested into building this place. I felt the money should have been invested elsewhere maybe building educational institutions or healthcare facilities.’
The man replied ‘You seem to have a kind intention of trying to help people with monetary means. However, what you’re thinking is an ideal scenario, and the world as you must be knowing is imperfect. While people should be spending some time in a peaceful environment getting away from their countless thoughts they fail to do us. So the temple provides an abode for the people to pray in silence moving away from their thoughts and focusing on the lord. This is true for people of all religions. But I do agree that temples should be simplistic and not too glitzy as that defeats the purpose of humble living.’ I was amazed by this insight.

He then moved to a thought that I was holding in my mind. ‘I think we both will agree on the point that it is unnecessary to sell Lord’s posters and idols at an exorbitant price. There are many places in this temple where we read about how a materialistic lifestyle cannot lead to a happy life and then there are posters so heavily priced that force you to have materialistic gains. That seems to contradict the very philosophy of moving from a materialistic to a spiritual lifestyle.’

It was turning out to be a fruitful conversation when I asked this person his name.
He said ‘My name is Krishna…’

Sunday, 5 January 2020

Guidelines for a leadership position



January 2020: I was promoted to the role of an Apprentice Leader at Mu Sigma. Apprentice leader can be thought of as a Data Science Manager where we have to continuously strive to improve the quality of the team that will be conducive for its growth. Transitioning into a manager role was certainly challenging. In addition to solving technical problems, there were new responsibilities such as collaborating with multiple people, ensuring that your team is motivated and inspired.

I have listed down a few guidelines (and not rules) that I felt are important to be successful in a leadership position.  

  1. Willingness to take up challenging tasks: I will be doing a lot of work that I haven’t done before and I will be pushed out of the comfort zone. I need to be prepared for this. In order to get results for these tasks, the points below will be of utmost importance
  2. Time management: The importance of time management can never be stated enough. When there are busy days, having a to-do list and a schedule will be very effective. Also, it is important to be in the present and not think about other issues at that point in time. Context switching is a skill that comes in handy in management
  3. Not getting affected by environment and people: Be ready to listen to opinions that are not aligned with my opinions. Be ready to be criticized and not get pissed off when people show a lack of understanding. In such cases, if I feel that I have a strong point that can show a different perspective based on my observations, then make sure it is being articulated in a calm and composed manner without insulting or criticizing the other person. Also getting angry is natural but wasting a considerable amount of time because of the anger is not worth it
  4. Be strong and decisive: The ability to take timely and tough decisions are indispensable in a leader’s toolkit. Additionally, I need to be impartial and unbiased while making decisions. It is difficult but it is what the role demands
  5. Be a powerful narrator: Many a time it will be necessary to promote the work being done or to present an impactful project. In such cases, it is essential for me to have the necessary storytelling skills with a powerful narrative. The message has to be loud and clear when discussing something critical
  6. Be persistent in your initiatives: No matter how lofty any idea is, it will not survive the test of the time if the leader is not being persistent with it. Does that mean the leader should never change any plan? No that’s not true. If the data shows that the plan is not working out then the leader should be the first one to quickly change the plan and take learnings from the failure
  7. Be willing to change beliefs and personality depending on the circumstances: I have faced this issue many times owing to my previous role. Now that I have been promoted I should grab this opportunity and hone my leadership skills
  8. Understand when you are getting stressed and relax: Generally stress leads to stiffening of the body. It is easy to be observe that. In such cases, taking a deep breath relaxes our muscles. The brain -- by observing that the tension no longer exists in the muscles -- will be free of stress and will lead to positive reinforcement of a good mood
  9. Be ready to seek help and talk to people: Talking to people gives us a new perspective and also leads to an improvement in our networking skills. Asking for help when stuck in a problem is also equally important
  10. Consistency: This is a crucial dimension as I have seen that consistency leads to incredible results. Consistency in sleeping time especially on Weekdays is key to get a good rest and waking up fresh. Consistency in going to gym builds up the momentum and develops a good physique. Consistency in preparing breakfast leads to a healthy diet and good digestion. Consistency in planning the day right after going to the office gives a direction for the rest of the day


While these 10 principles are being followed, it is also necessary to take a break and reward yourself.

Saturday, 14 July 2018

Cross Validation - Model checking, not model building

1st Update on 11th August 2020
2nd Update on 4th August 2023
3rd Update on 25th September 2023


Cross-Validation 

Cross-validation is a popular technique that is used for model evaluation in machine learning. If you skim through any Kaggle Kernel then you're bound to find Cross-validation in the script. It allows us to evaluate how our model will work when faced with unseen data and extends the concept of train-test datasets. It is also used to counter overfitting by examining how well our model generalizes.

CV has 2 main objectives: 
1. Give a good estimate of how our model generalizes to unseen data
2. Compare the performance between different models or a combination of hyperparameters 

I had this question about cross-validation. Suppose we do 5 fold CV, we are splitting our dataset into 5 portions and then training and testing on each portion. Then how are we supposed to choose which of these models is the best?

A similar question was asked on StackExchange which cleared my concern.

Also, this link from Machine Learning Mastery was helpful.

An example of choosing the best type of model. Let's consider a classification problem and we want to try Logistic Regression and Random Forest. Now, in this case, we will compare the CV error of both methods and choose the one that minimizes the error. 
Suppose Logistic Regression is a winner here. We will thus discard all the models that were built during the CV and train the model on the entire dataset. This model will then be utilized for predictions.

An extension to the above problem: We considered Logistic Regression and Random Forest in the above scenario but the question of hyperparameter tuning will now arise.
In logistic regression, we have L1, L2 regularization and in the random forest, we can vary the number of trees, maximum number of features etc. Hence, we are not just trying 2 models but a lot of variations amongst these models as well. Scikit Learn's GridSearchCV can be used here as it will iterate through all the variations and find the optimal model with its hyperparameters.
Now that we are aware of the best model along with its hyperparameters, we can train the model on the entire dataset.

Cross-validation Pseudocode:
Here we divide the training dataset into k-folds and k-1 folds are used for training and the remaining fold for validation
1. For 1 to N hyperparameter combinations:
    i. For 1 to k folds: #(The step repeats holdout approach k times)
        Train the model on k-1 folds and compute the validation error.
    ii. Calculate the average validation error
2. Choose the hyperparameters with the lowest average validation error and evaluate the model on test error

Here is the link to an example jupyter notebook.

Holdout validation:
We understood the concept of cross-validation but there is yet another strategy that can be adopted for choosing the best model or the model with the best hyperparameters. The strategy is called "holdout validation". 

Here, the dataset is divided into 2 sets: training and testing. However, the training dataset is further divided into training and validation sets. Thus, we would train our model on the training data and then evaluate its performance on the validation dataset. We could then compare the validation metrics between different models or if we want to choose the best hyperparameters. 

Once, the best model is selected we can then train it on the entire dataset and compute the test dataset metrics to understand how well our model generalizes. The con of this method is that we would choose only a small portion like 10% of the training data as our validation data and our decision would be based on this validation metric. 

Holdout Validation Pseudocode:
1. For 1 to N hyperparameter combinations:
    Train the model on the training dataset and compute the error on validation data.
2. Choose the hyperparameters that generalize the best and evaluate the model on test error

Here is a great link that explains the difference between holdout validation and k-fold cross-validation.

Sunday, 31 December 2017

Travelogue: Alleppey and Varkala

Kerala, God’s own country, is an Indian state, well known for its serene backwaters, palm-lined beaches, national parks and various other things. I went to Kerala with a group of friends for the long weekend having visited this state once way back in 2000 with my family. We traveled to Alappuzha (Alleppey) and Varkala in this tour.

We started off on 22nd Dec midnight in a tempo traveler. We were first traveling to Alleppey which was located at a distance of 600kms from Whitefield, Bengaluru. It generally takes about twelve to thirteen hours to cover the distance and we were expecting to reach the place by two in the afternoon. However, there were some obstacles along the way as the traveler’s tyre got punctured at around 3AM. It delayed us by about half an hour. Getting the Kerala permit was also time-consuming as it took us around ninety minutes to get the permit and it was pretty expensive at Rs.6500. As if this wasn’t enough there was heavy traffic owing to construction work all along the roads which was further aggravated by Christmas holiday season. 

Backwater is a part of a river where there is little or no current and one simply cannot miss the scenic backwaters of Kerala. We had intended to cruise along backwaters in Alleppey having booked a houseboat which included a stay at night. Having stuck in traffic the backwater sail started looking a distant possibility. Moreover, the houseboat gets stationed at a place by around six in the afternoon. We were going to Alleppey via Thrissur, Kochi, Ernakulam and one couldn’t miss the sea of CPI-M flags present every hundred yards. We finally managed to reach our destination at 5:45pm. We had missed sailing through backwaters which was a major draw to the houseboat but our caretaker assured us that he can arrange for the same the next morning. Hearing that was a big relief. Anxious to get to the destination we had skipped our lunch and as soon as I set foot in the boat I pounced upon the food that was kept ready for us. To my delight, the food included fish fry. That very night I had two meals within a span of three hours.

The next morning sharp at 7AM the boat roared to life and we set out on a journey through the backwaters. We cruised along the picturesque backwaters covered in the lush vegetation of palm trees which teamed up with aquatic wildlife. We also saw some other boats pass by us with tourists having a good time. We sailed at a leisurely pace getting away from the hustle and bustle of day-to-day and city life. It was definitely a relaxing journey. Here are some of the pictures which capture the essence of what we witnessed.


Present day houseboats are used for tourism but I was curious to find out what was their purpose in older times. I got to know that these houseboats were used for carrying tons of rice and spices to Kochi and each houseboat could hold up to 30 tons of goods. They were earlier called Kettuvallams. Let’s also have a look at the structure of the boat. The hull is the main body of a ship or a boat and we can think of it as the main framework. Wooden planks held together by ropes of coconut fiber make up the wooden hull. We notice that these boats have a thatched roof cover which is made up of Bamboo sticks and palm leaves.

Next destination was Varkala, approximately 120KM drive from Alleppey. From Kollam, Google Maps took us through a rustic road rather than the bustling city stretch. We drove past the charming coastal towns and the scenic view reminded me of the Sierra Nevada track in Roadrash game. 



We had booked Airbnb cottages in Varkala and it was quite cheap. The best part was that it was just 100 meters away from the beach. There was a narrow road from the cottages that led to the beach. We reached Varkala at around 2 in the afternoon and it was time to have lunch. We had already decided upon the place that we were going to have lunch at and we started off for the beach with that intention. However, there were only a few restaurants lined up along the beach and our decided restaurant was not to be found there. Google Maps showed that the restaurant was on Varkala cliff. Reaching the cliff included a steep walk up from the beach. The cliff has a large variety of great restaurants (mostly Tibetan), cafes and shops.  The view of the beach from the cliff is breath-taking.



After a lavish lunch, I could no longer resist the magnetic force of the beach and we descended to the beach from the cliff. The beach is quite clean and unspoiled despite a lot of tourists flocking to this place. There were both domestic and international tourists here. The sea, however, had strong current and big waves. We only got knee deep in the water and didn’t risk going any further. We then had a walk along the long stretch of glorious sand. Overall it was a refreshing experience.  

Before embarking on the journey, I had made up my mind of sampling the local cuisine with the primary focus on seafood. If one is a seafood lover they simply cannot resist the fish delicacies found here. At night in Varkala, I had prawns masala served with rice and also a portion of steamed butterfish in banana leaf. No wonder I was treated to a gastronomical delight.

We reached Bengaluru back in the early hours of Monday morning. The trip was a much-needed break from the daily routine with sun, sand, seafood, and serenity.  

Sunday, 3 September 2017

Shoe dog by Phil Knight

Shoe dog is a memoir by Phil Knight, the co-founder of Nike. I've completed reading the book and have to say the book is simply terrific. It recounts how Knight and his team went about building the company from scratch and how they faced insurmountable challenges and obstacles all along the way. The book is so engrossing that you feel that all the events are unfolding right in front of your eyes.

I loved this book because it gives out a message that if you have the determination and the grit to achieve something then you will definitely sail through. The author being an accountant also brings in accounting concepts such as assets equal liabilities plus equity. I got curious about these concepts and ended up watching youtube videos and had a fruitful discussion with my father who is from a financial background.

The book produces valuable messages throughout the book. The message on the art of competition was one that hit me really hard. Knight goes on to explain that the people who succeed in the competition are the ones who master the art of forgetting. You need to forget your past, your pain, and your doubts and most importantly forget your limits. Another key takeaway from the book would be the way Knight describes his internal chant: fail fast. He explains that when Nike's team were about to take terrifying risks they always had it in the back of their minds that they might fail. They only hoped that they would fail quickly so they would have enough time to implement all their hard-won lessons.

It's not short of quotes as well. Here are some of my favorite quotes:

  • "The man who moves a mountain begins by carrying away small stones" - Confucius. It reminded me of Dashrath Manjhi 
  • "You could do all the running it takes to keep in the same place. If you want to get somewhere else, you must run at least twice as fast as that" - Lewis Carroll
  • "The cowards never started and the weak died along the way -- that leaves us"
Overall it is a book not only meant for entrepreneurs but also for any person that has the willingness and endurance to turn a dream into reality. The memoir is guaranteed to get you inspired.