> ## Documentation Index
> Fetch the complete documentation index at: https://arize-ax.mintlify.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart: ML

> Learn how to get started using Arize!

### Step 1: Install Arize

<CodeGroup>
  ```bash Python SDK v8 theme={null}
  pip install --pre arize
  ```

  ```bash Python SDK v7 theme={null}
  %pip install -q "arize<8.0.0"
  ```
</CodeGroup>

Install `arize`, import dependencies, and attach your Arize API Key and Space ID:

<CodeGroup>
  ```python Python SDK v8 theme={null}
  from arize import ArizeClient
  from arize.ml.types import ModelTypes, Environments, Schema

  client = ArizeClient(api_key="your-arize-api-key")
  ```

  ```python Python SDK v7 theme={null}
  from arize.pandas.logger import Client, Schema
  from arize.utils.types import ModelTypes, Environments, Metrics

  arize_client = Client(space_id="your-arize-space-id", api_key="your-arize-api-key")
  ```
</CodeGroup>

### Step 2: Download Dataset

To easily get started, we'll prepare a simple Classification Model dataset from [SciKit learn](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.load_breast_cancer.html#sklearn.datasets.load_breast_cancer) to send via the [Python SDK](/ax/machine-learning/machine-learning/how-to-ml/upload-data-to-arize/log-directly-via-sdk-api). For this example, download the `load_breast_cancer` dataset, assign the dataset to a variable, and preview the data to better understand what we're working with.

```python theme={null}
from sklearn.datasets import load_breast_cancer
breast_cancer_dataset = load_breast_cancer()
```

### Step 3: Extract Features, Predictions, and Actuals

The dataset contains all the information we need to create a Pandas dataframe. For any dataset, extract the **features**, **predictions**, and **actuals** data. For this example:

```python theme={null}
breast_cancer_features = breast_cancer_dataset['data'] # feature data
breast_cancer_feature_names = breast_cancer_dataset['feature_names'] # feature names
breast_cancer_targets = breast_cancer_dataset['target'] # actual data
breast_cancer_target_names = breast_cancer_dataset['target_names'] # actual labels
```

Assign `breast_cancer_taget_names` to their corresponding `breast_cancer_targets` to use as a human-comprehensible list of actual labels.

```python theme={null}
target_name_transcription = [] # this will become our list of actuals

for i in breast_cancer_targets: 
  target_name_transcription.append(breast_cancer_target_names[i])
```

Create a Pandas dataframe to use the Arize Python Pandas logger with our predefined features and actuals(`target_name_transcription`).

**Note:** We've duplicated the `actual_label` column to create a `prediction_label` column for simplicities sake. Data will not populate in the Arize platform without a record of prediction data.

```python theme={null}
import pandas as pd

df = pd.DataFrame(breast_cancer_features, columns=breast_cancer_feature_names)
df['actual_label'] = target_name_transcription
df['prediction_label'] = target_name_transcription

# this is optional, but makes this example more interesting in the platform
df['prediction_label'] = df['prediction_label'].iloc[::-1].reset_index(drop=True) 
```

### Step 4: Log Data to Arize

Define the [Schema](https://arize.com/docs/ax/api-reference/arize.pandas/schema) so Arize knows what your columns correspond to. [Log](https://arize.com/docs/ax/api-reference/arize.pandas/log) the model data.

<CodeGroup>
  ```python Python SDK v8 theme={null}
  schema = Schema(
      actual_label_column_name="actual_label",
      prediction_label_column_name="prediction_label",
      feature_column_names=[
         'mean radius', 'mean texture', 'mean perimeter', 'mean area',
         'mean smoothness', 'mean compactness', 'mean concavity',
         'mean concave points', 'mean symmetry', 'mean fractal dimension',
         'radius error', 'texture error', 'perimeter error', 'area error',
         'smoothness error', 'compactness error', 'concavity error',
         'concave points error', 'symmetry error',
         'fractal dimension error', 'worst radius', 'worst texture',
         'worst perimeter', 'worst area', 'worst smoothness',
         'worst compactness', 'worst concavity', 'worst concave points',
         'worst symmetry', 'worst fractal dimension'
      ]
  )

  response = client.ml.log(
      space_id="your-arize-space-id",
      model_name='breast_cancer_dataset',
      model_type=ModelTypes.BINARY_CLASSIFICATION,
      environment=Environments.PRODUCTION,
      dataframe=df,
      schema=schema,
      model_version='v1'
  )
  ```

  ```python Python SDK v7 theme={null}
  schema = Schema(
      actual_label_column_name="actual_label",
      prediction_label_column_name="prediction_label",
      feature_column_names=[
         'mean radius', 'mean texture', 'mean perimeter', 'mean area',
         'mean smoothness', 'mean compactness', 'mean concavity',
         'mean concave points', 'mean symmetry', 'mean fractal dimension',
         'radius error', 'texture error', 'perimeter error', 'area error',
         'smoothness error', 'compactness error', 'concavity error',
         'concave points error', 'symmetry error',
         'fractal dimension error', 'worst radius', 'worst texture',
         'worst perimeter', 'worst area', 'worst smoothness',
         'worst compactness', 'worst concavity', 'worst concave points',
         'worst symmetry', 'worst fractal dimension'
      ]
  )

  response = arize_client.log(
      dataframe=df,
      schema=schema,
      model_id='breast_cancer_dataset',
      model_version='v1',
      model_type=ModelTypes.BINARY_CLASSIFICATION,
      metrics_validation=[Metrics.CLASSIFICATION],
      environment=Environments.PRODUCTION
  )
  ```
</CodeGroup>

### Step 5: Visualize Model Performance

Now that you've uploaded some data to Arize, check it out on the platform. Navigate to the '[**Performance Tracing**](/ax/machine-learning/machine-learning/how-to-ml/performance-tracing)' tab within your model. Here, you'll see an interactive performance-over-time chart and a performance breakdown visualization.

<Frame caption="Performance Breakdown & Performance Insights">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/24f6f0b6-image.jpeg" />
</Frame>

### Step 6: Setup One-Click Monitoring

Create monitors to keep an eye on key performance, drift, and data quality metrics. Navigate to the 'Monitors' tab and enable relevant prebuilt monitors for your use case.

<Frame caption="Prebuilt monitors in the Monitor's Setup tab">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/346f2ef9-image.jpeg" />
</Frame>

### Step 7: Relax (With Alerting Notifications On)!

Configure [alerts](/ax/machine-learning/machine-learning/how-to-ml/monitors/configure-monitors/notifications-and-integrations) on the 'Config' page within the monitor's tab to keep you posted when your model changes unexpectedly.

<Frame caption="Use our various alerting integrations or alert via email">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/b4021cd3-image.jpeg" />
</Frame>

### Extra Credit: Create A Dashboard

We get it - ML observability is a lot of fun! Keep an eye on key model health metrics with dashboards for a single pane of glass view of your model. Create a custom dashboard, use a pre-built template, and simply copy and paste the dashboard URL to share with your team!

<Frame caption="Example dashbaord with key performance metrics">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/41482c24-image.jpeg" />
</Frame>

### Up Next: Connect to Production Data Pipeline

Connect your Cloud Storage Blob or Data Warehouse to **automatically sync** model data with Arize!

<CardGroup>
  <Card title="Google Cloud Storage" href="/ax/machine-learning/machine-learning/integrations-ml/gcs-example" />

  <Card title="AWS S3" href="/ax/machine-learning/machine-learning/integrations-ml/aws-s3-example" />

  <Card title="Azure Blob Storage" href="/ax/machine-learning/machine-learning/integrations-ml/azure-example" />

  <Card title="Google BigQuery" href="/ax/machine-learning/machine-learning/integrations-ml/google-bigquery" />
</CardGroup>
