Train a Vision Transformer on Small Datasets Using Keras

Train a Vision Transformer on Small Datasets Keras

When I first started exploring Vision Transformers (ViT) in Keras, I was amazed by their performance on large datasets like ImageNet. However, training these models on small datasets can be tricky. From my experience, with the right approach and some tweaks, you can successfully train a ViT for image classification even when the data is … Read more >>

How to Create a 3D Scatter Plot in Python Matplotlib

3D scatter plot in Python Matplotlib with points coloured by value, sized by a fourth variable and a colorbar

To make a 3D scatter plot in Python with Matplotlib, create a 3D axes with fig.add_subplot(projection=”3d”) and call ax.scatter(x, y, z). The same scatter() options you know from 2D plots (c, s, cmap, marker, label) work in 3D. This guide covers the basic Matplotlib 3D scatter plot, colour and size by value, groups with a … Read more >>

Matplotlib tight_layout wspace and hspace in Python

Matplotlib tight_layout wspace

I’ve encountered many situations where subplot layouts get messy. Whether it’s overlapping axis labels, titles, or crowded charts, handling subplot spacing is crucial to making your visualizations clear and professional. In this article, I’ll share practical insights on how to use Matplotlib’s tight_layout() function along with the wspace and hspace parameters to control subplot spacing … Read more >>

jQuery Remove All Options from Select

Remove All Options from Select in jQuery

As a jQuery developer with over 8 years of experience, I’ve encountered countless scenarios where dynamically managing select box options is crucial for creating responsive web applications. Removing all options from a select element is one of the most fundamental operations you’ll need to master. This comprehensive guide will walk you through everything you need … Read more >>

How to Set Y-Axis Range in Matplotlib Bar Charts

Set Y-Axis Range in Matplotlib Bar Charts

In my years of building data dashboards for US-based financial firms, I’ve realized that Matplotlib’s default scaling isn’t always perfect. Sometimes, the auto-scaling feature hides the small differences between data points that actually matter for your analysis. In this tutorial, I will show you exactly how to take control of your Y-axis limits to make … Read more >>

How to Create a Matplotlib Time Series Scatter Plot

How to Create a Matplotlib Time Series Scatter Plot

Visualizing data over time is a task I perform almost daily as a developer. While line charts are the standard, there are many times when a scatter plot is actually the better choice. In my experience, scatter plots are perfect for identifying outliers in time-based data or showing specific events that don’t necessarily have a … Read more >>

Abstractive Text Summarization with BART using Python Keras

Abstractive Text Summarization with BART using Keras

I have often struggled with information overload when analyzing lengthy corporate reports or news feeds. Finding a way to condense these documents into short, meaningful summaries without losing the core context used to be a massive challenge for my team. However, using the BART (Bidirectional and Auto-Regressive Transformers) model has completely changed how I approach … Read more >>

How to Rename Columns in Pandas

Rename Columns in Pandas

Last week, I was working on a dataset from the US Census Bureau, and the column names were a complete mess of cryptic codes and underscores. Working with column names like “B01001_001E” is a nightmare when you are trying to build a clean analysis or a dashboard. In my experience, the first step to any … Read more >>

How to Use Await in React Components

Await in React Components

In my experience of building React applications, one of the most common hurdles I see developers face is handling asynchronous data. It sounds simple enough: you want to fetch some data and show it on the screen. But if you’ve ever tried to put an await directly inside your functional component, you know things get … Read more >>