@@ -3,15 +3,18 @@ predictionio Package Documentation
3
3
4
4
.. automodule :: predictionio
5
5
6
- The SDK comprises of two clients:
6
+ The SDK comprises of two clients:
7
7
8
- 1. EventClient, it is for importing data into the PredictionIO platform.
8
+ 1. EventClient, it is for importing data into the PredictionIO platform.
9
9
2. EngineClient, it is for querying PredictionIO Engine Instance, submit query
10
10
and extract prediction results.
11
11
12
- Please read `PredictionIO Quick Start
13
- <http://docs.prediction.io/0.8.3/recommendation/quickstart.html> `_ for
14
- detailed explanation.
12
+ The SDK also provides a FileExporter for you to write events to a JSON file
13
+ in the same way as EventClient. The JSON file can be used by "pio import"
14
+ for batch data import.
15
+
16
+ Please read `PredictionIO Event API <http://docs.prediction.io/datacollection/eventapi/ >`_ for explanation of
17
+ how SDK can be used to import events.
15
18
16
19
predictionio.EventClient Class
17
20
------------------------------
@@ -38,20 +41,28 @@ predictionio.EventClient Class
38
41
handling concurrent requests (although setting "threads" to 1 will still
39
42
work). The optimal setting depends on your system and application
40
43
requirement.
41
-
44
+
42
45
43
46
predictionio.EngineClient Class
44
47
------------------------------
45
48
46
49
.. autoclass :: EngineClient
47
50
:members:
48
51
52
+
49
53
predictionio.AsyncRequest Class
50
54
------------------------------
51
55
52
56
.. autoclass :: AsyncRequest
53
57
:members:
54
58
59
+ predictionio.FileExporter Class
60
+ -------------------------------
61
+
62
+ .. autoclass :: FileExporter
63
+ :members:
64
+
65
+
55
66
predictionio SDK Usage Notes
56
67
-------------------------
57
68
@@ -94,7 +105,7 @@ retrieve recommendations, then get the result at later time::
94
105
>>> <log the error>
95
106
96
107
97
- Batch Import Data
108
+ Batch Import Data with EventClient
98
109
^^^^^^^^^^^^^^^^^^^^^
99
110
100
111
When you import large amount of data at once, you may also use asynchronous
@@ -121,4 +132,10 @@ Alternatively, you can use blocking requests to import large amount of data, but
121
132
>>> except:
122
133
>>> <log the error>
123
134
135
+ Batch Import Data with FileExporter and "pio import"
136
+ ^^^^^^^^^^^^^^^^^^^^^^^
137
+
138
+ You can use FileExporter to create events and write to a JSON file which can
139
+ be used by "pio import". Pleas see `Importing Data in Batch <http://docs.prediction.io/datacollection/batchimport/ >`_ for more details.
124
140
141
+ Note that this method is much faster than batch import with EventClient.
0 commit comments