Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save dianachua/16f93f874740abc2cb30be1b557037fc to your computer and use it in GitHub Desktop.

Select an option

Save dianachua/16f93f874740abc2cb30be1b557037fc to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": "## <span style=\"color:darkgreen\">IBM Watson AutoAI - Generated Scikit-learn Notebook v1.14.4</span>\n\nConsider these tips for working with an auto-generated notebook:\n- Notebook code generated using AutoAI will execute successfully. If you modify the notebook, we cannot guarantee it will run successfully.\n- This pipeline is optimized for the original data set. The pipeline might fail or produce sub-optimum results if used with different data. If you want to use a different data set, consider retraining the AutoAI experiment to generate a new pipeline. For more information, see <a href=\"https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/autoai-notebook.html\">Cloud Platform</a> \n- Before modifying the pipeline or trying to re-fit the pipeline, consider that the code converts dataframes to numpy arrays before fitting the pipeline (a current restriction of the preprocessor pipeline).\n"
},
{
"cell_type": "markdown",
"metadata": {},
"source": "<a id=\"content\"></a>\n## Notebook content\n\nThis notebook contains a Scikit-learn representation of AutoAI pipeline. This notebook introduces commands for getting data, training the model, and testing the model. \n\nSome familiarity with Python is helpful. This notebook uses Python 3.7 and scikit-learn 0.23.1."
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": "## Notebook goals\n\n- Scikit-learn pipeline definition\n- Pipeline training \n- Pipeline evaluation\n\n## Contents\n\nThis notebook contains the following parts:\n\n**[Setup](#setup)** \n&nbsp;&nbsp;[Package installation](#install) \n&nbsp;&nbsp;[AutoAI experiment metadata](#variables_definition) \n**[Pipeline inspection](#inspection)** \n&nbsp;&nbsp;[Read training data](#read) \n&nbsp;&nbsp;[Train and test data split](#split) \n&nbsp;&nbsp;[Make pipeline](#preview_model_to_python_code) \n&nbsp;&nbsp;[Train pipeline model](#train) \n&nbsp;&nbsp;[Test pipeline model](#test_model) \n**[Next steps](#next_steps)** \n**[Copyrights](#copyrights)**"
},
{
"cell_type": "markdown",
"metadata": {},
"source": "<a id=\"setup\"></a>\n# Setup"
},
{
"cell_type": "markdown",
"metadata": {},
"source": "<a id=\"install\"></a>\n## Package installation\nBefore you use the sample code in this notebook, install the following packages:\n - ibm_watson_machine_learning,\n - autoai-libs,\n - xgboost.\n"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-12T14:00:45.009458Z",
"iopub.status.busy": "2020-10-12T14:00:45.007968Z",
"iopub.status.idle": "2020-10-12T14:00:46.037702Z",
"shell.execute_reply": "2020-10-12T14:00:46.038270Z"
},
"pycharm": {
"name": "#%%\n"
},
"scrolled": true
},
"outputs": [],
"source": "!pip install ibm-watson-machine-learning | tail -n 1\n!pip install -U autoai-libs | tail -n 1\n!pip install -U xgboost==0.90 | tail -n 1"
},
{
"cell_type": "markdown",
"metadata": {},
"source": "<a id=\"variables_definition\"></a>\n## AutoAI experiment metadata\nThe following cell contains the training data connection details. \n**Note**: The connection might contain authorization credentials, so be careful when sharing the notebook."
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-12T14:00:49.797633Z",
"iopub.status.busy": "2020-10-12T14:00:49.796778Z",
"iopub.status.idle": "2020-10-12T14:00:57.182715Z",
"shell.execute_reply": "2020-10-12T14:00:57.183132Z"
},
"pycharm": {
"is_executing": true
}
},
"outputs": [],
"source": "# @hidden_cell\nfrom ibm_watson_machine_learning.helpers import DataConnection, S3Connection, S3Location\n\ntraining_data_reference = [DataConnection(\n connection=S3Connection(\n api_key='nQwHSUv247ZP9Hj2_5A8DLlvPNOMHSiNj8lYNfrg1Pvr',\n auth_endpoint='https://iam.bluemix.net/oidc/token/',\n endpoint_url='https://s3-api.us-geo.objectstorage.softlayer.net'\n ),\n location=S3Location(\n bucket='touristshoppingreceiptprediction-donotdelete-pr-6qodnhdcfracmm',\n path='raw1.csv'\n )),\n]\ntraining_result_reference = DataConnection(\n connection=S3Connection(\n api_key='nQwHSUv247ZP9Hj2_5A8DLlvPNOMHSiNj8lYNfrg1Pvr',\n auth_endpoint='https://iam.bluemix.net/oidc/token/',\n endpoint_url='https://s3-api.us-geo.objectstorage.softlayer.net'\n ),\n location=S3Location(\n bucket='touristshoppingreceiptprediction-donotdelete-pr-6qodnhdcfracmm',\n path='auto_ml/77934c6d-a5de-46f7-b616-647eb0506a99/wml_data/e0bd2f69-7657-43a5-9c06-a34e9aa7971c/data/automl',\n model_location='auto_ml/77934c6d-a5de-46f7-b616-647eb0506a99/wml_data/e0bd2f69-7657-43a5-9c06-a34e9aa7971c/data/automl/cognito_output/Pipeline1/model.pickle',\n training_status='auto_ml/77934c6d-a5de-46f7-b616-647eb0506a99/wml_data/e0bd2f69-7657-43a5-9c06-a34e9aa7971c/training-status.json'\n ))"
},
{
"cell_type": "markdown",
"metadata": {},
"source": "Following cell contains input parameters provided to run the AutoAI experiment in Watson Studio."
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-12T14:00:57.187305Z",
"iopub.status.busy": "2020-10-12T14:00:57.186602Z",
"iopub.status.idle": "2020-10-12T14:00:57.188392Z",
"shell.execute_reply": "2020-10-12T14:00:57.188878Z"
},
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": "experiment_metadata = dict(\n prediction_type='regression',\n prediction_column='newtotshop_$',\n test_size=0.15,\n scoring='neg_root_mean_squared_error',\n project_id='02fd04d6-f35a-4388-b993-7e0956d434a5',\n space_id='None',\n deployment_url='https://us-south.ml.cloud.ibm.com',\n csv_separator=',',\n random_state=33,\n max_number_of_estimators=2,\n daub_include_only_estimators=None,\n training_data_reference=training_data_reference,\n training_result_reference=training_result_reference\n)"
},
{
"cell_type": "markdown",
"metadata": {},
"source": "<a id=\"inspection\"></a>\n# Pipeline inspection"
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": "<a id=\"read\"></a>\n## Read training data\n\nRetrieve training dataset from AutoAI experiment as pandas DataFrame."
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-12T14:01:16.076169Z",
"iopub.status.busy": "2020-10-12T14:01:16.075589Z",
"iopub.status.idle": "2020-10-12T14:01:19.190233Z",
"shell.execute_reply": "2020-10-12T14:01:19.190807Z"
},
"pycharm": {
"is_executing": true,
"name": "#%%\n"
}
},
"outputs": [],
"source": "df = training_data_reference[0].read(csv_separator=experiment_metadata['csv_separator'])\ndf.dropna('rows', how='any', subset=[experiment_metadata['prediction_column']], inplace=True)"
},
{
"cell_type": "markdown",
"metadata": {},
"source": "<a id=\"split\"></a>\n## Train and test data split"
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"pycharm": {
"is_executing": true
}
},
"outputs": [],
"source": "from sklearn.model_selection import train_test_split\n\ndf.drop_duplicates(inplace=True)\nX = df.drop([experiment_metadata['prediction_column']], axis=1).values\ny = df[experiment_metadata['prediction_column']].values\n\ntrain_X, test_X, train_y, test_y = train_test_split(X, y, test_size=experiment_metadata['test_size'],\n random_state=experiment_metadata['random_state'])"
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": "<a id=\"preview_model_to_python_code\"></a>\n## Make pipeline\nIn the next cell, you can find the Scikit-learn definition of the selected AutoAI pipeline."
},
{
"cell_type": "markdown",
"metadata": {},
"source": "Import statements."
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"pycharm": {
"is_executing": true,
"name": "#%%\n"
}
},
"outputs": [],
"source": "from autoai_libs.transformers.exportable import NumpyColumnSelector\nfrom autoai_libs.transformers.exportable import CompressStrings\nfrom autoai_libs.transformers.exportable import NumpyReplaceMissingValues\nfrom autoai_libs.transformers.exportable import NumpyReplaceUnknownValues\nfrom autoai_libs.transformers.exportable import boolean2float\nfrom autoai_libs.transformers.exportable import CatImputer\nfrom autoai_libs.transformers.exportable import CatEncoder\nimport numpy as np\nfrom autoai_libs.transformers.exportable import float32_transform\nfrom autoai_libs.cognito.transforms.transform_utils import TGen\nimport autoai_libs.cognito.transforms.transform_extras\nimport autoai_libs.utils.fc_methods\nfrom autoai_libs.cognito.transforms.transform_utils import FS1\nfrom xgboost import XGBRegressor\nfrom sklearn.pipeline import make_pipeline"
},
{
"cell_type": "markdown",
"metadata": {},
"source": "#### Pre-processing & Estimator."
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"pycharm": {
"is_executing": true,
"name": "#%%\n"
}
},
"outputs": [],
"source": "numpy_column_selector = NumpyColumnSelector(\n columns=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]\n)\ncompress_strings = CompressStrings(\n compress_type=\"hash\",\n dtypes_list=[\n \"char_str\",\n \"char_str\",\n \"char_str\",\n \"char_str\",\n \"char_str\",\n \"char_str\",\n \"int_num\",\n \"char_str\",\n \"char_str\",\n \"char_str\",\n \"char_str\",\n \"char_str\",\n \"char_str\",\n \"float_int_num\",\n \"float_int_num\",\n \"float_int_num\",\n ],\n missing_values_reference_list=[\"\", \"-\", \"?\", float(\"nan\")],\n misslist_list=[\n [],\n [],\n [],\n [],\n [],\n [],\n [],\n [],\n [],\n [],\n [],\n [],\n [float(\"nan\")],\n [],\n [],\n [],\n ],\n)\nnumpy_replace_missing_values = NumpyReplaceMissingValues(\n missing_values=[float(\"nan\")], filling_values=float(\"nan\")\n)\nnumpy_replace_unknown_values = NumpyReplaceUnknownValues(\n filling_values=float(\"nan\"),\n filling_values_list=[\n float(\"nan\"),\n float(\"nan\"),\n float(\"nan\"),\n float(\"nan\"),\n float(\"nan\"),\n float(\"nan\"),\n float(\"nan\"),\n float(\"nan\"),\n float(\"nan\"),\n float(\"nan\"),\n float(\"nan\"),\n float(\"nan\"),\n float(\"nan\"),\n 100001,\n 100001,\n 100001,\n ],\n known_values_list=[\n [\n 84816218285819779247241543823994939721,\n 87367869435656093172185409302851943300,\n 173064872767319081501177995548902498213,\n 135074234657709292558452431781240784042,\n 179391738028665831144522843491060847262,\n 36323350239278209168443685680380819004,\n 138952187980534730810199205447463430541,\n 332630845230987589299854778132206089252,\n 33727767878827990336693191026421851864,\n 168158927106934056619317934691209873832,\n 314559949518830183297789325965932220718,\n 271648322277504579578352390056794132852,\n ],\n [\n 167493504306376577968978469397762764650,\n 111289410412470558799003615684649486011,\n 170600393674945060917547922137729489509,\n 154916795763310162180344941551108488953,\n 314367934511105508631143225170993459857,\n 325043178473385788285909671258130833750,\n 40936924124395947817229556087429665158,\n 42690811751994106562560426001976344878,\n 327716205682585220131288430162795946756,\n 89046489025873397063683728629719547254,\n 288208896147708181933553271058610940631,\n 272865226932482267294742820809389075871,\n 239208262758896482363503676247401167621,\n 119082779054300334425788224543224349138,\n 60264351204920133016980602671514523087,\n 93418832550626031277006178804300582857,\n 323867322174749448515109779146099060970,\n 190465332183553797245601178303479543915,\n 283310042396932218485998255180156581913,\n 96512166026717216282797846556416747913,\n 88478868587567689551155212165531427115,\n 280366348962913530979089840251262423541,\n 114033687817805420930002837975431165215,\n 154370027052864566920037538055644431665,\n 249755109349256633780635965774901277263,\n 246796639174060622521055196465395172739,\n 162031026497589966116564241368797637200,\n 310707145908391146392499306892431412297,\n 2701407993686774659199304112588808425,\n 82274959136414328474528474200676145982,\n 7299579746671755769727218013129505367,\n 216217877576313422572335648620219466992,\n 176751514725089924365395679439364193117,\n 235456527875920875119570964349392814,\n 222975457051328041535734930869331550551,\n 312714878601962959833547820632228727102,\n 79429257936617600071111193895167671173,\n 248087438309998925578946353535792073249,\n 306244511633234915500140221609225323253,\n 242966843621928296430417241075400972203,\n 303701385390694506466166406852171989293,\n 128879710490080457898614924596904848625,\n 338785982002251222731276685684778267971,\n 253780288725753472780539118041007094754,\n 51509033271812899042250471826955234613,\n 236134275655655491099921864838137729235,\n 143951630134554233318053873597632379493,\n 214542828805144375523178149468185962492,\n 304289806223741483374733578555537378619,\n 145969632360735600325672912690257029454,\n 175574251067888384238434957387769705140,\n 207754334809977768433812718348872529784,\n 307703532337798988988490526389851160220,\n 198491915795176977481825318117161267104,\n 320815027682266438211932148180401464117,\n 174591404232250975443415184336425500527,\n 219952353668635765411542572552032290904,\n ],\n [\n 270932768419823835904805200005389609342,\n 110269263859156358012418916873557245179,\n 240723493292833491391351721948146548644,\n 90216044824152636129020042972427591257,\n 16010038297388468344177874759482069481,\n ],\n [\n 150871123013590655799813539609218064141,\n 339379189399237762901112457383788030587,\n 246490103989025841773054272028639709988,\n 330443689734773821232753384154326866178,\n 181239631566406539137318665566541544388,\n 259103743900965402550301604779797667133,\n 300114811828244705627658577581491770490,\n 142718665894854050569138457954505172356,\n 324321577478249904227687270017655700159,\n 78724693342009167091950024216535285517,\n 158220168970369188248471345873514261397,\n 79346601295744120297384028010007502125,\n 187456057440385552610136403357567347158,\n 287198268179684725008386277841046163309,\n 44536007100336699408452170126963119542,\n 64704896372729137213735757630788134228,\n 188177842044478473270248970603253049563,\n 85676507731506312147606047472026942719,\n 55887758847199899778982388728157950285,\n 220582124888534468807786464512153866907,\n 110240701072645905412534326182818753061,\n 166305434688665532046438822679677603028,\n 1840482148159210941642425524160420303,\n 166353477269046566805174656251699881806,\n 155806274124554285180049906027358509968,\n 50197725311130625743471853859309311637,\n 116768057959835002413005430414968601923,\n 256624324791541018811687635935130982471,\n 71610968276003444941317453143636820665,\n 36761534588253946806790053655423526720,\n 178924766775027979142448008351418175282,\n 10619138545038273567659341036080802476,\n 320787228851877225455482696492200589645,\n 192429749763879372449389563599710161598,\n 176203863782682954059957789760917768180,\n 286896537416290684788128460601817825458,\n 208180638078862728041704585727264117367,\n 299627077488321703526595166721797308660,\n 53160779515420750293855940693398316725,\n ],\n [\n 78622108181707534067103744401754768587,\n 159872001113832928423894300609149857020,\n 28519917375951581295524067120358947774,\n 29819472364204021281132086343705429547,\n 271311046148360098993243800063652539776,\n 335087839597129210188350849828294292971,\n ],\n [\n 248552393553625911829275175950507086347,\n 196453806044956024215798110170812425269,\n ],\n [0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 15, 30, 60],\n [\n 319923723572615770825817161908422912366,\n 23618912556816291230876072198930504730,\n 105124961946452241889763661874880877667,\n ],\n [\n 243382710732531489693195870365903964183,\n 132302907946296948163998721551176913917,\n ],\n [\n 328068068452570228932187979110344517008,\n 291925722782978713364614204634969141621,\n 180375715597170250198112086685534299340,\n 44847405210647449354568808421498898082,\n 97862194896351590517748256463477168450,\n 174250714395818455831819010617142891664,\n 130946444949518067823534643797415365976,\n 65185719236458433292893004012720483685,\n 95504725924408608830949761168993559922,\n 85745285086288732451657855640850863008,\n 277858879624756597381704479412853426130,\n 326661061374373185892543585874572058679,\n 102854582993106861777418112956934552345,\n ],\n [\n 185826926570363735397752415684864055700,\n 174722717214380616745194357364796673178,\n 190925974960783696962013752518321636191,\n 285623727922651133072500102904867789834,\n 271384284063689245998976371869010639815,\n 150947885448816410364346153037041439218,\n 51686865547983436177592539905651331999,\n 223022109111262584570581705635815251031,\n 52923352433276873805764720035882250187,\n 220528792586726595380572606550906659538,\n 186998563549669437393505228270864970457,\n 134471241918036041520508870901282864704,\n 79058578451328433103674832086135590629,\n ],\n [\n 1190864012282226582474684486284097693,\n 225998850908294121744028037636063308889,\n 98081324495087292327386360179873745310,\n 244611784054448458516579420367796959909,\n 217754123399495173476223686691700000575,\n 196929485831609587987482670485217973650,\n 137985822167868212901927154344320881949,\n 81546443592123897035037108590097774643,\n 13090318562005755994035810532287122655,\n 290974449313319882211825385813853532363,\n 110240701072645905412534326182818753061,\n 307027925922754450589137496902058340607,\n 256884963358357072832687186353248826443,\n 125732322786452715373459216467867725720,\n 159902013884676862530850674759624542017,\n ],\n [\n 53190294865766414226598290342356703276,\n 120023811289246080768856470055144074140,\n 153080718993418324366537478057926784438,\n 251974663257722075672852501635628149737,\n 299306794328839659667175906647377929030,\n 307609415645814577720818350674697549570,\n 220014677765019377120054048954724688215,\n 209694078308241213403429642727049196868,\n 238912235584632240661368634674156268274,\n ],\n [0.0, 1.0],\n [0.0, 1.0],\n [0.0, 1.0],\n ],\n missing_values_reference_list=[\"\", \"-\", \"?\", float(\"nan\")],\n)\ncat_imputer = CatImputer(\n strategy=\"most_frequent\",\n missing_values=float(\"nan\"),\n sklearn_version_family=\"23\",\n)\ncat_encoder = CatEncoder(\n encoding=\"ordinal\",\n categories=\"auto\",\n dtype=np.float64,\n handle_unknown=\"error\",\n sklearn_version_family=\"23\",\n)\nt_gen = TGen(\n fun=autoai_libs.cognito.transforms.transform_extras.NXOR,\n name=\"nxor\",\n arg_count=2,\n datatypes_list=[[\"numeric\"], [\"numeric\"]],\n feat_constraints_list=[\n [autoai_libs.utils.fc_methods.is_not_categorical],\n [autoai_libs.utils.fc_methods.is_not_categorical],\n ],\n col_names=[\n \"R.mth\",\n \"City_residence\",\n \"Purpose_grp\",\n \"Purpose\",\n \"langint\",\n \"1st_visit\",\n \"length_stay\",\n \"travel_type\",\n \"f1_gender\",\n \"f3_occupation\",\n \"MainAccomm\",\n \"travel_companion.1\",\n \"Terminal\",\n \"TravelThruAir\",\n \"TravelThruLand\",\n \"TravelThruSea\",\n ],\n col_dtypes=[\n np.dtype(\"float32\"),\n np.dtype(\"float32\"),\n np.dtype(\"float32\"),\n np.dtype(\"float32\"),\n np.dtype(\"float32\"),\n np.dtype(\"float32\"),\n np.dtype(\"float32\"),\n np.dtype(\"float32\"),\n np.dtype(\"float32\"),\n np.dtype(\"float32\"),\n np.dtype(\"float32\"),\n np.dtype(\"float32\"),\n np.dtype(\"float32\"),\n np.dtype(\"float32\"),\n np.dtype(\"float32\"),\n np.dtype(\"float32\"),\n ],\n)\nfs1 = FS1(\n cols_ids_must_keep=range(0, 16),\n additional_col_count_to_keep=15,\n ptype=\"regression\",\n)\nxgb_regressor = XGBRegressor(\n gamma=0.24554284017369413,\n learning_rate=0.024373932275964363,\n max_depth=4,\n min_child_weight=12,\n n_estimators=445,\n n_jobs=2,\n objective=\"reg:squarederror\",\n random_state=33,\n reg_alpha=0.4731032441066666,\n reg_lambda=0.3548282973751361,\n silent=True,\n subsample=0.5931089666573431,\n verbosity=0,\n)\n"
},
{
"cell_type": "markdown",
"metadata": {},
"source": "Pipeline."
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"pycharm": {
"is_executing": true,
"name": "#%%\n"
}
},
"outputs": [],
"source": "pipeline = make_pipeline(\n numpy_column_selector,\n compress_strings,\n numpy_replace_missing_values,\n numpy_replace_unknown_values,\n boolean2float(),\n cat_imputer,\n cat_encoder,\n float32_transform(),\n t_gen,\n fs1,\n xgb_regressor,\n)"
},
{
"cell_type": "markdown",
"metadata": {},
"source": "<a id=\"train\"></a>\n## Train pipeline model\n"
},
{
"cell_type": "markdown",
"metadata": {},
"source": "### Define scorer from the optimization metric\nThis cell constructs the cell scorer based on the experiment metadata."
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"pycharm": {
"is_executing": true
}
},
"outputs": [],
"source": "from sklearn.metrics import get_scorer\n\nscorer = get_scorer(experiment_metadata['scoring'])"
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": "<a id=\"test_model\"></a>\n### Fit pipeline model\nIn this cell, the pipeline is fitted."
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-12T14:01:19.291734Z",
"iopub.status.busy": "2020-10-12T14:01:19.244735Z",
"iopub.status.idle": "2020-10-12T14:01:19.338461Z",
"shell.execute_reply": "2020-10-12T14:01:19.338958Z"
},
"pycharm": {
"is_executing": true,
"name": "#%%\n"
},
"scrolled": true
},
"outputs": [],
"source": "pipeline.fit(train_X,train_y)"
},
{
"cell_type": "markdown",
"metadata": {},
"source": "<a id=\"test_model\"></a>\n## Test pipeline model"
},
{
"cell_type": "markdown",
"metadata": {},
"source": "Score the fitted pipeline with the generated scorer using the holdout dataset."
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-12T14:02:03.910267Z",
"iopub.status.busy": "2020-10-12T14:02:03.909710Z",
"iopub.status.idle": "2020-10-12T14:02:03.914154Z",
"shell.execute_reply": "2020-10-12T14:02:03.914727Z"
},
"pycharm": {
"is_executing": true,
"name": "#%%\n"
}
},
"outputs": [],
"source": "score = scorer(pipeline, test_X, test_y)\nprint(score)"
},
{
"cell_type": "markdown",
"metadata": {},
"source": "<a id=\"next_steps\"></a>\n# Next steps\n\n#### [Model deployment as webservice](https://github.com/IBM/watson-machine-learning-samples/tree/master/cloud/notebooks/python_sdk/deployments/autoai)\n#### [Run AutoAI experiment with python SDK](https://github.com/IBM/watson-machine-learning-samples/tree/master/cloud/notebooks/python_sdk/experiments/autoai) "
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": "<a id=\"copyrights\"></a>\n### Copyrights\n\nLicensed Materials - Copyright \u00a9 2020 IBM. This notebook and its source code are released under the terms of the ILAN License.\nUse, duplication disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n\n**Note:** The auto-generated notebooks are subject to the International License Agreement for Non-Warranted Programs \n(or equivalent) and License Information document for Watson Studio Auto-generated Notebook (License Terms), \nsuch agreements located in the link below. Specifically, the Source Components and Sample Materials clause \nincluded in the License Information document for Watson Studio Auto-generated Notebook applies to the auto-generated notebooks. \n\nBy downloading, copying, accessing, or otherwise using the materials, you agree to the <a href=\"http://www14.software.ibm.com/cgi-bin/weblap/lap.pl?li_formnum=L-AMCU-BHU2B7&title=IBM%20Watson%20Studio%20Auto-generated%20Notebook%20V2.1\">License Terms</a> \n\n___"
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment