Build and Manage Prediction Model | Zoho Creator Help

Build and Manage Prediction Model

Info
AI Models have undergone a major revamp and is now renamed as AI Modeler that lets you build, train, and publish models to be used across your apps. If you've created models prior to this revamp, click here to know more. 

Notes
Note:
AI calls are consumed each time an AI model runs within your Creator application. For the prediction field:
  1. When all predictor fields are filled with the required input, an AI call is triggered to generate the prediction in the target field. This AI call is deducted from the AI calls limit available in your Creator plan.
  2. If any predictor field is modified, either before or after the prediction is displayed in the target field, the model recalculates the result using the updated inputs. This triggers an additional AI call, which is also counted against your AI calls limit.
You can monitor your remaining AI calls limit from the Billing section.


In this page, you will be looking at:

  1. Build Prediction Model

i) Data from Application

ii) Data from CSV File

i) Train Model - To train the custom model

ii) View Model Details - To view details and retrain model if required

iiI) Test Model - To test the model's performance

i) Publish Model - To publish your model for deployment

                       ii) Use Model - To deploy the model in your applications


Prediction models predict future events or outcomes by analyzing different patterns in the past data. Refer the understand prediction model page to learn more.


To set up a prediction model, follow these four steps:

Step 1: Create a prediction model

Step 2: Add training data

Step 3: Verify the model summary, train and test model

Step 4: Publish and use model

Step 1: Create a prediction model

  1. Navigate to Microservices under the DEVELOP section in your Creator homepage. All your microservices will be listed here.
  1. To create a prediction model:
  • If you're creating an AI model for the first time, click the + Create New button in the center of the Microservices page.
  • If you've already created AI models, click the + Create New button in the top-right corner of the Microservices page. All your microservices will be listed here.
  1. Click the Create button in the AI Models card. The AI Models home page contains two model types: Custom models that can be built according to the needs of the user and Ready-To-Use models that can immediately be deployed to their applications. 
    Note: You can create both custom and ready-to-use object detection models. To learn more about the model types, refer here


  1. Click the Prediction card under the Build-Custom Models section in the AI Modeler page.


  1. Enter a Model Name and click Create Model. You'll be taken to the Prediction Modeler, where you can add training data in two ways: from the data in your application or from a CSV file.
    Note: The model name cannot exceed 30 characters in length.

Step 2: Add training data

Training data is the initial dataset that is used by the model to find patterns, make interpretations, and arrive at a prediction. You need to train the model so that it can perceive the input information correctly and make accurate decisions based on the information provided. This ensures that the model performs the way it's intended to. You can feed training data in two ways:

Data from application form

You can select the data stored in your application fields to be fed into the model as the training data. 


  1. Select the Application radio button.
  1. Select the Application Name and Form Name from the given dropdown menus. You can use the search bar in this menu for easier access, then click Next.
  2. Select a base field and appropriate dependent fields, then click Next.



Info
Note: Field types that can be selected as the base and dependent fields are:
  1. You can either opt to include all records or a specific set of records from the data that goes into training your model. Learn more
    Note: You cannot apply criteria for CSV-based prediction models.


Data from CSV File

If you do not have sufficient records in your application, but have your data stored in a file of CSV format, you can use this as training data for your prediction model.


Info
To skip the CSV method and continue setting up the model, click here

  1. Select the CSV radio button.
  1. Upload your training data in CSV format. At this moment, you can remove a file by clicking the cross icon and upload another field if required. 


    Note:

    • Before uploading, verify whether the records in the data columns are complete. If there is any missing data in the CSV file, remove those records or add the necessary data into it, then upload.

    • 4MB is the maximum file size limit for CSV files.

    • For more guidelines, refer here.


    1. Click Next to select the base and dependent columns.
    • Base Column is the column of data that needs to be predicted.
    • Dependent columns are the columns that you want the prediction model to use for the prediction process. 
    1. Select a column from the dropdown menu beneath the Base Column section that needs to be predicted. The selected column will be highlighted. Click Next.
    2. In the dropdown beneath Select Dependent Columns, enter the name of the columns that will influence the prediction of the base column. The selected columns will be highlighted in the table. 
    1. Click Next. The Model Summary page will appear.

    Step 3: Verify the model summary, train and test model

    After adding the training data, you can review the model details such as Model NameBase Field/Column, and Dependent Fields/Columns. If you need to make any modifications, you can go back and do so. Otherwise, you can proceed to train the model. 

    Train Model

    Before you can actually use your prediction model in your application, you have to train it to predict favorable outcomes.


    1. Check the details of your model under the Overview of the Model Summary page. If required, you can modify the Model NameBase Field/Column and Dependent Fields/Columns by going Back
    1. Click Train Model.
      NoteModel training may take some time, so you can either stay on the page and wait, or you can close the page and come back later.


    View and manage model details

    After the training is complete, the user can view the status of the model (trainedfailed, and draft), the model type, the date it was created on and updated on, and other details as mentioned below. 

    Info
    1. When you build a prediction model and exit the page before training it, the model's status will be set to draft.
    2. Model training might fail due to insufficient data or network failure.



    Notes
    Note: In the above image, if you've added training data from CSV file, it'll be shown as Base Column and Dependent Columns instead of Base Field and Dependant Fields.


    Model Details

    Under this section, you can view the current version of your model, trained data count, base field, and dependent fields.


    Version Details

    In this section, you can view the number of versions the model has, what version the model is currently running on, model creation date and its accuracy score. An accuracy score will appear for each trained version. You can retrain your model and use this accuracy score to quickly compare two versions of the same model. 


    Model Deployment

    In this section, you can view the App NameForm Name, and the Field Names in which the model is deployed. You can also filter between different environments to check which environment a model is deployed in.


    Notes
    Note
    1. Click here to learn how to create a new version of your model.
    2. The accuracy score is based on the data used for that model's training. Ensure you take any changes you made between versions into consideration when you compare scores.

    Test Model

    After training, you can test the model's reliability before deploying it in any of your applications. This is optional and ensures that the model analyzes the data patterns correctly and predicts the outcomes with high accuracy.



    1. Click Test Model in the top-right corner of the page that appears after the model is successfully trained. This allows you to test the model's accuracy.
    1. The Test Model popup will appear on the screen. Fill in the necessary field values.
    2. Click Predict Outcome. The predicted value will be displayed on the right side of the popup under Model Output.


    After testing your model, you'll get the predicted outcome along with an accuracy scoreEvaluation of accuracy score

    • 85 - 97 = High
    • 70 - 84 = Good
    • 51 - 69 = Fair
    • < 50 = Low
    Info
    Click here to know how you can improve your model performance.

    Manage Prediction Model

    After you train your model, you need to publish it to make it available for deployment in your applications. Developers and users can now use your prediction model and start making predictions.

    Notes
    Note: You cannot unpublish the model once it has been published.You can still make changes to the model and train it again.

    Retrain model 

    Retraining the model with the added records in your form periodically helps your model attain more precise results. Reworking on the model's efficiency allows the model to be tuned specifically to your business perspective.

    Notes
    Note: 
    1. Because new data is always being generated, we recommend that you periodically re-train your model. This helps in improving the prediction model's reliability and accuracy. 
    2. The retrain option is available only when you add training data via form fields. This is because you can train your model as and when new records are continuously added to your application. 
    3. When adding data via CSV file, you can delete the model, upload a new file, then train the model again.
    4. You cannot delete a model's version that is being currently used. Instead, you can switch versions and then delete that model version.


    1. Click the three-dot ellipsis at the top-right corner of your page.
    2. Click Retrain to train your model again. A new version will be created and listed under Version Details.
      You need not retrain a model every time a record is added. You can either retrain a model periodically or if you feel that there are sufficient new record s available to improve prediction result.
    3. Click Rename to edit your model's name. A popup will appear, where you can edit the model's name and click Rename.
    4. Click Delete.
      Note:
    • Deleting a model that is deployed in any of your applications will remove its deployment in those applications. This action cannot be undone.
    • After deletion, the added fields (model input and output fields) will remain in the form in which the respective model is deployed. All the past data from the prediction model will remain as long as the respective fields are not deleted from the form.
    • You cannot delete a model's version that is currently being used. Instead, you can switch versions and then delete that model version.

    Step 4: Publish and use model

    After you train and test your model, you can publish it to make it available to your users and start making predictions.


    1. Click Publish Model in the top-right corner.
    2. Click Publish in the Publish popup that appears.
    3. After publishing, select the Application Name and Form Name from the dropdown list in the Use Model popup that appears and click Use Model. 
    4. Alternatively, you can click Use Model at the top-right corner of your page and repeat step 3.
    5. The user will be redirected to the form builder of the application they have selected to have the model deployed in. The Prediction popup will appear with the Model Input screen opens. Confirm the name of the prediction field and its field type, then click NEXT.


    Note

    • The field name cannot exceed 30 characters in length.
    • The trained and chosen model will already be selected in the Select Model section.
    • You can change the field type in the Model Input section. For example, if you'd chosen the field type as number, you can change the type as decimalcurrency, or percentage.
    • If you've uploaded training data that contains binary outcomes such as yes/notrue/false, you cannot edit the data type and it will be disabled.

    1. Choose the corresponding field names in the form for the dependent fields from the dropdown menus provided.

      Note

      • Add the relevant fields along with the correct field type in the form before mapping them here. 
      • If none of the supported and relevant field types are available in the form, you will need to first create them in order to deploy the prediction model. 
    2. Click ADD FIELD. The field mapping is now complete and a new prediction field is added to the selected form. 

    You can now access your app in live and add values in the dependent fields. The prediction field will predict a value accordingly.