Monday, 1 December 2025

IaC Zoology

Infrastructure-as-Code has had its fair share of tech standards. Let's look at them.
  • Terraform - multi-cloud, open-source Infrastructure-as-Code tool that works across AWS, Azure, GCP and more
  • ARM templates - Azure's native JSON-based IaC format, verbose but powerful. Many companies still have ARM templates in their arsenal, even though it's time has come
  • Bicep - domain-specific language (DSL) for Azure (where said domain is IaC, or more broadly "declarative deployment of Azure resources") that simplifies ARM templates with cleaner syntax. A good one if you are not hybrid-clouding


Saturday, 29 November 2025

Boosting versus Bagging

Boosting and bagging are two classes of machine learning techniques.
Boosting is basically stacking mini-models that incrementally improve on previous models. Bagging is using ensemble/averaging techniques i.e. running models in parallel and computing some form of average.

Friday, 28 November 2025

ufunc in numpy - understanding universal functions

It operates on ndarrays. Here's the lowdown.

ufuncs operate on ndarrays in an element-by-element function. Several features are supported such as array broadcasting and type casting. 

Broadcasting is when a smaller array is spread over a bigger one. For example. a single number can be "broadcast" to every element of an array.  Analogously, a 1D array can be "broadcast" across the rows and columns of a 2D array.

The idea of "broadcasting" predates NumPy and was first implemented in an array-focused scientific programming language called Yorick from the 1990s.

statsmodels in Python

statsmodels is a Python package that complements scipy for statistical computation. 

The stable version is found here.

statsmodels takes ideas from other libraries and ecosystems, specifically it uses R-style formulas, and pandas DataFrames.  

Chances are you are using the library with other libraries too, like numpy.

It can be installed via Conda or pip. Examples:

conda install -c conda-forge statsmodel
python -m pip install statsmodels

Among the tricks statsmodels can perform are: time series analysis, various flavours of regression (OLS, generalized and weighted least squares), as well as PCA.

Thursday, 27 November 2025

Validating DataFrames in pandas

You may ingest a time series into a DataFrame in pandas. 

You may then need to access part of that DataFrame using something like dataframe.iloc[0] where the aforementioned command gives the row at position 0. 

However, what if that row is empty? There is a predicate dataframe.empty you can use as follows: 

if df.empty:
    print "DataFrame is empty"

DataFrames are like spreadsheets or SQL tables. They are the most commonly used data structures in pandas, and like a spreadsheet, columns don't need to be of the same type.

In Advance of Node.js Learning

Learn the basic rudiments of JavaScript. Include asynchronous JavaScript.

Connoisseur's Guide to JavaScript Engines: V8 Rules

Node.js uses the V8 JavaScript engine which powers Google Chrome (and is open sourced by Google).

Other browsers use their own engine, for example Firefox uses SpiderMonkey and Safari uses JavaScriptCore (aka Nitro). Edge was based on Chakra (a Microsoft project that was open-sourced) before being rebuilt with V8 and Chromium.