|
| 1 | +# Feast End Users Quickstart Guide |
| 2 | + |
| 3 | +## Pre-requisities |
| 4 | + |
| 5 | +* A working Feast Core: Consult your Feast admin or [install your own](install.md). |
| 6 | +* Feast CLI tools: Use [pre-built |
| 7 | + binaries](https://github.com/gojek/feast/releases) or [compile your |
| 8 | + own](../cli/README.md). |
| 9 | + |
| 10 | +Make sure your CLI is correctly configured for your Feast Core. If |
| 11 | +you're running a local Feast Core, it would be: |
| 12 | +```sh |
| 13 | +feast config set coreURI localhost |
| 14 | +``` |
| 15 | + |
| 16 | +## Introduction |
| 17 | + |
| 18 | +There are several stages to using Feast: |
| 19 | +1. Register your feature |
| 20 | +2. Ingest data for your feature |
| 21 | +3. Query feature data for training your models |
| 22 | +4. Query feature data for serving your models |
| 23 | + |
| 24 | +## Registering your feature |
| 25 | + |
| 26 | +In order to register a feature, you will first need to register a: |
| 27 | +* Storage location (typically done by your Feast admin) |
| 28 | +* Entity |
| 29 | + |
| 30 | +All registrations are done using [specs](specs.md). |
| 31 | + |
| 32 | +### Registering an entity |
| 33 | + |
| 34 | +Then register an entity, which is for grouping features under a unique |
| 35 | +key or id. Typically these map to a domain object, e.g., a customer, a |
| 36 | +merchant, a sales region. |
| 37 | + |
| 38 | +[`wordEntity.yml`](../examples/wordEntity.yml) |
| 39 | +``` |
| 40 | +name: word |
| 41 | +description: word found in shakespearean works |
| 42 | +``` |
| 43 | + |
| 44 | +Register the entity spec: |
| 45 | +```sh |
| 46 | +feast apply entity wordEntity.yml |
| 47 | +``` |
| 48 | + |
| 49 | +### Registering your feature |
| 50 | + |
| 51 | +Next, define your feature: |
| 52 | + |
| 53 | +[`wordCountFeature.yml`](../examples/wordCountFeature.yml) |
| 54 | +``` |
| 55 | +id: word.count |
| 56 | +name: count |
| 57 | +entity: word |
| 58 | + |
| 59 | +description: number of times the word appears |
| 60 | +valueType: INT64 |
| 61 | +uri: https://github.com/bob/example |
| 62 | +``` |
| 63 | + |
| 64 | +Register it: |
| 65 | +```sh |
| 66 | +feast apply feature wordCountFeature.yml |
| 67 | +``` |
| 68 | + |
| 69 | +## Ingest data for your feature |
| 70 | + |
| 71 | +Feast supports ingesting feature from 4 type of sources: |
| 72 | + |
| 73 | +* File (either CSV or JSON) |
| 74 | +* Bigquery Table |
| 75 | +* Pubsub Topic |
| 76 | +* Pubsub Subscription |
| 77 | + |
| 78 | +Let's take a look on how to create an import job spec and ingest some data from a CSV file. |
| 79 | +You may find more information on how to ingest data from different sources |
| 80 | +here: [[Import Specs]](specs.md#import-spec) |
| 81 | + |
| 82 | +### Prepare your data |
| 83 | +`word_counts.csv` |
| 84 | +```csv |
| 85 | +count,word |
| 86 | +28944,the |
| 87 | +27317,and |
| 88 | +21120,i |
| 89 | +20136,to |
| 90 | +17181,of |
| 91 | +14945,a |
| 92 | +13989,you |
| 93 | +12949,my |
| 94 | +11513,in |
| 95 | +11488,that |
| 96 | +9545,is |
| 97 | +8855,not |
| 98 | +8293,with |
| 99 | +8043,me |
| 100 | +8003,it |
| 101 | +... |
| 102 | +``` |
| 103 | + |
| 104 | +And then upload it into your Google Storage bucket: |
| 105 | + |
| 106 | +```sh |
| 107 | +gsutil cp word_counts.csv gs://your-bucket |
| 108 | +``` |
| 109 | + |
| 110 | +### Define the job import spec |
| 111 | +`shakespeareWordCountsImport.yml` |
| 112 | +```yaml |
| 113 | +type: file.csv |
| 114 | +sourceOptions: |
| 115 | + path: gs://your-bucket/word_counts.csv |
| 116 | +entities: |
| 117 | + - word |
| 118 | +schema: |
| 119 | + entityIdColumn: word |
| 120 | + timestampValue: 2019-01-01T00:00:00.000Z |
| 121 | + fields: |
| 122 | + - name: count |
| 123 | + featureId: word.count |
| 124 | + - name: word |
| 125 | +``` |
| 126 | +
|
| 127 | +### Start the ingestion job |
| 128 | +Next, use `feast` CLI to run your ingestion job, defined in |
| 129 | +`shakespeareWordCountsImport.yml`: |
| 130 | +```sh |
| 131 | +feast jobs run shakespeareWordCountsImport.yml |
| 132 | +``` |
| 133 | + |
| 134 | +You can also list recent ingestion jobs by running: |
| 135 | +```sh |
| 136 | +feast list jobs |
| 137 | +``` |
| 138 | + |
| 139 | +Or get detailed information about the results of ingestion with: |
| 140 | +```sh |
| 141 | +feast get job <id> |
| 142 | +``` |
| 143 | + |
0 commit comments