This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
on 07-17-201911:11 AM - edited on 07-17-201901:05 PM by SydneyF
Alteryx Designer comes with tools (based on both R and Python) to create and use predictive models without needing to write any code. But what if you've got custom models written in R or Python outside of Designer that you want to use in Designer, or vice versa?
For Python, use pickle or joblib to move the model in and out of Python. Here's an example that fits a decision tree model to the iris dataset and dumps the model to disk as a joblib file:
from ayx import Package
from ayx import Alteryx
from sklearn import tree
from joblib import dump
train = Alteryx.read("#1")
clf = tree.DecisionTreeClassifier()
y_train = train.pop('Species').values
clf = clf.fit(train, y_train)