# A way to use equations in HIVE!

in #stemlast year

I love equations! Lately, I have been thinking of improving some of the blogs by adding some cool formulas and math explanations. Maybe I am the only one who gets hyped about this, but I think it would be cool.

However, I haven't been able to use markdown equations here in hive. I started digging a bit on the internet and it seems like it is actually possible to do - so you might as well end up learning some math behind machine learning algorithms in my blog pretty soon!

The way to go about this is to use the Google Charts API which still works but it is deprecated, so I am still searching for a better alternatives - leave a comment below if you have any better ideas!

For now, I think I live by using this API, I have made a couple of examples of the equations:

Cost function:

Linear regression:

If you want to replicate these results you simply need to do the following:

![](https://images.hive.blog/800x800/https://chart.googleapis.com/chart?cht=tx&chl=f(x)=\sum_{i=1}^{n}m_{i}x_{i}%2Bb)

• https://images.hive.blog/800x800/ is for the image rendered size
• https://chart.googleapis.com/chart?cht=tx&chl= API call (formula type-image and specify to render)
• f(x)=\sum_{i=1}^{n}m_{i}x_{i}%2Bb the formula with some URL encoding types such as %2B for the + symbol. In the cost function I encoded %28 and %29 respectively for the parenthesis.

I think it is pretty cool!

Sort:

I find it ironic that computers do such a poor job displaying mathematical formulas and graphs.

It is not difficult to create programs that correctly position the elements of math formulas as was done with that google product you were using.

I think what happens is the mathematicians on standards committees are just so flipping arrogant that no-one has been able to create a standard for displaying formulas.

The same thing happens with formulas. One can easily create programs that send formulas to a graphics card in a low level language, but there isn't a good way to do formulas on web pages.

It is really bizarre.

I have actually never thought about it in this way but it is definitely both weird and annoying.