Naive Bayes Model | BYOM | Teradata Vantage - Naive Bayes Model - Teradata Vantage

Teradata Vantageā„¢ - Bring Your Own Model User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Teradata Vantage
Release Number
5.0
Published
October 2023
Language
English (United States)
Last Update
2024-04-06
dita:mapPath
fee1607120608274.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
fee1607120608274

This Python pipeline creates a PMML Naive Bayes model. The scikit-learn function load_iris loads the dataset into an object.

from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import GaussianNB
from sklearn2pmml import sklearn2pmml
from sklearn2pmml.pipeline import PMMLPipeline
 
pmml_pipeline=PMMLPipeline([("classifier",GaussianNB())])
iris=load_iris()
pmml_pipeline.fit(iris.data,iris.target)
sklearn2pmml(pmml_pipeline,"../sql/iris_db_naive_bayes_model.pmml",with_repr=True)