Geek Logbook

Tech sea log book

How to Choose the Best Classification Model Based on Performance Metrics

When working on machine learning classification tasks, selecting the best model often involves analyzing various performance metrics like accuracy, precision, recall, and F1-score. In this post, I’ll walk you through how I evaluated and selected the best model for my dataset. The Dataset and Models I trained several machine learning models on my dataset, including:

Implementing Query Filtering in Express with Mongoose

In modern API development, providing flexible querying mechanisms is essential to allow clients to filter and retrieve data efficiently. In this post, we’ll go over how to implement query filtering using Express.js and Mongoose, focusing on handling MongoDB operators like $gt, $gte, $lt, $lte, and $in. Problem Overview We want to create a route that

Downloading Data from the SEC Website using Python

In this blog post, I’ll show you how to download a JSON file from the U.S. Securities and Exchange Commission (SEC) website using Python. The file contains company tickers, which can be useful for various financial analyses and applications. Steps to Download the File Here’s a complete Python script that handles the download: Run the

Understanding Idempotency in Python with Simple Examples

Idempotency is a fundamental concept in computing that describes operations which produce the same result no matter how many times they are performed. In this blog post, we’ll explore idempotency through the lens of Python, diving into its significance and providing examples that highlight the difference between idempotent and non-idempotent operations. What is Idempotency? In

Creating a Custom Column with a Random String in Power BI Using DAX

Introduction In Power BI, customizing your dataset by adding calculated columns can significantly enhance your data analysis capabilities. One common need is to generate random strings or categories for testing purposes, simulating scenarios, or assigning values like branch names, IDs, or categories to your data. In this post, we’ll explore how to create a custom

Best Practices: Using Direct SQL Queries in CodeIgniter

In this blog post, we’ll discuss the pros and cons of using direct SQL queries in CodeIgniter and explore alternatives that enhance security, readability, and maintainability. What is Direct SQL? Direct SQL means writing raw SQL queries directly in your code. It provides full control over the SQL, which can be appealing for quick queries

How to Implement MVC in CodeIgniter to Clean Up Your Views

When building web applications, it’s easy to end up with PHP logic mixed directly into your HTML views, especially in smaller projects. However, this can lead to messy, hard-to-maintain code. The Model-View-Controller (MVC) pattern is a great solution to separate concerns and make your application cleaner and more maintainable. In this post, we’ll explore how

Renaming Modules in Python for Clarity and Accuracy

Renaming modules in Python is an essential practice to improve code clarity and maintainability, especially as projects grow in complexity. Using intuitive and descriptive names helps in quickly understanding the purpose of each module, reducing confusion and potential errors during development. In this post, we’ll explore the process of renaming a module in Python and

Counting Covered Points on a Number Line

Introduction Algorithmic challenges often involve intervals and can initially seem complex. One such problem is determining how many unique points are covered by a set of intervals on a number line. In this post, we’ll examine a solution to this problem and explore potential improvements. Problem Statement Given a number line with several intervals representing