Skip to content

Commit

Permalink
feat(ai-unlimited): setup docs for fabric (#157)
Browse files Browse the repository at this point in the history
* feat(ai-unlimited): setup docs for fabric

* feat(sidebar): custom sidebar config for ai unlimited docs

* Initial real content

* content up to beginning of use case

* remaining initial content

* all function links added & troubleshoot new folder

* fix(sidebar): fix build issue caused by custom sidebar

* for parallelism with marketplace tiles

* Kevin-Rob changes to in-db functions

* fixed typo

* fix(docs): fix sidebar issue in ai-unlimited docs

* changes for creating own lakehouse

* add save-work image

---------

Co-authored-by: “bsahitya” <“[email protected]”>
Co-authored-by: MEM4GH <[email protected]>
  • Loading branch information
3 people authored Nov 19, 2024
1 parent 188ec05 commit 040652c
Show file tree
Hide file tree
Showing 26 changed files with 551 additions and 2 deletions.
31 changes: 31 additions & 0 deletions custom-sidebar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// custom-sidebar.js

// Custom function to modify sidebar items
function enhanceSidebarItems(items, dirName) {
// Ignore files under the fabric folder in the ai-unlimited sidebar
if (dirName !== 'fabric') {
items = items.filter(
(item) =>
(item.type === 'doc' && item.id.split('/')[0] !== 'fabric') ||
(item.type === 'category' &&
item.link?.id.split('/')[0] !== 'fabric' &&
item.label !== 'fabric')
);
}
return items;
}

// Custom sidebarItemsGenerator function
async function customSidebarItemsGenerator({
defaultSidebarItemsGenerator,
...args
}) {
const { dirName } = args.item;
const sidebarItems = await defaultSidebarItemsGenerator(args);

return enhanceSidebarItems(sidebarItems, dirName);
}

module.exports = {
sidebarItemsGenerator: customSidebarItemsGenerator,
};
1 change: 1 addition & 0 deletions docs/fabric/cell-sum.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/fabric/close-nb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/fabric/disconnect.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/fabric/drag-data.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 94 additions & 0 deletions docs/fabric/first-use-case.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
id: first-use-case
title: Try the use case
description: Now that your notebook is ready, try out the data preparation use case.
sidebar_label: Try the use case
sidebar_position: 2
pagination_prev: null
pagination_next: null
displayed_sidebar: fabricSidebar
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Try the use case

The sample notebook has information about applying the AI Unlimited in-database functions to different stages of data preparation for a hypothetical use case. The other sample notebooks, financial customer journey and user segmentation, do the same thing. We will not cover those details here and will instead let you discover that through the notebook itself.

By default, the sample notebooks create tables in memory that are destroyed when the notebook is closed or disconnected.

In this section we will look at how to:
- Select tables from the Lakehouse explorer as an easy, optional way to find data
- Write to the lakehouse
- Find data between sessions

## Evaluate a table in the notebook

Scroll down to section 2.1.

In this section, the sample notebook demonstrates modifying a dataset that is unique in one dimension (“invoiceno”) to be unique by the desired dimension for analysis (“customerid”).

The “drop table” cell simply clears the table from memory in case the user has already run the following cell with the “SUM(quantity)” expression.

![ImgSection21](./section2-1.svg)

Before the cell with “CREATE OTF TABLE” let’s add a code cell to look at the data before it is transformed.

The option to create a new cell appears above an existing cell when you select it. Select the cell with the “CREATE OTF TABLE” expression and select “+Code.”

![ImgDragData](./drag-data.svg)

Once the cell is created, select the “uk_retail_data” table from the Lakehouse explorer and drag it into the cell. This action always drops a “SELECT TOP 10” from the selected table expression into the cell and makes it easy to move from browsing tables to quickly adding the desired table name to a cell.

Run the cell and you will see that the top ten have “invoices” as a dimension with unique values. But, we want to analyze by “customerid.”

Running a cell will automatically connect the notebook to a “standard session.”

:::note
“High-concurrency” sessions are not available in preview.
:::

## Write to OneLake

In the next cell with “SUM(quantity)” you can see an expression to modify the table to aggregate invoice data by customerid. As it is written it will create this table in memory. This new table will be lost when you close the notebook or become inactive.

![ImgCellSUM](./cell-sum.svg)

To write the created table to OneLake, we will append the target lakehouse name to the front of the table.

Add the destination lakehouse followed by a period, “AIUnlimited_Demo.”, to the front of “Customer_ID_Group,” the table being created. The “CREATE OTF TABLE” expression is used by AI Unlimited to write a Delta lake or Iceberg table and is necessary when writing to OneLake.

![ImgNewTable](./new-table.svg)

You should see your new table appear in the explorer.

![ImgDisconnect](./disconnect.svg)

To limit your consumption of compute while staying in the notebook, you can disconnect from the engine by selecting the stop icon to disconnect the session. This will destroy the engine along with any data created during the session unless it was explicitly written to OneLake. The table Customer_ID_Group will still be in our lakehouse.

## Save your work

![ImgSaveWork](./save-work.svg)

Now let’s save the notebook. Any changes we made in code or markdown will persist when we reopen the notebook.

![ImgCloseNotebook](./close-nb.svg)

We can close the notebook by simply clicking the “x” button in the tab on the sidebar. This automatically disconnects the session and releases the engine and destroys any data that was not written to OneLake.

## Pick up where we left off

Find and reopen the “data_prep” table in your workspace. Connect to the AIUnlimited_Demos lakehouse in the Lakehouse explorer.

Go back to section 2.1. See the Top 10 results for uk_retail_data.

Beneath the cell with “CREATE OTF TABLE” that we edited to write to OneLake, create another code cell.

![ImgNewCell](./new-cell.svg)

Drag our new table, “Customer_ID_Group,” into the cell and run it.

See that the new table with aggregated values has “customerid” as a unique value. We are now ready to create fit tables for our analysis.


1 change: 1 addition & 0 deletions docs/fabric/get-started/browse-lakehouse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions docs/fabric/get-started/connect-lakehouse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
id: connect-explore
title: Connect to a sample lakehouse
description: Connect your AI Unlimited notebook to the demo lakehouse and explore.
sidebar_label: Connect to the lakehouse
sidebar_position: 3
pagination_prev: null
pagination_next: null
displayed_sidebar: fabricSidebar
---

# Connect to the sample lakehouse

To the left of the notebook is the Lakehouse explorer. This feature connects directly to OneLake to make it easy to browse data, and acts independently of the notebook itself. Connecting to a lakehouse allows you to view the tables and their columns as well as any other files or resources in the sidebar. Within the notebook itself, you can write and read from any data source you have access to at any time.

Let’s connect to the AIUnlimited_Demo lakehouse that was just created.

![ImgConnectLakehouse](./connect-lakehouse.svg)

Select “+Lakehouse.”

Select the AIUnlimited_Demo lakehouse and then “Connect” in the lower right.

![ImgBrowseLakehouse](./browse-lakehouse.svg)

You can now browse the contents of the lakehouse. Expand any table to reveal its columns.
1 change: 1 addition & 0 deletions docs/fabric/get-started/connect-lakehouse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/fabric/get-started/create-lakehouse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions docs/fabric/get-started/create-notebook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
id: create-notebook
title: Create your notebook
description: From your workspace, create and prepare an AI Unlimited notebook.
sidebar_label: Create a lakehouse and notebook
sidebar_position: 1
pagination_prev: null
pagination_next: null
displayed_sidebar: fabricSidebar
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';


# Create a lakehouse and notebook

First you'll create a lakehouse. Then you'll create a notebook and populate it with the data preparation use case.

## Create a lakehouse to use with sample notebooks

![ImgCreateLakehouse](./create-lakehouse.svg)

The simplest way to use sample data is to create a new lakehouse item in your workspace named “AIUnlimited_Demo.” This way, when you're done with the sample, you can simply delete the lakehouse. To create a new lakehouse, in your workspace select “+ New item,” scroll down to “Store data,” and select the lakehouse item. Name the lakehouse “AIUnlimited_Demo” so that it works with the sample notebook's configuration.

:::note
Later in these instructions we'll say how to use an existing lakehouse, if that's what you prefer to do.
:::


## Create an AI Unlimited notebook from your workspace

![ImgCreateNotebook](./create-notebook.svg)

Once the AI Unlimited Workload has been added to the capacity for your workspace, you can create an AI Unlimited notebook.
1. Within the workspace, select “+ New item.”
2. Scroll down to “Prepare data” or “Analyze and train data” to find and create the notebook.

You will be prompted to name the notebook. For consistency with these directions, name the notebook “data_prep.”


## Create the sample notebook

![ImgCreateSample](./create-sample.svg)

After naming your notebook, select the “Sample data preparation” tile to pre-populate the notebook with a data preparation use case that demonstrates AI Unlimited in-database functions against sample data to evaluate large data sets, create fit tables, and normalize data.
1 change: 1 addition & 0 deletions docs/fabric/get-started/create-notebook.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/fabric/get-started/create-sample.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/fabric/get-started/data-preparation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions docs/fabric/get-started/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
id: get-started-fabric
title: Get started using AI Unlimited in Fabric
description: Get started with the AI Unlimited Fabric Workload preview.
sidebar_label: Get started
sidebar_position: 1
pagination_prev: null
pagination_next: null
displayed_sidebar: fabricSidebar
---

# Get started with the AI Unlimited Fabric Workload preview

AI Unlimited, the Teradata on-demand, advanced analytic compute engine, is now available in preview through Microsoft Fabric. This integration brings powerful Teradata analytic compute capabilities together with Microsoft Fabric comprehensive data management and lifecycle applications. It is now easier than ever for developers (data scientists, data engineers, and ML engineers) to rapidly experiment, prototype, iterate, and operationalize at scale.

![ImgWorkloadHub](./workload-hub.svg)

If AI Unlimited has not yet been added to your workspace, find it by going to the Workload Hub and selecting “More Workloads” in the upper left. After selecting AI Unlimited, you can add it to the capacities associated with the workspaces you want to use it in. You will need to ask your Azure admin to provide consent to add AI Unlimited to your Azure tenant before using.

:::note
During the preview period, AI Unlimited servers are in the US only. AI Unlimited will not store data but your data will be sent to the US East region for processing. If you are outside of the US, please consult your company’s data policy before using the AI Unlimited Workload.
:::

Once AI Unlimited it has been added, you can find it in the Workload Hub under “My Workloads.” You can go there to view the content and documents, and to manage capacities.


25 changes: 25 additions & 0 deletions docs/fabric/get-started/load-data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
id: load-data
title: Load sample data
description: Load sample data to your workspace.
sidebar_label: Load sample data
sidebar_position: 2
pagination_prev: null
pagination_next: null
displayed_sidebar: fabricSidebar
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

![ImgSampleData](./sample-data.svg)

Before using the sample notebook, you'll need to load the sample data to your workspace. You do this by selecting “Sample data” from the toolbar along the top of the notebook.

![ImgDataPreparationRev](./data-preparation.svg)

Select the “Data preparation” dataset. This is tied to the data preparation sample notebook. Then select the “AIUnlimited_Demo” lakehouse you created in the earlier step. If you chose not to create a new lakehouse, select the name of the lakehouse you want to use.

![ImgTopCell](./top-cell.svg)

If you are using a pre-existing lakehouse, look at the cell at the very top of the notebook. Change “AIUnlimited_Demo” to the name of your chosen lakehouse to allow you to easily run all the cells in the notebook.
1 change: 1 addition & 0 deletions docs/fabric/get-started/sample-data.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/fabric/get-started/top-cell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/fabric/get-started/workload-hub.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 040652c

Please sign in to comment.