forked from feast-dev/feast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
744 lines (587 loc) · 43 KB
/
index.html
File metadata and controls
744 lines (587 loc) · 43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Feast Python API Documentation — Feast 0.3.2 documentation</title>
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="#" class="icon icon-home"> Feast
</a>
<div class="version">
0.3.2
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">Feast Python API Documentation</a></li>
<li><a class="reference internal" href="#module-feast.client">Client</a></li>
<li><a class="reference internal" href="#module-feast.feature_set">Feature Set</a></li>
<li><a class="reference internal" href="#module-feast.feature">Feature</a></li>
<li><a class="reference internal" href="#module-feast.entity">Entity</a></li>
<li><a class="reference internal" href="#module-feast.value_type">Value</a></li>
<li><a class="reference internal" href="#module-feast.source">Source</a></li>
<li><a class="reference internal" href="#module-feast.job">Job</a></li>
</ul>
</div>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="#">Feast</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="#">Docs</a> »</li>
<li>Feast Python API Documentation</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/index.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="feast-python-api-documentation">
<h1>Feast Python API Documentation<a class="headerlink" href="#feast-python-api-documentation" title="Permalink to this headline">¶</a></h1>
</div>
<div class="section" id="module-feast.client">
<span id="client"></span><h1>Client<a class="headerlink" href="#module-feast.client" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="feast.client.Client">
<em class="property">class </em><code class="sig-prename descclassname">feast.client.</code><code class="sig-name descname">Client</code><span class="sig-paren">(</span><em class="sig-param">core_url: str = None</em>, <em class="sig-param">serving_url: str = None</em>, <em class="sig-param">verbose: bool = False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/client.html#Client"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.client.Client" title="Permalink to this definition">¶</a></dt>
<dd><p>Feast Client: Used for creating, managing, and retrieving features.</p>
<dl class="method">
<dt id="feast.client.Client.apply">
<code class="sig-name descname">apply</code><span class="sig-paren">(</span><em class="sig-param">feature_sets: Union[List[feast.feature_set.FeatureSet], feast.feature_set.FeatureSet]</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/client.html#Client.apply"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.client.Client.apply" title="Permalink to this definition">¶</a></dt>
<dd><p>Idempotently registers feature set(s) with Feast Core. Either a single
feature set or a list can be provided.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>feature_sets</strong> – List of feature sets that will be registered</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="feast.client.Client.core_url">
<em class="property">property </em><code class="sig-name descname">core_url</code><a class="headerlink" href="#feast.client.Client.core_url" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve Feast Core URL</p>
</dd></dl>
<dl class="method">
<dt id="feast.client.Client.get_batch_features">
<code class="sig-name descname">get_batch_features</code><span class="sig-paren">(</span><em class="sig-param">feature_ids: List[str], entity_rows: pandas.core.frame.DataFrame</em><span class="sig-paren">)</span> → feast.job.Job<a class="reference internal" href="_modules/feast/client.html#Client.get_batch_features"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.client.Client.get_batch_features" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieves historical features from a Feast Serving deployment.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>feature_ids</strong> – List of feature ids that will be returned for each
entity. Each feature id should have the following format
“feature_set_name:version:feature_name”.</p></li>
<li><p><strong>entity_rows</strong> – Pandas dataframe containing entities and a ‘datetime’
column. Each entity in a feature set must be present as a column
in this dataframe. The datetime column must</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Returns a job object that can be used to monitor retrieval progress
asynchronously, and can be used to materialize the results</p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">feast</span> <span class="k">import</span> <span class="n">Client</span>
<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">datetime</span> <span class="k">import</span> <span class="n">datetime</span>
<span class="go">>>></span>
<span class="gp">>>> </span><span class="n">feast_client</span> <span class="o">=</span> <span class="n">Client</span><span class="p">(</span><span class="n">core_url</span><span class="o">=</span><span class="s2">"localhost:6565"</span><span class="p">,</span> <span class="n">serving_url</span><span class="o">=</span><span class="s2">"localhost:6566"</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">feature_ids</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"customer:1:bookings_7d"</span><span class="p">]</span>
<span class="gp">>>> </span><span class="n">entity_rows</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span>
<span class="gp">>>> </span> <span class="p">{</span>
<span class="gp">>>> </span> <span class="s2">"datetime"</span><span class="p">:</span> <span class="p">[</span><span class="n">pd</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span> <span class="k">for</span> <span class="n">_</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">3</span><span class="p">)],</span>
<span class="gp">>>> </span> <span class="s2">"customer"</span><span class="p">:</span> <span class="p">[</span><span class="mi">1001</span><span class="p">,</span> <span class="mi">1002</span><span class="p">,</span> <span class="mi">1003</span><span class="p">],</span>
<span class="gp">>>> </span> <span class="p">}</span>
<span class="gp">>>> </span> <span class="p">)</span>
<span class="gp">>>> </span><span class="n">feature_retrieval_job</span> <span class="o">=</span> <span class="n">feast_client</span><span class="o">.</span><span class="n">get_batch_features</span><span class="p">(</span><span class="n">feature_ids</span><span class="p">,</span> <span class="n">entity_rows</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">df</span> <span class="o">=</span> <span class="n">feature_retrieval_job</span><span class="o">.</span><span class="n">to_dataframe</span><span class="p">()</span>
<span class="gp">>>> </span><span class="nb">print</span><span class="p">(</span><span class="n">df</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="feast.client.Client.get_feature_set">
<code class="sig-name descname">get_feature_set</code><span class="sig-paren">(</span><em class="sig-param">name: str</em>, <em class="sig-param">version: int = None</em>, <em class="sig-param">fail_if_missing: bool = False</em><span class="sig-paren">)</span> → Optional[feast.feature_set.FeatureSet]<a class="reference internal" href="_modules/feast/client.html#Client.get_feature_set"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.client.Client.get_feature_set" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieves a feature set. If no version is specified then the latest
version will be returned.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> – Name of feature set</p></li>
<li><p><strong>version</strong> – Version of feature set</p></li>
<li><p><strong>fail_if_missing</strong> – Raise an error if feature set is not found</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Returns either the specified feature set, or None if not found</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="feast.client.Client.get_online_features">
<code class="sig-name descname">get_online_features</code><span class="sig-paren">(</span><em class="sig-param">feature_ids: List[str], entity_rows: List[feast.serving.ServingService_pb2.EntityRow]</em><span class="sig-paren">)</span> → feast.serving.ServingService_pb2.GetOnlineFeaturesResponse<a class="reference internal" href="_modules/feast/client.html#Client.get_online_features"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.client.Client.get_online_features" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieves the latest online feature data from Feast Serving</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>feature_ids</strong> – <p>List of feature Ids in the following format
[feature_set_name]:[version]:[feature_name]
.. rubric:: Example</p>
<p>[“feature_set_1:6:my_feature_1”,
“feature_set_1:6:my_feature_2”,]</p>
</p></li>
<li><p><strong>entity_rows</strong> – List of GetFeaturesRequest.EntityRow where each row
contains entities. Timestamp should not be set for online
retrieval. All entity types within a feature</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Returns a list of maps where each item in the list contains the
latest feature values for the provided entities</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="feast.client.Client.ingest">
<code class="sig-name descname">ingest</code><span class="sig-paren">(</span><em class="sig-param">feature_set: Union[str, feast.feature_set.FeatureSet], source: Union[pandas.core.frame.DataFrame, str], version: int = None, force_update: bool = False, max_workers: int = 4, disable_progress_bar: bool = False, chunk_size: int = 5000, timeout: int = None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/client.html#Client.ingest"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.client.Client.ingest" title="Permalink to this definition">¶</a></dt>
<dd><p>Loads feature data into Feast for a specific feature set.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>feature_set</strong> – Name of feature set or a feature set object</p></li>
<li><p><strong>source</strong> – Either a file path or Pandas Dataframe to ingest into Feast
Files that are currently supported:
* parquet
* csv
* json</p></li>
<li><p><strong>version</strong> – Feature set version</p></li>
<li><p><strong>force_update</strong> – Automatically update feature set based on source data
prior to ingesting. This will also register changes to Feast</p></li>
<li><p><strong>max_workers</strong> – Number of worker processes to use to encode values</p></li>
<li><p><strong>disable_progress_bar</strong> – Disable printing of progress statistics</p></li>
<li><p><strong>chunk_size</strong> – Maximum amount of rows to load into memory and ingest at
a time</p></li>
<li><p><strong>timeout</strong> – Seconds to wait before ingestion times out</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="feast.client.Client.list_entities">
<code class="sig-name descname">list_entities</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → Dict[str, feast.entity.Entity]<a class="reference internal" href="_modules/feast/client.html#Client.list_entities"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.client.Client.list_entities" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a dictionary of entities across all feature sets</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Dictionary of entities, indexed by name</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="feast.client.Client.list_feature_sets">
<code class="sig-name descname">list_feature_sets</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → List[feast.feature_set.FeatureSet]<a class="reference internal" href="_modules/feast/client.html#Client.list_feature_sets"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.client.Client.list_feature_sets" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve a list of feature sets from Feast Core</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>List of feature sets</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="feast.client.Client.serving_url">
<em class="property">property </em><code class="sig-name descname">serving_url</code><a class="headerlink" href="#feast.client.Client.serving_url" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve Serving Core URL</p>
</dd></dl>
<dl class="method">
<dt id="feast.client.Client.version">
<code class="sig-name descname">version</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/client.html#Client.version"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.client.Client.version" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns version information from Feast Core and Feast Serving</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-feast.feature_set">
<span id="feature-set"></span><h1>Feature Set<a class="headerlink" href="#module-feast.feature_set" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="feast.feature_set.FeatureSet">
<em class="property">class </em><code class="sig-prename descclassname">feast.feature_set.</code><code class="sig-name descname">FeatureSet</code><span class="sig-paren">(</span><em class="sig-param">name: str</em>, <em class="sig-param">features: List[feast.feature.Feature] = None</em>, <em class="sig-param">entities: List[feast.entity.Entity] = None</em>, <em class="sig-param">source: feast.source.Source = None</em>, <em class="sig-param">max_age: Optional[google.protobuf.duration_pb2.Duration] = None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/feature_set.html#FeatureSet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.feature_set.FeatureSet" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents a collection of features and associated metadata.</p>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.add">
<code class="sig-name descname">add</code><span class="sig-paren">(</span><em class="sig-param">resource</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/feature_set.html#FeatureSet.add"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.feature_set.FeatureSet.add" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds a resource (Feature, Entity) to this Feature Set.
Does not register the updated Feature Set with Feast Core</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>resource</strong> – A resource can be either a Feature or an Entity object</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.drop">
<code class="sig-name descname">drop</code><span class="sig-paren">(</span><em class="sig-param">name: str</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/feature_set.html#FeatureSet.drop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.feature_set.FeatureSet.drop" title="Permalink to this definition">¶</a></dt>
<dd><p>Removes a Feature or Entity from a Feature Set. This does not apply
any changes to Feast Core until the apply() method is called.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>name</strong> – Name of Feature or Entity to be removed</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.entities">
<em class="property">property </em><code class="sig-name descname">entities</code><a class="headerlink" href="#feast.feature_set.FeatureSet.entities" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns list of entities from this feature set</p>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.features">
<em class="property">property </em><code class="sig-name descname">features</code><a class="headerlink" href="#feast.feature_set.FeatureSet.features" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of features from this feature set</p>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.fields">
<em class="property">property </em><code class="sig-name descname">fields</code><a class="headerlink" href="#feast.feature_set.FeatureSet.fields" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a dict of fields from this feature set</p>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.from_dict">
<em class="property">classmethod </em><code class="sig-name descname">from_dict</code><span class="sig-paren">(</span><em class="sig-param">fs_dict</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/feature_set.html#FeatureSet.from_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.feature_set.FeatureSet.from_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a feature set from a dict</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>fs_dict</strong> – A dict representation of a feature set</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Returns a FeatureSet object based on the feature set dict</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.from_proto">
<em class="property">classmethod </em><code class="sig-name descname">from_proto</code><span class="sig-paren">(</span><em class="sig-param">feature_set_proto: feast.core.FeatureSet_pb2.FeatureSetSpec</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/feature_set.html#FeatureSet.from_proto"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.feature_set.FeatureSet.from_proto" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a feature set from a protobuf representation of a feature set</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>from_proto</strong> – A protobuf representation of a feature set</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Returns a FeatureSet object based on the feature set protobuf</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.from_yaml">
<em class="property">classmethod </em><code class="sig-name descname">from_yaml</code><span class="sig-paren">(</span><em class="sig-param">yml: str</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/feature_set.html#FeatureSet.from_yaml"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.feature_set.FeatureSet.from_yaml" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a feature set from a YAML string body or a file path</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>yml</strong> – Either a file path containing a yaml file or a YAML string</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Returns a FeatureSet object based on the YAML file</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.get_kafka_source_brokers">
<code class="sig-name descname">get_kafka_source_brokers</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → str<a class="reference internal" href="_modules/feast/feature_set.html#FeatureSet.get_kafka_source_brokers"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.feature_set.FeatureSet.get_kafka_source_brokers" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the broker list for the source in this feature set</p>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.get_kafka_source_topic">
<code class="sig-name descname">get_kafka_source_topic</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → str<a class="reference internal" href="_modules/feast/feature_set.html#FeatureSet.get_kafka_source_topic"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.feature_set.FeatureSet.get_kafka_source_topic" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the topic that this feature set has been configured to use as source</p>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.infer_fields_from_df">
<code class="sig-name descname">infer_fields_from_df</code><span class="sig-paren">(</span><em class="sig-param">df: pandas.core.frame.DataFrame</em>, <em class="sig-param">entities: Optional[List[feast.entity.Entity]] = None</em>, <em class="sig-param">features: Optional[List[feast.feature.Feature]] = None</em>, <em class="sig-param">replace_existing_features: bool = False</em>, <em class="sig-param">replace_existing_entities: bool = False</em>, <em class="sig-param">discard_unused_fields: bool = False</em>, <em class="sig-param">rows_to_sample: int = 100</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/feature_set.html#FeatureSet.infer_fields_from_df"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.feature_set.FeatureSet.infer_fields_from_df" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds fields (Features or Entities) to a feature set based on the schema
of a Datatframe. Only Pandas dataframes are supported. All columns are
detected as features, so setting at least one entity manually is
advised.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>df</strong> – Pandas dataframe to read schema from</p></li>
<li><p><strong>entities</strong> – List of entities that will be set manually and not
inferred. These will take precedence over any existing entities
or entities found in the dataframe.</p></li>
<li><p><strong>features</strong> – List of features that will be set manually and not
inferred. These will take precedence over any existing feature
or features found in the dataframe.</p></li>
<li><p><strong>replace_existing_features</strong> – If true, will replace
existing features in this feature set with features found in
dataframe. If false, will skip conflicting features.</p></li>
<li><p><strong>replace_existing_entities</strong> – If true, will replace existing entities
in this feature set with features found in dataframe. If false,
will skip conflicting entities.</p></li>
<li><p><strong>discard_unused_fields</strong> – Boolean flag. Setting this to True will
discard any existing fields that are not found in the dataset or
provided by the user</p></li>
<li><p><strong>rows_to_sample</strong> – Number of rows to sample to infer types. All rows
must have consistent types, even values within list types must
be homogeneous</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.is_valid">
<code class="sig-name descname">is_valid</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/feature_set.html#FeatureSet.is_valid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.feature_set.FeatureSet.is_valid" title="Permalink to this definition">¶</a></dt>
<dd><p>Validates the state of a feature set locally
:return: (bool, str) True if valid, false if invalid. Contains a message
string with a reason</p>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.max_age">
<em class="property">property </em><code class="sig-name descname">max_age</code><a class="headerlink" href="#feast.feature_set.FeatureSet.max_age" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the maximum age of this feature set. This is the total maximum
amount of staleness that will be allowed during feature retrieval for
each specific feature row that is looked up.</p>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.name">
<em class="property">property </em><code class="sig-name descname">name</code><a class="headerlink" href="#feast.feature_set.FeatureSet.name" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the name of this feature set</p>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.source">
<em class="property">property </em><code class="sig-name descname">source</code><a class="headerlink" href="#feast.feature_set.FeatureSet.source" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the source of this feature set</p>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.to_proto">
<code class="sig-name descname">to_proto</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → feast.core.FeatureSet_pb2.FeatureSetSpec<a class="reference internal" href="_modules/feast/feature_set.html#FeatureSet.to_proto"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.feature_set.FeatureSet.to_proto" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts a feature set object to its protobuf representation</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>FeatureSetSpec protobuf</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="feast.feature_set.FeatureSet.version">
<em class="property">property </em><code class="sig-name descname">version</code><a class="headerlink" href="#feast.feature_set.FeatureSet.version" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the version of this feature set</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-feast.feature">
<span id="feature"></span><h1>Feature<a class="headerlink" href="#module-feast.feature" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="feast.feature.Feature">
<em class="property">class </em><code class="sig-prename descclassname">feast.feature.</code><code class="sig-name descname">Feature</code><span class="sig-paren">(</span><em class="sig-param">name: str</em>, <em class="sig-param">dtype: feast.value_type.ValueType</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/feature.html#Feature"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.feature.Feature" title="Permalink to this definition">¶</a></dt>
<dd><p>Feature field type</p>
<dl class="method">
<dt id="feast.feature.Feature.from_proto">
<em class="property">classmethod </em><code class="sig-name descname">from_proto</code><span class="sig-paren">(</span><em class="sig-param">feature_proto: feast.core.FeatureSet_pb2.FeatureSpec</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/feature.html#Feature.from_proto"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.feature.Feature.from_proto" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts Protobuf Feature to its SDK equivalent</p>
</dd></dl>
<dl class="method">
<dt id="feast.feature.Feature.to_proto">
<code class="sig-name descname">to_proto</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → feast.core.FeatureSet_pb2.FeatureSpec<a class="reference internal" href="_modules/feast/feature.html#Feature.to_proto"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.feature.Feature.to_proto" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts Feature object to its Protocol Buffer representation</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-feast.entity">
<span id="entity"></span><h1>Entity<a class="headerlink" href="#module-feast.entity" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="feast.entity.Entity">
<em class="property">class </em><code class="sig-prename descclassname">feast.entity.</code><code class="sig-name descname">Entity</code><span class="sig-paren">(</span><em class="sig-param">name: str</em>, <em class="sig-param">dtype: feast.value_type.ValueType</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/entity.html#Entity"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.entity.Entity" title="Permalink to this definition">¶</a></dt>
<dd><p>Entity field type</p>
<dl class="method">
<dt id="feast.entity.Entity.from_proto">
<em class="property">classmethod </em><code class="sig-name descname">from_proto</code><span class="sig-paren">(</span><em class="sig-param">entity_proto: feast.core.FeatureSet_pb2.EntitySpec</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/entity.html#Entity.from_proto"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.entity.Entity.from_proto" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a Feast Entity object from its Protocol Buffer representation</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>entity_proto</strong> – EntitySpec protobuf object</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Entity object</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="feast.entity.Entity.to_proto">
<code class="sig-name descname">to_proto</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → feast.core.FeatureSet_pb2.EntitySpec<a class="reference internal" href="_modules/feast/entity.html#Entity.to_proto"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.entity.Entity.to_proto" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts Entity to its Protocol Buffer representation</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Returns EntitySpec object</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-feast.value_type">
<span id="value"></span><h1>Value<a class="headerlink" href="#module-feast.value_type" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="feast.value_type.ValueType">
<em class="property">class </em><code class="sig-prename descclassname">feast.value_type.</code><code class="sig-name descname">ValueType</code><a class="reference internal" href="_modules/feast/value_type.html#ValueType"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.value_type.ValueType" title="Permalink to this definition">¶</a></dt>
<dd><p>Feature value type. Used to define data types in Feature Sets.</p>
</dd></dl>
</div>
<div class="section" id="module-feast.source">
<span id="source"></span><h1>Source<a class="headerlink" href="#module-feast.source" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="feast.source.KafkaSource">
<em class="property">class </em><code class="sig-prename descclassname">feast.source.</code><code class="sig-name descname">KafkaSource</code><span class="sig-paren">(</span><em class="sig-param">brokers: str = ''</em>, <em class="sig-param">topic: str = ''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/source.html#KafkaSource"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.source.KafkaSource" title="Permalink to this definition">¶</a></dt>
<dd><p>Kafka feature set source type.</p>
<dl class="method">
<dt id="feast.source.KafkaSource.brokers">
<em class="property">property </em><code class="sig-name descname">brokers</code><a class="headerlink" href="#feast.source.KafkaSource.brokers" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the list of broker addresses for this Kafka source</p>
</dd></dl>
<dl class="method">
<dt id="feast.source.KafkaSource.source_type">
<em class="property">property </em><code class="sig-name descname">source_type</code><a class="headerlink" href="#feast.source.KafkaSource.source_type" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the type of source. For a Kafka source this will always return
“kafka”</p>
</dd></dl>
<dl class="method">
<dt id="feast.source.KafkaSource.to_proto">
<code class="sig-name descname">to_proto</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → feast.core.Source_pb2.Source<a class="reference internal" href="_modules/feast/source.html#KafkaSource.to_proto"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.source.KafkaSource.to_proto" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts this Source into its protobuf representation</p>
</dd></dl>
<dl class="method">
<dt id="feast.source.KafkaSource.topic">
<em class="property">property </em><code class="sig-name descname">topic</code><a class="headerlink" href="#feast.source.KafkaSource.topic" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the topic for this feature set</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="feast.source.Source">
<em class="property">class </em><code class="sig-prename descclassname">feast.source.</code><code class="sig-name descname">Source</code><a class="reference internal" href="_modules/feast/source.html#Source"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.source.Source" title="Permalink to this definition">¶</a></dt>
<dd><p>Source is the top level class that represents a data source for finding
feature data. Source must be extended with specific implementations to
be useful</p>
<dl class="method">
<dt id="feast.source.Source.from_proto">
<em class="property">classmethod </em><code class="sig-name descname">from_proto</code><span class="sig-paren">(</span><em class="sig-param">source_proto: feast.core.Source_pb2.Source</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/source.html#Source.from_proto"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.source.Source.from_proto" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a source from a protobuf representation. This will instantiate
and return a specific source type, depending on the protobuf that is
passed in.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>source_proto</strong> – SourceProto python object</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Source object</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="feast.source.Source.source_type">
<em class="property">property </em><code class="sig-name descname">source_type</code><a class="headerlink" href="#feast.source.Source.source_type" title="Permalink to this definition">¶</a></dt>
<dd><p>The type of source. If not implemented, this will return “None”</p>
</dd></dl>
<dl class="method">
<dt id="feast.source.Source.to_proto">
<code class="sig-name descname">to_proto</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/source.html#Source.to_proto"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.source.Source.to_proto" title="Permalink to this definition">¶</a></dt>
<dd><p>Converts this source object to its protobuf representation.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-feast.job">
<span id="job"></span><h1>Job<a class="headerlink" href="#module-feast.job" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="feast.job.Job">
<em class="property">class </em><code class="sig-prename descclassname">feast.job.</code><code class="sig-name descname">Job</code><span class="sig-paren">(</span><em class="sig-param">job_proto: feast.serving.ServingService_pb2.Job</em>, <em class="sig-param">serving_stub: feast.serving.ServingService_pb2_grpc.ServingServiceStub</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/job.html#Job"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.job.Job" title="Permalink to this definition">¶</a></dt>
<dd><p>A class representing a job for feature retrieval in Feast.</p>
<dl class="method">
<dt id="feast.job.Job.id">
<em class="property">property </em><code class="sig-name descname">id</code><a class="headerlink" href="#feast.job.Job.id" title="Permalink to this definition">¶</a></dt>
<dd><p>Getter for the Job Id</p>
</dd></dl>
<dl class="method">
<dt id="feast.job.Job.reload">
<code class="sig-name descname">reload</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/job.html#Job.reload"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.job.Job.reload" title="Permalink to this definition">¶</a></dt>
<dd><p>Reload the latest job status
Returns: None</p>
</dd></dl>
<dl class="method">
<dt id="feast.job.Job.result">
<code class="sig-name descname">result</code><span class="sig-paren">(</span><em class="sig-param">timeout_sec: int = 21600</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/job.html#Job.result"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.job.Job.result" title="Permalink to this definition">¶</a></dt>
<dd><p>Wait until job is done to get an iterable rows of result.
The row can only represent an Avro row in Feast 0.3.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>timeout_sec</strong> – max no of seconds to wait until job is done. If “timeout_sec” is exceeded, an exception will be raised.</p>
</dd>
</dl>
<p>Returns: Iterable of Avro rows</p>
</dd></dl>
<dl class="method">
<dt id="feast.job.Job.status">
<em class="property">property </em><code class="sig-name descname">status</code><a class="headerlink" href="#feast.job.Job.status" title="Permalink to this definition">¶</a></dt>
<dd><p>Getter for the Job status from Feast Core</p>
</dd></dl>
<dl class="method">
<dt id="feast.job.Job.to_dataframe">
<code class="sig-name descname">to_dataframe</code><span class="sig-paren">(</span><em class="sig-param">timeout_sec: int = 21600</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/feast/job.html#Job.to_dataframe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#feast.job.Job.to_dataframe" title="Permalink to this definition">¶</a></dt>
<dd><p>Wait until job is done to get an interable rows of result</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>timeout_sec</strong> – max no of seconds to wait until job is done. If “timeout_sec” is exceeded, an exception will be raised.</p>
</dd>
</dl>
<p>Returns: pandas Dataframe of the feature values</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2019, Feast Authors
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>