Math behind simple Linear Regression

0 comments

I have been wondering on how the math behind a Linear regression works as in most of the ML books that you encounter, the focus will be on giving you a linear equation and just plugging this equation in a Python library to solve for the slope and bias and then use it to predict the new values. It is very rare that they show you how to find the m and b values. So here in a piece of paper, I decided to try that out and it worked out very well! So if you want to learn it, try to understand what partial derivatives are!


In the above solution, I have just solved for m, which is the slope term in a Linear Regression. You can apply the same technique to solve for b! So what you effectively do is to differentiate one term while treating the others as a constant. In simple terms, this is called a partial derivative. A derivative is a measure of something that changes while a partial derivative is a measure of something that changes while treating everything else in this world as a constant! It's that simple! More on Partial Derivatives

What I have shown you here is a Simple Linear Regression, but the technique applies equally as good as a multi variate Linear Regression! Math is fucking fun - Once you understand it!

My Trek Remedy clocks 1000 km this season

0 comments

So as of today, I managed to clock on record a total of 1000 Km with my Trek Remedy 8. It is obviously much higher than that as for several rides I haven't turned my Sigma odometer device. But for the record, the mileage is 1000 Km for this year so far.


I have explored much of the singles trails around my area! It was fun riding this bike! I hope to do even more miles for the next season!

Yet another impact on the injured knee! Why would fate have it this way?

0 comments

Last Thursday, I took a day off. As the weather was good I decided to take my kids and my mom to Apeldoorn in the Netherlands. We wanted to visit the theme park Julianatoren and spend the day there. My mom is here with us in Germany to visit us and to take care of the kids during their summer vacation. Apeldoorn is a 2 hour drive from where we live. As usual, we did not manage to start early and ended up reaching our destination around 12:00. By this time, the park was already crowded. Thinking that my mom could not walk for extended periods in the park, I reserved a battery operated wheel chain the day before - only to realise later that it was a big mistake!

I reached the entrance, paid the entry, went and took possession of the battery operated wheelchair. To me it was simple to operate as explained by the service personnel at the park. My mom nodded her head as though she understood everything! She sat on it, drove for about 50 meters after which my elder daughter wanted to use the rest room. So I ordered my mom to park the wheelchair in a corner so that it does not hinder the pedestrians and other visitors to the park. She abided by what I said and started to come towards one corner. I was standing with my younger daughter in my arms and while my mom was navigating the wheelchair to the corner, my elder daughter was trying to help her giving directions on how to steer and corner. This somehow confused my mom and she gave full throttle and guess what, she whacked on my leg. As I was standing sideways with my left side of my body facing the oncoming wheelchair, my mom was dashing against my left leg and I started to scream with pain and told her to stop which panicked her even further and she instead of taking her hands off the accelerator, she accelerated even further and gave couple more strikes with the wheelchair - the impact being taken by my already injured left leg. Since I do not have my ACL, my left leg would easily bend against this impact and this caused immense pain. Luckily for me the wheelchair came to a stop by dashing against an elevated floor, if not I would have been probably fatally injured! All this while my younger daughter was in my arms. All this happened within a couple of seconds!

The impact of this freaky accident meant that I had to use my crutches for the next couple of days and also use a knee bandage like this one here to stabilise my knee. Subsequently the pain kind of went away after a couple of days, but I missed out on those bike rides that I have originally planned! I will henceforth be extra cautious when out in such situations.

So after all this drama at the park, it was me who was using the wheelchair at the park and my mom was walking comfortably! I shouldn't have hired the wheelchair in the first place and I shouldn't have given it to my mom to ride it without her having enough practice! Lessons learned!

Send it... yep! Sendin it...

0 comments

What does "Send it mean? It's a jargon used within the Mountain Biking community, especially the Downhill community that indicates that you are about to hit a jump and that you have to clear the jump! Jumpin on the trails requires technique and a lot of practice. One way to practice the technique is to do it using some artificially made ramps! That exactly was my DIY project this weekend! I went to the local store "Bauhaus" as it is called here in Germany and shopped for some wood and nails.

The dimensions for the ramp I wanted are {h = at least 30cm, l = at least 60cm}

I made the choice that my ramp should be at least 30cm from ground so that I have some decent enough lift off! For this to happen, I had to buy a single piece of wood and have it cut into pieces! I would then assemble the pieces together using the nails!

Here are some pictures!
It was fun to build it and it roughly took me 40 minutes to get it done! It is not perfect, but for what it costed me (roughly 15 Euros), this is absolutely fine! I will probably test it the next days and I'm sure I'll have fun with it!