-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathseldon.pipeline.html
More file actions
924 lines (770 loc) · 60.2 KB
/
seldon.pipeline.html
File metadata and controls
924 lines (770 loc) · 60.2 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
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
<!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>seldon.pipeline package — seldon 2.2.1 documentation</title>
<link rel="stylesheet" href="static/css/theme.css" type="text/css" />
<link rel="top" title="seldon 2.2.1 documentation" href="index.html"/>
<link rel="up" title="seldon package" href="seldon.html"/>
<link rel="next" title="seldon.text package" href="seldon.text.html"/>
<link rel="prev" title="seldon.misc package" href="seldon.misc.html"/>
<script src="static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<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="index.html" class="icon icon-home"> seldon
</a>
<div class="version">
2.2.1
</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">
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="seldon.html">seldon package</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="seldon.html#subpackages">Subpackages</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="seldon.anomaly.html">seldon.anomaly package</a></li>
<li class="toctree-l3"><a class="reference internal" href="seldon.cli.html">seldon.cli package</a></li>
<li class="toctree-l3"><a class="reference internal" href="seldon.luigi.html">seldon.luigi package</a></li>
<li class="toctree-l3"><a class="reference internal" href="seldon.microservice.html">seldon.microservice package</a></li>
<li class="toctree-l3"><a class="reference internal" href="seldon.misc.html">seldon.misc package</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="">seldon.pipeline package</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#submodules">Submodules</a></li>
<li class="toctree-l4"><a class="reference internal" href="#module-seldon.pipeline.auto_transforms">seldon.pipeline.auto_transforms module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#module-seldon.pipeline.basic_transforms">seldon.pipeline.basic_transforms module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#seldon-pipeline-bayes-optimize-module">seldon.pipeline.bayes_optimize module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#module-seldon.pipeline.cross_validation">seldon.pipeline.cross_validation module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#module-seldon.pipeline.pandas_pipelines">seldon.pipeline.pandas_pipelines module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#module-seldon.pipeline.sklearn_transform">seldon.pipeline.sklearn_transform module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#module-seldon.pipeline.tfidf_transform">seldon.pipeline.tfidf_transform module</a></li>
<li class="toctree-l4"><a class="reference internal" href="#module-seldon.pipeline">Module contents</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="seldon.text.html">seldon.text package</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="seldon.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="seldon.html#module-seldon.fileutil">seldon.fileutil module</a></li>
<li class="toctree-l2"><a class="reference internal" href="seldon.html#module-seldon.keras">seldon.keras module</a></li>
<li class="toctree-l2"><a class="reference internal" href="seldon.html#module-seldon.sklearn_estimator">seldon.sklearn_estimator module</a></li>
<li class="toctree-l2"><a class="reference internal" href="seldon.html#module-seldon.util">seldon.util module</a></li>
<li class="toctree-l2"><a class="reference internal" href="seldon.html#module-seldon.vw">seldon.vw module</a></li>
<li class="toctree-l2"><a class="reference internal" href="seldon.html#module-seldon.xgb">seldon.xgb module</a></li>
<li class="toctree-l2"><a class="reference internal" href="seldon.html#module-seldon.tensorflow_wrapper">seldon.tensorflow_wrapper module</a></li>
<li class="toctree-l2"><a class="reference internal" href="seldon.html#module-seldon">Module contents</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">seldon</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="index.html">Docs</a> »</li>
<li><a href="seldon.html">seldon package</a> »</li>
<li>seldon.pipeline package</li>
<li class="wy-breadcrumbs-aside">
<a href="sources/seldon.pipeline.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="seldon-pipeline-package">
<h1>seldon.pipeline package<a class="headerlink" href="#seldon-pipeline-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-seldon.pipeline.auto_transforms">
<span id="seldon-pipeline-auto-transforms-module"></span><h2>seldon.pipeline.auto_transforms module<a class="headerlink" href="#module-seldon.pipeline.auto_transforms" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="seldon.pipeline.auto_transforms.AutoTransform">
<em class="property">class </em><code class="descclassname">seldon.pipeline.auto_transforms.</code><code class="descname">AutoTransform</code><span class="sig-paren">(</span><em>exclude=[], include=None, max_values_numeric_categorical=0, date_cols=[], custom_date_formats=None, ignore_vals=None, force_categorical=[], min_cat_percent=0.0, max_cat_percent=1.0, bool_map={'1': 1, '0': 0, 'false': 0, 'no': 0, '1.0': 1, 'yes': 1, 'true': 1, '0.0': 0}, cat_missing_val='UKN', date_transforms=[True, True, True, True], create_date_differences=False, nan_threshold=None, drop_constant_features=True, drop_duplicate_cols=True, min_max_limit=False</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/auto_transforms.html#AutoTransform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.auto_transforms.AutoTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.BaseEstimator</span></code>, <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.TransformerMixin</span></code></p>
<p>Automatically transform a set of features into normalzied numeric or categorical features or dates</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>exclude</strong> (<em>list str, optional</em>) – list of features to not include</li>
<li><strong>include</strong> (<em>list str, optional</em>) – features to include if None then all unless exclude used</li>
<li><strong>max_values_numeric_categorical</strong> (<em>int, optional</em>) – max number of unique values for numeric feature to treat as categorical</li>
<li><strong>custom_date_formats</strong> (<em>list str, optional</em>) – list of custom date formats to try</li>
<li><strong>ignore_vals</strong> (<em>list str, optional</em>) – list of feature values to treat as NA/ignored values</li>
<li><strong>force_categorical</strong> (<em>list str, optional</em>) – features to force to be categorical</li>
<li><strong>min_cat_percent</strong> (<em>list str, optional</em>) – min percentage for a categorical value to be kept</li>
<li><strong>max_cat_percent</strong> (<em>float, optional</em>) – max percentage for a categorical value to be kept</li>
<li><strong>bool_map</strong> (<em>dict, optional</em>) – set of string values to be treated as boolean</li>
<li><strong>cat_missing_value</strong> (<em>str, optional</em>) – string to use for missing categorical values</li>
<li><strong>date_transforms</strong> (<em>list bool, optional</em>) – which date transforms to apply [hour,month,day_of_week,year], default is all</li>
<li><strong>create_date_differences</strong> (<em>bool, optional</em>) – whether to create differences between all date variables</li>
<li><strong>nan_threshold</strong> (<em>float, optional</em>) – featurs to drop if too many nan, threshold is between 0-1 as percent</li>
<li><strong>drop_constant_features</strong> (<em>bool, optional</em>) – drop a column if its value is constant</li>
<li><strong>duplicate columns</strong> (<em>drop</em>) – drop duplicate columns</li>
<li><strong>min_max_limit</strong> (<em>bool, optional</em>) – limit numeric cols to min and max seen in fit</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="seldon.pipeline.auto_transforms.AutoTransform.fit">
<code class="descname">fit</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/auto_transforms.html#AutoTransform.fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.auto_transforms.AutoTransform.fit" title="Permalink to this definition">¶</a></dt>
<dd><p>Fit models against an input pandas dataframe</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>X</strong> (<em>pandas dataframe</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>self</strong></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">object</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="seldon.pipeline.auto_transforms.AutoTransform.transform">
<code class="descname">transform</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/auto_transforms.html#AutoTransform.transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.auto_transforms.AutoTransform.transform" title="Permalink to this definition">¶</a></dt>
<dd><p>transform a datframe with fitted models</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>X</strong> (<em>pandas dataframe</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">Transformed pandas dataframe</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-seldon.pipeline.basic_transforms">
<span id="seldon-pipeline-basic-transforms-module"></span><h2>seldon.pipeline.basic_transforms module<a class="headerlink" href="#module-seldon.pipeline.basic_transforms" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="seldon.pipeline.basic_transforms.BinaryTransform">
<em class="property">class </em><code class="descclassname">seldon.pipeline.basic_transforms.</code><code class="descname">BinaryTransform</code><span class="sig-paren">(</span><em>input_feature=None</em>, <em>output_feature=None</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#BinaryTransform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.BinaryTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.BaseEstimator</span></code>, <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.TransformerMixin</span></code></p>
<p>Create a binary feature based on existence of another feature</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>input_feature</strong> (<em>str</em>) – input feature to transform</li>
<li><strong>output_feature</strong> (<em>str</em>) – output feature to place transformation</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="seldon.pipeline.basic_transforms.BinaryTransform.fit">
<code class="descname">fit</code><span class="sig-paren">(</span><em>X</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#BinaryTransform.fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.BinaryTransform.fit" title="Permalink to this definition">¶</a></dt>
<dd><p>nothing to do in fit</p>
</dd></dl>
<dl class="method">
<dt id="seldon.pipeline.basic_transforms.BinaryTransform.transform">
<code class="descname">transform</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#BinaryTransform.transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.BinaryTransform.transform" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="seldon.pipeline.basic_transforms.ExcludeFeaturesTransform">
<em class="property">class </em><code class="descclassname">seldon.pipeline.basic_transforms.</code><code class="descname">ExcludeFeaturesTransform</code><span class="sig-paren">(</span><em>excluded=[]</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#ExcludeFeaturesTransform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.ExcludeFeaturesTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.BaseEstimator</span></code>, <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.TransformerMixin</span></code></p>
<p>Filter a dataset and exclude specided set of features</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>excluded</strong> (<em>list str</em>) – list of features to be excluded</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="seldon.pipeline.basic_transforms.ExcludeFeaturesTransform.fit">
<code class="descname">fit</code><span class="sig-paren">(</span><em>X</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#ExcludeFeaturesTransform.fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.ExcludeFeaturesTransform.fit" title="Permalink to this definition">¶</a></dt>
<dd><p>nothing to do in fit</p>
</dd></dl>
<dl class="method">
<dt id="seldon.pipeline.basic_transforms.ExcludeFeaturesTransform.transform">
<code class="descname">transform</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#ExcludeFeaturesTransform.transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.ExcludeFeaturesTransform.transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Trasform dataframe to include specified features only</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>df</strong> (<em>pandas dataframe</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">Transformed pandas dataframe</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="seldon.pipeline.basic_transforms.ExistFeaturesTransform">
<em class="property">class </em><code class="descclassname">seldon.pipeline.basic_transforms.</code><code class="descname">ExistFeaturesTransform</code><span class="sig-paren">(</span><em>included=None</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#ExistFeaturesTransform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.ExistFeaturesTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.BaseEstimator</span></code>, <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.TransformerMixin</span></code></p>
<p>Filter rows based on whether a specified set of features exists</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>included</strong> (<em>list str</em>) – list of features that need to exist</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="seldon.pipeline.basic_transforms.ExistFeaturesTransform.fit">
<code class="descname">fit</code><span class="sig-paren">(</span><em>objs</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#ExistFeaturesTransform.fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.ExistFeaturesTransform.fit" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="seldon.pipeline.basic_transforms.ExistFeaturesTransform.transform">
<code class="descname">transform</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#ExistFeaturesTransform.transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.ExistFeaturesTransform.transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Transform by returning input feature set if required features exist in it</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>df</strong> (<em>pandas dataframe</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">Transformed pandas dataframe</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="seldon.pipeline.basic_transforms.FeatureIdTransform">
<em class="property">class </em><code class="descclassname">seldon.pipeline.basic_transforms.</code><code class="descname">FeatureIdTransform</code><span class="sig-paren">(</span><em>input_feature=None</em>, <em>output_feature=None</em>, <em>min_size=0</em>, <em>max_classes=1000</em>, <em>exclude_missing=False</em>, <em>zero_based=False</em>, <em>id_map={}</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#FeatureIdTransform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.FeatureIdTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.BaseEstimator</span></code>, <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.TransformerMixin</span></code></p>
<p>create a numeric feature id</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>input_feature</strong> (<em>str</em>) – input feature to create ids from</li>
<li><strong>output_feature</strong> (<em>str</em>) – output feature to place ids</li>
<li><strong>min_size</strong> (<em>int, optional</em>) – minimum number of examples of each feature value for feature to be included in transform as new id</li>
<li><strong>exclude_missing</strong> (<em>bool, optional</em>) – exclude rows that do not have the input feature</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="seldon.pipeline.basic_transforms.FeatureIdTransform.fit">
<code class="descname">fit</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#FeatureIdTransform.fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.FeatureIdTransform.fit" title="Permalink to this definition">¶</a></dt>
<dd><p>Create map of ids for each feature value</p>
<p>create counts of occurrences of each feature value. Exclude features with not enough counds. Create id map.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>df</strong> (<em>pandas dataframe</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>self</strong></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">object</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="seldon.pipeline.basic_transforms.FeatureIdTransform.transform">
<code class="descname">transform</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#FeatureIdTransform.transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.FeatureIdTransform.transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Transform features creating a new id and exluding rows if needed</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>df</strong> (<em>pandas dataframe</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">Transformed pandas dataframe</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="seldon.pipeline.basic_transforms.IncludeFeaturesTransform">
<em class="property">class </em><code class="descclassname">seldon.pipeline.basic_transforms.</code><code class="descname">IncludeFeaturesTransform</code><span class="sig-paren">(</span><em>included=[]</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#IncludeFeaturesTransform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.IncludeFeaturesTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.BaseEstimator</span></code>, <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.TransformerMixin</span></code></p>
<p>Filter a dataset and include only specided set of features</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>input_features</strong> (<em>list str</em>) – input features to include</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="seldon.pipeline.basic_transforms.IncludeFeaturesTransform.fit">
<code class="descname">fit</code><span class="sig-paren">(</span><em>X</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#IncludeFeaturesTransform.fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.IncludeFeaturesTransform.fit" title="Permalink to this definition">¶</a></dt>
<dd><p>nothing to do in fit</p>
</dd></dl>
<dl class="method">
<dt id="seldon.pipeline.basic_transforms.IncludeFeaturesTransform.transform">
<code class="descname">transform</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#IncludeFeaturesTransform.transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.IncludeFeaturesTransform.transform" title="Permalink to this definition">¶</a></dt>
<dd><p>transform a dataframe to include given features</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>df</strong> (<em>pandas dataframe</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">Transformed pandas dataframe</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="seldon.pipeline.basic_transforms.SplitTransform">
<em class="property">class </em><code class="descclassname">seldon.pipeline.basic_transforms.</code><code class="descname">SplitTransform</code><span class="sig-paren">(</span><em>split_expression=' '</em>, <em>ignore_numbers=False</em>, <em>input_features=[]</em>, <em>output_feature=None</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#SplitTransform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.SplitTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.BaseEstimator</span></code>, <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.TransformerMixin</span></code></p>
<p>Split a set of string input features on an expression and create a new feature which has a list of values</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>split_expression</strong> (<em>str</em>) – regular expression to split feature on</li>
<li><strong>ignore_numbers</strong> (<em>bool</em>) – whether to ignore any resulting strings that represent numbers</li>
<li><strong>input_features</strong> (<em>list str</em>) – list of feature names to split - should all have text values</li>
<li><strong>output_feature</strong> (<em>str</em>) – output feature</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="seldon.pipeline.basic_transforms.SplitTransform.fit">
<code class="descname">fit</code><span class="sig-paren">(</span><em>X</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#SplitTransform.fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.SplitTransform.fit" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="seldon.pipeline.basic_transforms.SplitTransform.transform">
<code class="descname">transform</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#SplitTransform.transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.SplitTransform.transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Transform text features by splitting them and creating a list of feature as result</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>df</strong> (<em>pandas dataframe</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">Transformed pandas dataframe</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="seldon.pipeline.basic_transforms.SvmlightTransform">
<em class="property">class </em><code class="descclassname">seldon.pipeline.basic_transforms.</code><code class="descname">SvmlightTransform</code><span class="sig-paren">(</span><em>included=None</em>, <em>zero_based=False</em>, <em>excluded=[]</em>, <em>id_map={}</em>, <em>output_feature=None</em>, <em>id_map_file=None</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#SvmlightTransform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.SvmlightTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.BaseEstimator</span></code>, <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.TransformerMixin</span></code></p>
<p>Take a set of features and transform into a sorted dictionary of numeric id:value features</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>included</strong> (<em>list str</em>) – set of feature to use as input</li>
<li><strong>zero_based</strong> (<em>zero_based, optional</em>) – whether to start first id at 0</li>
<li><strong>excluded</strong> (<em>list str</em>) – set of features to exclude</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="seldon.pipeline.basic_transforms.SvmlightTransform.fit">
<code class="descname">fit</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#SvmlightTransform.fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.SvmlightTransform.fit" title="Permalink to this definition">¶</a></dt>
<dd><p>create ids for each feature to be included</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>df</strong> (<em>pandas dataframe</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>self</strong></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">object</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="seldon.pipeline.basic_transforms.SvmlightTransform.transform">
<code class="descname">transform</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/basic_transforms.html#SvmlightTransform.transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.basic_transforms.SvmlightTransform.transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Transform features by getting id and numeric value</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>X</strong> (<em>pandas dataframe</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">Transformed pandas dataframe</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="seldon-pipeline-bayes-optimize-module">
<h2>seldon.pipeline.bayes_optimize module<a class="headerlink" href="#seldon-pipeline-bayes-optimize-module" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-seldon.pipeline.cross_validation">
<span id="seldon-pipeline-cross-validation-module"></span><h2>seldon.pipeline.cross_validation module<a class="headerlink" href="#module-seldon.pipeline.cross_validation" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="seldon.pipeline.cross_validation.SeldonKFold">
<em class="property">class </em><code class="descclassname">seldon.pipeline.cross_validation.</code><code class="descname">SeldonKFold</code><span class="sig-paren">(</span><em>clf=None</em>, <em>k=5</em>, <em>save_folds_folder=None</em>, <em>metric='accuracy'</em>, <em>random_state=1</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/cross_validation.html#SeldonKFold"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.cross_validation.SeldonKFold" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.BaseEstimator</span></code></p>
<p>Simple wrapper to provide cross validation test using estimator with input from pandas dataframe</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>clf</strong> (<em>object</em>) – Pandas compatible scikit learn Estimator to apply to data splits</li>
<li><strong>k</strong> (<em>int, optional</em>) – number of folds</li>
<li><strong>save_folder_folder</strong> (<em>str, optional</em>) – a folder to save prediction results from each fold</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="seldon.pipeline.cross_validation.SeldonKFold.fit">
<code class="descname">fit</code><span class="sig-paren">(</span><em>X</em>, <em>y=None</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/cross_validation.html#SeldonKFold.fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.cross_validation.SeldonKFold.fit" title="Permalink to this definition">¶</a></dt>
<dd><p>Split dataframe into k folds and train test classifier on each. Finally train classifier on all data.
:param X:
:type X: pandas dataframe</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><strong>self</strong></td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">object</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="seldon.pipeline.cross_validation.SeldonKFold.get_class_id_map">
<code class="descname">get_class_id_map</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/cross_validation.html#SeldonKFold.get_class_id_map"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.cross_validation.SeldonKFold.get_class_id_map" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="seldon.pipeline.cross_validation.SeldonKFold.get_score">
<code class="descname">get_score</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/cross_validation.html#SeldonKFold.get_score"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.cross_validation.SeldonKFold.get_score" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="seldon.pipeline.cross_validation.SeldonKFold.get_scores">
<code class="descname">get_scores</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/cross_validation.html#SeldonKFold.get_scores"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.cross_validation.SeldonKFold.get_scores" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="seldon.pipeline.cross_validation.SeldonKFold.predict">
<code class="descname">predict</code><span class="sig-paren">(</span><em>X</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/cross_validation.html#SeldonKFold.predict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.cross_validation.SeldonKFold.predict" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="seldon.pipeline.cross_validation.SeldonKFold.predict_proba">
<code class="descname">predict_proba</code><span class="sig-paren">(</span><em>X</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/cross_validation.html#SeldonKFold.predict_proba"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.cross_validation.SeldonKFold.predict_proba" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="seldon.pipeline.cross_validation.SeldonKFold.set_params">
<code class="descname">set_params</code><span class="sig-paren">(</span><em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/cross_validation.html#SeldonKFold.set_params"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.cross_validation.SeldonKFold.set_params" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="seldon.pipeline.cross_validation.SeldonKFold.transform">
<code class="descname">transform</code><span class="sig-paren">(</span><em>X</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/cross_validation.html#SeldonKFold.transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.cross_validation.SeldonKFold.transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Do nothing and pass input back</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-seldon.pipeline.pandas_pipelines">
<span id="seldon-pipeline-pandas-pipelines-module"></span><h2>seldon.pipeline.pandas_pipelines module<a class="headerlink" href="#module-seldon.pipeline.pandas_pipelines" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="seldon.pipeline.pandas_pipelines.BasePandasEstimator">
<em class="property">class </em><code class="descclassname">seldon.pipeline.pandas_pipelines.</code><code class="descname">BasePandasEstimator</code><span class="sig-paren">(</span><em>target=None</em>, <em>target_readable=None</em>, <em>included=None</em>, <em>excluded=None</em>, <em>id_map={}</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/pandas_pipelines.html#BasePandasEstimator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.pandas_pipelines.BasePandasEstimator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">object</span></code></p>
<p>Tools to help with Pandas based estimators.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>target</strong> (<em>str</em>) – Target column</li>
<li><strong>target_readable</strong> (<em>str</em>) – More descriptive version of target variable</li>
<li><strong>included</strong> (<em>list str, optional</em>) – columns to include</li>
<li><strong>excluded</strong> (<em>list str, optional</em>) – columns to exclude</li>
<li><strong>id_map</strong> (<em>dict (int,str), optional</em>) – map of class ids to high level names</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="seldon.pipeline.pandas_pipelines.BasePandasEstimator.close">
<code class="descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/pandas_pipelines.html#BasePandasEstimator.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.pandas_pipelines.BasePandasEstimator.close" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="seldon.pipeline.pandas_pipelines.BasePandasEstimator.convert_dataframe">
<code class="descname">convert_dataframe</code><span class="sig-paren">(</span><em>df_base</em>, <em>vectorizer</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/pandas_pipelines.html#BasePandasEstimator.convert_dataframe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.pandas_pipelines.BasePandasEstimator.convert_dataframe" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a dataframe into one for use with ml algorithms
One hot encode the categorical variable
Ignore date values
concatenate with numeric values</p>
</dd></dl>
<dl class="method">
<dt id="seldon.pipeline.pandas_pipelines.BasePandasEstimator.convert_numpy">
<code class="descname">convert_numpy</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/pandas_pipelines.html#BasePandasEstimator.convert_numpy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.pandas_pipelines.BasePandasEstimator.convert_numpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a dataframe into a numpy data matrix for training and an array of target values
Uses a vectorizer for one hot encoding which is returned
NaNs are filled with zeros</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>df</strong> (<em>pandas dataframe</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><ul class="simple">
<li><strong>X</strong> (<em>array like - data as array</em>)</li>
<li><strong>y</strong> (<em>array - target labels</em>)</li>
<li><strong>vectorizer</strong> (<em>vectorizer used for one hot encoding</em>)</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="seldon.pipeline.pandas_pipelines.BasePandasEstimator.create_class_id_map">
<code class="descname">create_class_id_map</code><span class="sig-paren">(</span><em>df</em>, <em>target</em>, <em>target_readable</em>, <em>zero_based=True</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/pandas_pipelines.html#BasePandasEstimator.create_class_id_map"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.pandas_pipelines.BasePandasEstimator.create_class_id_map" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a map of classification ids to readable values</p>
</dd></dl>
<dl class="method">
<dt id="seldon.pipeline.pandas_pipelines.BasePandasEstimator.encode_onehot">
<code class="descname">encode_onehot</code><span class="sig-paren">(</span><em>df</em>, <em>cols</em>, <em>vec</em>, <em>op</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/pandas_pipelines.html#BasePandasEstimator.encode_onehot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.pandas_pipelines.BasePandasEstimator.encode_onehot" title="Permalink to this definition">¶</a></dt>
<dd><p>One hot encode categorical values from a data frame using a vectorizer passed in</p>
</dd></dl>
<dl class="method">
<dt id="seldon.pipeline.pandas_pipelines.BasePandasEstimator.get_class_id_map">
<code class="descname">get_class_id_map</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/pandas_pipelines.html#BasePandasEstimator.get_class_id_map"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.pandas_pipelines.BasePandasEstimator.get_class_id_map" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="seldon.pipeline.pandas_pipelines.BasePandasEstimator.get_target">
<code class="descname">get_target</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/pandas_pipelines.html#BasePandasEstimator.get_target"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.pandas_pipelines.BasePandasEstimator.get_target" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="seldon.pipeline.pandas_pipelines.BasePandasEstimator.predict">
<code class="descname">predict</code><span class="sig-paren">(</span><em>X</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/pandas_pipelines.html#BasePandasEstimator.predict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.pandas_pipelines.BasePandasEstimator.predict" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="seldon.pipeline.pandas_pipelines.BasePandasEstimator.set_class_id_map">
<code class="descname">set_class_id_map</code><span class="sig-paren">(</span><em>id_map</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/pandas_pipelines.html#BasePandasEstimator.set_class_id_map"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.pandas_pipelines.BasePandasEstimator.set_class_id_map" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="module-seldon.pipeline.sklearn_transform">
<span id="seldon-pipeline-sklearn-transform-module"></span><h2>seldon.pipeline.sklearn_transform module<a class="headerlink" href="#module-seldon.pipeline.sklearn_transform" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="seldon.pipeline.sklearn_transform.SklearnTransform">
<em class="property">class </em><code class="descclassname">seldon.pipeline.sklearn_transform.</code><code class="descname">SklearnTransform</code><span class="sig-paren">(</span><em>input_features=None</em>, <em>output_features=None</em>, <em>output_features_prefix=None</em>, <em>transformer=None</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/sklearn_transform.html#SklearnTransform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.sklearn_transform.SklearnTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.BaseEstimator</span></code>, <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.TransformerMixin</span></code></p>
<p>Allow sklearn transformers to be run on Pandas dataframes.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>input_features</strong> (<em>list str</em>) – input columns to use</li>
<li><strong>output_features</strong> (<em>list str, optional</em>) – names of output columns</li>
<li><strong>transformer</strong> (<em>scikit learn Transformer</em>) – transformer to run on data</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="seldon.pipeline.sklearn_transform.SklearnTransform.fit">
<code class="descname">fit</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/sklearn_transform.html#SklearnTransform.fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.sklearn_transform.SklearnTransform.fit" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>df</strong> (<em>pandas dataframe</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>self</strong></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">object</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="seldon.pipeline.sklearn_transform.SklearnTransform.transform">
<code class="descname">transform</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/sklearn_transform.html#SklearnTransform.transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.sklearn_transform.SklearnTransform.transform" title="Permalink to this definition">¶</a></dt>
<dd><p>transform the input columns and merge result into input dataframe using column names if provided</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>df</strong> (<em>pandas dataframe</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">Transformed pandas dataframe</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-seldon.pipeline.tfidf_transform">
<span id="seldon-pipeline-tfidf-transform-module"></span><h2>seldon.pipeline.tfidf_transform module<a class="headerlink" href="#module-seldon.pipeline.tfidf_transform" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="seldon.pipeline.tfidf_transform.TfidfTransform">
<em class="property">class </em><code class="descclassname">seldon.pipeline.tfidf_transform.</code><code class="descname">TfidfTransform</code><span class="sig-paren">(</span><em>input_feature=None, output_feature=None, min_df=0, max_df=1.0, select_features=False, topn_features=50000, stop_words=None, target_feature=None, vectorizer=None, TfidfTransformer=None, ch2=None, fnames=None, feature_names_support=[], ngram_range=[1, 1]</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/tfidf_transform.html#TfidfTransform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.tfidf_transform.TfidfTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.BaseEstimator</span></code>, <code class="xref py py-class docutils literal"><span class="pre">sklearn.base.TransformerMixin</span></code></p>
<p>Create TF-IDF (term frequency - inverse document frequency) features.</p>
<p>can use chi-squared test to limit features. Assumes string based input feature that can be split.
Uses scikit-learn based transformers internally</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>min_df</strong> (<em>int, optinal</em>) – min document frequency (for sklearn vectorizer)</li>
<li><strong>max_df</strong> (<em>float, optional</em>) – max document frequency (for sklearn vectorizer)</li>
<li><strong>select_features</strong> (<em>bool, optional</em>) – use chi-squared test to select features</li>
<li><strong>topn_features</strong> (<em>int, optional</em>) – keep top features from chi-squared test</li>
<li><strong>stop_words</strong> (<em>str, optional</em>) – stop words (for sklearn vectorizer)</li>
<li><strong>target_feature</strong> (<em>str, optional</em>) – target feature for chi-squared test</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="seldon.pipeline.tfidf_transform.TfidfTransform.fit">
<code class="descname">fit</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/tfidf_transform.html#TfidfTransform.fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.tfidf_transform.TfidfTransform.fit" title="Permalink to this definition">¶</a></dt>
<dd><p>Fit tfidf transform</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>df</strong> (<em>pandas dataframe</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>self</strong></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">object</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="seldon.pipeline.tfidf_transform.TfidfTransform.get_tokens">
<code class="descname">get_tokens</code><span class="sig-paren">(</span><em>v</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/tfidf_transform.html#TfidfTransform.get_tokens"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.tfidf_transform.TfidfTransform.get_tokens" title="Permalink to this definition">¶</a></dt>
<dd><p>basic method to get “document” string from feature</p>
</dd></dl>
<dl class="method">
<dt id="seldon.pipeline.tfidf_transform.TfidfTransform.transform">
<code class="descname">transform</code><span class="sig-paren">(</span><em>df</em><span class="sig-paren">)</span><a class="reference internal" href="modules/seldon/pipeline/tfidf_transform.html#TfidfTransform.transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#seldon.pipeline.tfidf_transform.TfidfTransform.transform" title="Permalink to this definition">¶</a></dt>
<dd><p>transform features with tfidf transform</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>X</strong> (<em>pandas dataframe</em>) – </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">Transformed pandas dataframe</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-seldon.pipeline">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-seldon.pipeline" title="Permalink to this headline">¶</a></h2>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="seldon.text.html" class="btn btn-neutral float-right" title="seldon.text package" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="seldon.misc.html" class="btn btn-neutral" title="seldon.misc package" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2015, Seldon.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/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">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.2.1',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</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/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>