Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.

Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler

In this post, we introduce a new analysis in the Poročilo o kakovosti podatkov in vpogledih of Amazon SageMaker Data Wrangler. This analysis assists you in validating textual features for correctness and uncovering invalid rows for repair or omission.

Data Wrangler reduces the time it takes to aggregate and prepare data for machine learning (ML) from weeks to minutes. You can simplify the process of data preparation and feature engineering, and complete each step of the data preparation workflow, including data selection, cleansing, exploration, and visualization, from a single visual interface.

Pregled rešitev

Data preprocessing often involves cleaning textual data such as email addresses, phone numbers, and product names. This data can have underlying integrity constraints that may be described by regular expressions. For example, to be considered valid, a local phone number may need to follow a pattern like [1-9][0-9]{2}-[0-9]{4}, which would match a non-zero digit, followed by two more digits, followed by a dash, followed by four more digits.

Common scenarios resulting in invalid data may include inconsistent human entry, for example phone numbers in various formats (5551234 vs. 555 1234 vs. 555-1234) or unexpected data, such as 0, 911, or 411. For a customer call center, it’s important to omit numbers such as 0, 911, or 411, and validate (and potentially correct) entries such as 5551234 or 555 1234.

Unfortunately, although textual constraints exist, they may not be provided with the data. Therefore, a data scientist preparing a dataset must manually uncover the constraints by looking at the data. This can be tedious, error prone, and time consuming.

Pattern learning automatically analyzes your data and surfaces textual constraints that may apply to your dataset. For the example with phone numbers, pattern learning can analyze the data and identify that the vast majority of phone numbers follow the textual constraint [1-9][0-9]{2}-[0-9][4]. It can also alert you that there are examples of invalid data so that you can exclude or correct them.

In the following sections, we demonstrate how to use pattern learning in Data Wrangler using a fictional dataset of product categories and SKU (stock keeping unit) codes.

This dataset contains features that describe products by company, brand, and energy consumption. Notably, it includes a feature SKU that is ill-formatted. All the data in this dataset is fictional and created randomly using random brand names and appliance names.

Predpogoji

Before you get started using Data Wrangler, prenesi the sample dataset and upload it to a location in Preprosta storitev shranjevanja Amazon (Amazon S3). For instructions, refer to Nalaganje predmetov.

Uvozite svoj nabor podatkov

To import your dataset, complete the following steps:

  1. In Data Wrangler, choose Import & Explore Data for ML.
  2. Izberite uvoz.
    Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.
  3. za Uvozi podatke, izberite Amazon S3.
    Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.
  4. Locate the file in Amazon S3 and choose uvoz.
    Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.

After importing, we can navigate to the data flow.

Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.

Pridobite vpogled v podatke

In this step, we create a data insights report that includes information about data quality. For more information, refer to Pridobite vpogled v podatke in kakovost podatkov. Izvedite naslednje korake:

  1. o Pretok podatkov tab, choose the plus sign next to Vrste podatkov.
  2. Izberite Pridobite vpogled v podatke.
    Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.
  3. za Vrsta analize, izberite Poročilo o kakovosti podatkov in vpogledih.
  4. For this post, leave Ciljni stolpec in Vrsta težave blank.If you plan to use your dataset for a regression or classification task with a target feature, you can select those options and the report will include analysis on how your input features relate to your target. For example, it can produce reports on target leakage. For more information, refer to Ciljni stolpec.
  5. Izberite ustvarjanje.
    Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.

We now have a Data Quality and Data Insights Report. If we scroll down to the SKU section, we can see an example of pattern learning describing the SKU. This feature appears to have some invalid data, and actionable remediation is required.

Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.

Before we clean the SKU feature, let’s scroll up to the Izberite model avtomobila section to see some more insights. Here we see two patterns have been uncovered, indicating that that majority of brand names are single words consisting of word characters or alphabetic characters. A word character is either an underscore or a character that may appear in a word in any language. For example, the strings Hello_world in écoute both consist of word characters: H in é.

For this post, we don’t clean this feature.

Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.

View pattern learning insights

Let’s return to cleaning SKUs and zoom in on the pattern and the warning message.

As shown in the following screenshot, pattern learning surfaces a high-accuracy pattern matching 97.78% of the data. It also displays some examples matching the pattern as well as examples that don’t match the pattern. In the non-matches, we see some invalid SKUs.

Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.

In addition to the surfaced patterns, a warning may appear indicating a potential action to clean up data if there is a high accuracy pattern as well as some data that doesn’t conform to the pattern.

Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.

We can omit the invalid data. If we choose (right-click) on the regular expression, we can copy the expression [A-Z]{3}-[0-9]{4,5}.

Remove invalid data

Let’s create a transform to omit non-conforming data that doesn’t match this pattern.

  1. o Pretok podatkov tab, choose the plus sign next to Vrste podatkov.
  2. Izberite Dodaj preoblikovanje.
    Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.
  3. Izberite Dodaj korak.
  4. Išči regex In izberite Iskanje in urejanje.
    Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.
  5. za Transform, izberite Convert non-matches to missing.
  6. za Vnosni stolpci, izberite SKU.
  7. za Vzorec, enter our regular expression.
  8. Izberite predogled, nato izberite Dodaj.
    Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.
    Now the extraneous data has been removed from the features.
  9. To remove the rows, add the step Ročaj manjka in izberite transformacijo Manjka kapljica.
  10. Izberite SKU kot vnosni stolpec.
    Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.

We return to our data flow with the erroneous data removed.

Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.

zaključek

In this post, we showed you how to use the pattern learning feature in data insights to find invalid textual data in your dataset, as well as how to correct or omit that data.

Now that you’ve cleaned up a textual column, you can visualize your dataset using an Analiza or you can apply vgrajene transformacije to further process your data. When you’re satisfied with your data, you can usposobiti modela z Amazonski SageMaker avtopilotali izvozite svoje podatke to a data source such as Amazon S3.

We would like to thank Nikita Ivkin for his thoughtful review.


O avtorjih

Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.Vishaal Kapoor je višji aplikativni znanstvenik pri AWS AI. Strastno želi pomagati strankam razumeti njihove podatke v Data Wranglerju. V prostem času kolesari z gorskimi kolesi, deska na snegu in se druži z družino.

Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.Zohar Karnin is a Principal Scientist in Amazon AI. His research interests are in the areas of large scale and online machine learning algorithms. He develops infinitely scalable machine learning algorithms for Amazon SageMaker.

Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai.Ajai Sharma je glavni produktni vodja za Amazon SageMaker, kjer se osredotoča na Data Wrangler, vizualno orodje za pripravo podatkov za podatkovne znanstvenike. Pred AWS je bil Ajai strokovnjak za podatkovno znanost pri McKinsey and Company, kjer je vodil posle, osredotočene na strojno upravljanje, za vodilna finančna in zavarovalniška podjetja po vsem svetu. Ajai je navdušen nad podatkovno znanostjo in rad raziskuje najnovejše algoritme in tehnike strojnega učenja.

Zaznajte vzorce v besedilnih podatkih z Amazon SageMaker Data Wrangler PlatoBlockchain Data Intelligence. Navpično iskanje. Ai. Derek Baron is a software development manager for Amazon SageMaker Data Wrangler

Časovni žig:

Več od Strojno učenje AWS