Press "Enter" to skip to content

Day: September 20, 2024

Fun with the Cauchy Distribution

John Cook checks out fat tails:

Someone with no exposure to probability or statistics likely has an intuitive sense that averaging random variables reduces variance, though they wouldn’t state it in those terms. They might, for example, agree that the average of several test grades gives a better assessment of a student than a single test grade. But data from a Cauchy distribution doesn’t behave this way.

This is one of my favorite distributions to mess with, though I’m glad few things naturally follow a Lorentzian. I had a colleague of mine build an Excel spreadsheet to describe the behavior, showing that results never converge and you could easily pull values 50+ “standard deviations” from the “mean.” I use scare quotes there because neither concept actually exists for the distribution, but if you mistake it for an awkwardly thin normal distribution, it can lead to some interesting results.

Leave a Comment

Generating Embeddings in Oracle from a Function or Trigger

Brendan Tierney continues a series on generative AI in Oracle:

In my previous post, I gave examples of using Cohere to create vector embeddings using SQL and of using a Trigger to populate a Vector column. This post extends those concepts, and in this post, we will use OpenAI.

Warning: At the time of writing this post there is a bug in Oracle 23.5 and 23.6 that limits the OpenAI key to a maximum of 130 characters. The newer project-based API keys can generate keys which are greater than 130 characters. You might get lucky with getting a key of appropriate length or you might have to generate several. An alternative to to create a Legacy (or User Key). But there is no guarantee how long these will be available.

Assuming you have an OpenAI API key of 130 characters or less you can follow the remaining steps. This is now a know bug for the Oracle Database (23.5, 23.6) and it should be fixed in the not-too-distant future. Hopefully!

Read on to learn more.

Leave a Comment

Connecting to Power BI as a Guest User

Koen Verbeeck can only enter a tenant with explicit permission:

Sometimes your Microsoft Entra ID account (formerly known as Azure Active Directory) is added as a guest user in another tenant. This happens quite a lot when you’re a consultant and your client can’t create a new user in their own tenant, so they add the account of your own company as a guest instead. If you’re not a consultant, it can also happen after a merger or acquisition and you’re suddenly stuck with multiple tenants.

Yeah, this is a real annoyance with Microsoft Fabric / Power BI. Koen links to a 5-year-old feature request that I recommend upvoting.

Leave a Comment

Updating the Default Lakehouse of a Notebook

Sandeep Pawar makes a change:

I have written about default lakehouse of a Fabric notebook before here and here. However, unless you used the notebook API, there was no easy/quick way of removing all/selective lakehouses or updating the default lakehouse of a notebook. But thanks to tip from Yi Lin from Notebooks product team, notebookutils.notebook.updateDefinition has two extra parameters, defaultLakehouse and defaultLakehouseWorkspace which can be used to update the default lakehouse of a notebook. You can also use it to update environment attached to a notebook. Below are some scenarios how it can be used.

Click through for those scenarios.

Leave a Comment

Hierarchical Data Types in Postgres

Florent Jardin builds a hierarchy:

The SQL standard defines a set of rules so that database systems can be interchangeable, but there are small singularities in the wild. In this regard, the hierarchyid data type provided by SQL Server is a striking example. If you are switching to PostgreSQL, two solutions are available to you.

A first and simpler solution consists in linking each node to its parent using a new parentid column and applying a foreign key constraint. Another, more complete approach consists in using the ltree extension. This article deals with the latter case.

Read on to learn more.

Leave a Comment

Page Navigation in Power BI

Nikil Prabhakar turns the page:

Navigating between pages in Power BI reports is a critical aspect of creating a smooth and interactive user experience. Over time, Power BI has introduced several ways to implement page navigation, each with its own benefits and challenges. In this article, we’ll explore three different methods of page navigation and their use cases:

  1. Button Navigation
  2. Page Navigator
  3. Slicer and Button Combination

Read on for those three mechanisms. There’s also a video taking you through the process.

Leave a Comment