-
Notifications
You must be signed in to change notification settings - Fork 19
/
31-3 UBER Ludwig model training
1 lines (1 loc) · 1.17 KB
/
31-3 UBER Ludwig model training
1
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"31-3 UBER Ludwig model training ","provenance":[],"collapsed_sections":[],"authorship_tag":"ABX9TyOr3IQ5ueGjI2FTc0oLbAjs"},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"code","metadata":{"id":"LZNJ7r7Lf6fR"},"source":["# UBER Ludwig model training\n","# author: Gressling, T\n","# license: MIT License # code: github.com/gressling/examples\n","# activity: single example # index: 31-3 "],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"fL_qTFisgAr9"},"source":["from ludwig import LudwigModel\n","import pandas as pd"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"J6urTU3bgPnC"},"source":["df = pd.read_csv('molecules.dat')\n","model_definition = {\n"," 'input_features':[\n"," {'name':'text', 'type':'SMILES'},\n"," ],\n"," 'output_features': [\n"," {'name': 'REAC_toxicity', 'type': 'category'}\n"," ]\n","}"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"Pbhk1xqWgRKr"},"source":["model = LudwigModel(model_definition)\n","train_stats = model.train(df)\n","model.close()"],"execution_count":null,"outputs":[]}]}