Update Training data from remote source every 30 minutes
Retrain the predictive model on the updated training data after every update
To learn more about creating reducers and making custom reducers, please read the reducers documentation and simple model creation guide.
Terrene supports the requests
python package, assuming you have an API endpoint that returns new training data, you can create a reducer with the following code:
import pandasimport requests​content = pandas.read_content(content) # to read the existing data inside the reudcer​res = requests.get("https://my-api-endpoint").json()new_data = pandas.DataFrame(res["data"])​# save the new data by adding to old datacontent = content.append(new_data)
Click on New Pipeline on the left menu to create a new pipeline.
Once navigated to the pipeline page, on the right hand side under Insert a New Block section:
Select your training data TFrame
Select the reducer you created in step 1
Set the context to "{}" (empty context, for more information view the reducers documentation)
Click on Insert Task
Now insert another block by doing the following:
Select your predictive model
Select Train Model as your resource action
Select your training data TFrame
For model trainer, select the first one that is suggested to you
Click on Insert Task
Now to test your pipeline, click on Run Pipeline on the bottom menu to make sure it is working.