Goal

From a predictive model, score a new dataset using the Python SDK

Prerequisites

  • PredicSis.ai Python SDK (pip install predicsis; documentation)
  • A model in PredicSis.ai and a dataset to be scored.

In [1]:
# Load PredicSis.ai SDK
from predicsis import PredicSis

Retrieve the predictive model


In [2]:
prj = PredicSis.project('Outbound Mail Campaign')
mdl = prj.schema('My first model')

Upload dataset to be scored


In [3]:
mdl.upload_files_to_score('datasets_January',
 [
     {
       'name': 'Customers',
       'file': './Outbound Mail Campaign/tobedeployed/Master.csv'
     },
     {
       'name': 'Orders',
       'file': './Outbound Mail Campaign/tobedeployed/Orders.csv'
     },
     {
       'name': 'VisitedPages',
       'file': './Outbound Mail Campaign/tobedeployed/VisitedPages.csv'
     },
     {
       'name': 'Email',
       'file': './Outbound Mail Campaign/tobedeployed/Email.csv'
     },

 ])

Scoring the uploaded dataset

Asking to add the user information such as email, first_name and last_name


In [4]:
score = mdl.compute_scores('datasets_January', output_features=['email', 'first_name' ,'last_name'])

In [5]:
score.download_scorefile('./Outbound Mail Campaign/January_scores.csv')

In [ ]: