<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Learn and Predict Scripts :: Delta BI Documentation (EN source)</title>
    <link>/mainclient/apps/model/model-pro/data-flow/scripting/learn-and-predict/index.html</link>
    <description>Learn and Predict Scripts Learn and predict algorithms can be saved to produce machine learning (ML) models. The ML model can then be saved, set as a target, and downloaded. This powerful tool is then used to make predictions based on your data set. For instance, you might want to know the likelihood of a purchase based on a set of criteria about a customer, say, their age, address, and income.</description>
    <generator>Hugo</generator>
    <language>en</language>
    <atom:link href="/mainclient/apps/model/model-pro/data-flow/scripting/learn-and-predict/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Python Learn and Predict Examples</title>
      <link>/mainclient/apps/model/model-pro/data-flow/scripting/learn-and-predict-example/index.html</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/mainclient/apps/model/model-pro/data-flow/scripting/learn-and-predict-example/index.html</guid>
      <description>Python Learn and Predict Examples This article reviews examples of the Python learn and predict functionality. To learn more about Python learn and predict, click here.&#xA;In the following example, an SVM script is used to predict the purchase of bikes based on a customer’s income and number of children.&#xA;import pandas from sklearn import svm __pyramidOutput=0 def pyramid_learn(df): X = df.iloc[:,0:2] y= df.iloc[:,2] clf = svm.SVC(gamma=0.001, C=1.0) clf.fit(X, y) return clf def pyramid_eval(model, df): X = df.iloc[:,0:2] y = df.iloc[:,2] output = model.predict(X) correctCount=0 for idx,item in enumerate(output): if item == y.iloc[idx]: correctCount+=1 return str(correctCount / len(y)) def pyramid_predict(model, df): X = df.iloc[:,0:2] output = model.predict(X) return pandas.DataFrame({&#39;Prediction&#39;:output}) Learn In the learn function, X = the first 2 columns given as the input, and Y = the last column given as the output.</description>
    </item>
  </channel>
</rss>