Skip to main content

Added v1.0

A connector that can read and write training data to and from wrangles. Useful for updating wrangles training data without having to open Excel.

Tabset

Classify​

Read​

Recipe​

read:
- train.classify:
model_id: xxxxxxxx-xxxx-xxxx
Output​
ExampleCategoryNotes
AppleFruit
BroccoliVegetable
PearFruit
AperagusVegetable
Parameters​
ParameterRequiredData TypeNotes
model_id✓strModel id of wrangle to be read from
ifstrA condition that will determine whether the action runs or not as a whole.

Function​

from wrangles.connectors import train
df = train.classify.read(model_id = 'xxxxxxxx-xxxx-xxxx')
Output​
ExampleCategoryNotes
AppleFruit
BroccoliVegetable
PearFruit
AsperagusVegetable
Parameters​
ParameterRequiredData TypeNotes
model_id✓strModel id of wrangle to be read from
ifstrA condition that will determine whether the action runs or not as a whole.

Write​

Recipe​

Update the training data for an existing classify wrangle.

write:
- train.classify:
columns:
- Example
- Category
- Notes
model_id: xxxxxxxx-xxxx-xxxx
Parameters​
ParameterRequiredData TypeNotes
columnslistList of columns to use for update/wrangle creation, defaults to none
model_idstrModel id of wrangle to update. Only use for existing wrangles, defaults to none
namestrName of wrangle that is being created, defaults to none
ifstrA condition that will determine whether the action runs or not as a whole.

Function​

Create a new classify wrangle.

from wrangles.connectors import train
import pandas as pd

df = pd.DataFrame({
'Example': ['Apple', 'Broccoli', 'Pear', 'Asperagus'],
'Category': ['Fruit', 'Vegitable', 'Fruit', 'Vegitable'],
'Notes': ['', '', '', '']
})

train.classify.write(df = df, name = 'Fruits and Veggies')
Parameters​
ParameterRequiredData TypeNotes
df✓Pandas DataFrameDataframe consisting of training data to be used
columnslistList of columns to use for update/wrangle creation, defaults to none
model_idstrModel id of wrangle to update. Only use for existing wrangles, defaults to none
namestrName of wrangle that is being created, defaults to none
ifstrA condition that will determine whether the action runs or not as a whole.

Note both name and model_id cannot be used together. Name is used when creating models and model_id is used when updating an existing model.

Extract​

Read​

Recipe​

read:
- train.extract:
model_id: xxxxxxxx-xxxx-xxxx
Output​
Entity to FindVariation (Optional)Notes
Ball Bearingbearing, ball
Needle Bearingneedle, bearing
Roller Bearingroller, bearing

Function​

from wrangles.connectors import train
df = train.extract.read(model_id = 'xxxxxxxx-xxxx-xxxx')
Output​
Entity to FindVariation (Optional)Notes
Ball Bearingbearing, ball
Needle Bearingneedle, bearing
Roller Bearingroller, bearing

Write​

Recipe​

Update the training data for an existing extract wrangle.

write:
- train.extract:
columns:
- Entity to Find
- Variation (Optional)
- Notes
model_id: xxxxxxxx-xxxx-xxxx
Parameters​
ParameterRequiredData TypeNotes
columnslistList of columns to use for update/wrangle creation, defaults to none
model_idstrModel id of wrangle to update. Only use for existing wrangles, defaults to none
namestrName of wrangle that is being created, defaults to none
ifstrA condition that will determine whether the action runs or not as a whole.

Function​

Create a new classify wrangle.

from wrangles.connectors import train
import pandas as pd

df = pd.DataFrame({
'Entity to Find': ['Ball Bearing', 'Needle Bearing', 'Roller Bearing'],
'Variation': ['bearing, ball', 'needle, bearing', 'roller, bearing'],
'Notes': ['', '', '', '']
})

train.extract.write(df = df, name = 'Bearing Types')
Parameters​
ParameterRequiredData TypeNotes
df✓Pandas DataFrameDataframe consisting of training data to be used
columnslistList of columns to use for update/wrangle creation, defaults to none
model_idstrModel id of wrangle to update. Only use for existing wrangles, defaults to none
namestrName of wrangle that is being created, defaults to none
ifstrA condition that will determine whether the action runs or not as a whole.

Note both name and model_id cannot be used together. Name is used when creating models and model_id is used when updating an existing model.

Lookup​

Read​

Recipe​

read:
- train.lookup:
model_id: xxxxxxxx-xxxx-xxxx
Output​
KeyValue1Value2
PizzaThin CrustDeep Dish
HamburgerSingleDouble
SaladGardenCeasar
TacoSoftCrispy

Function​

from wrangles.connectors import train
df = train.lookup.read(model_id = 'xxxxxxxx-xxxx-xxxx')
Output​
KeyValue1Value2
PizzaThin CrustDeep Dish
HamburgerSingleDouble
SaladGardenCeasar
TacoSoftCrispy

Write​

Recipe​

Update the training data for an existing lookup wrangle.

write:
- train.lookup:
model_id: xxxxxxxx-xxxx-xxxx
Parameters​
ParameterRequiredData TypeNotes
settingsdictSpecific settings to apply to the wrangle. Settings include variant which can be key or semantic. Settings must be used when creating a new lookup.
model_idstrModel id of wrangle to update. Only use for existing wrangles, defaults to none
namestrName of wrangle that is being created, defaults to none
columnsstr, listThe columns you wish to write to the Wrangle. Note: Columns must include one column named Key which will be used for the value to be looked up.
ifstrA condition that will determine whether the action runs or not as a whole.

Function​

Create a new lookup wrangle.

from wrangles.connectors import train
import pandas as pd

df = pd.DataFrame({
'Key': ['Pizza', 'Hamburger', 'Salad', 'Taco'],
'Value1': ['Thin Crust', 'Single', 'Garden', 'Soft'],
'Value2': ['Deep Dish', 'Double', 'Ceasar', 'Crispy']
})

train.lookup.write(df = df, name = 'Menu Updates', settings = {'variant': 'key'})
Parameters​
ParameterRequiredData TypeNotes
df✓Pandas DataFrameDataframe consisting of training data to be used
settingsdictSpecific settings to apply to the wrangle. Settings include variant which can be key or semantic. Settings must be used when creating a new lookup.
model_idstrModel id of wrangle to update. Only use for existing wrangles, defaults to none
namestrName of wrangle that is being created, defaults to none
ifstrA condition that will determine whether the action runs or not as a whole.

Note both name and model_id cannot be used together. Name is used when creating models and model_id is used when updating an existing model.

Standardize​

Read​

Recipe​

read:
- train.standardize:
model_id: xxxxxxxx-xxxx-xxxx
Output​
FindReplaceNotes
PizzaHamburger
BeefChicken
BagelDonut
TacoBurrito

Function​

from wrangles.connectors import train
df = train.standardize.read(model_id = 'xxxxxxxx-xxxx-xxxx')
Output​
FindReplaceNotes
PizzaHamburger
BeefChicken
BagelDonut
TacoBurrito

Write​

Recipe​

Update the training data for an existing standardize wrangle.

write:
- train.standardize:
columns:
- Find
- Replace
- Notes
model_id: xxxxxxxx-xxxx-xxxx
Parameters​
ParameterRequiredData TypeNotes
columnslistList of columns to use for update/wrangle creation, defaults to none
model_idstrModel id of wrangle to update. Only use for existing wrangles, defaults to none
namestrName of wrangle that is being created, defaults to none
ifstrA condition that will determine whether the action runs or not as a whole.

Function​

Create a new standardize wrangle.

from wrangles.connectors import train
import pandas as pd

df = pd.DataFrame({
'Find': ['Pizza', 'Beef', 'Bagel', 'Taco'],
'Replace': ['Hamburger', 'Chicken', 'Donut', 'Burrito'],
'Notes': ['', '', '', '']
})

train.standardize.write(df = df, name = 'Menu Updates')
Parameters​
ParameterRequiredData TypeNotes
df✓Pandas DataFrameDataframe consisting of training data to be used
columnslistList of columns to use for update/wrangle creation, defaults to none
model_idstrModel id of wrangle to update. Only use for existing wrangles, defaults to none
namestrName of wrangle that is being created, defaults to none
ifstrA condition that will determine whether the action runs or not as a whole.

Note both name and model_id cannot be used together. Name is used when creating models and model_id is used when updating an existing model.