You are on page 1of 4

Apriori in Python – Step 2.) Train


Apriori Model
with NO COMMENTS

Training the Apriori Model

Since we have to Apyori library installed, it is super easy to train an Apriori Model.

We are going to import Apriori from Apyori.

The Apriori comes with function that allow users to train a model easily with parameters.

Users can set the min support, min confidence, min lift and min length at parameter section of the
function

# Import the libraries


import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

# Import Dataset 
dataset = pd.read_csv(‘apriori_data2.csv’, header = None)
records = [] for i in range(0, 11):
records.append([str(dataset.values[i,j]) for j in range(0, 10)])

# Train Apriori Model
from apyori import apriori
rules = apriori(records, min_support = 0.003, min_confidence = 0.2, min_lift = 3,
min_length = 2)

Other Sections on Apriori :


Step 1.) Import Libraries and Import Dataset 
Shares
Step 2.) Train a Apriori Model

Step 3.) Visualize Apriori Results 

Other Topics – Multivariate Analysis : 


PCA

LDA

Other Topics – Association Rule : 


Apriori

Eclat

Other Topics – Arti cal Inteligent : 


Multi Armed Bandit Problem

Upper Confidence Bound

Thompson Sampling

 Uncategorized

Previous Post Next Post

Leave a Reply

Shares
Comment

Name *

Email (will not be published) *

Website

Submit Comment

 Search

_______

Lets Start with Python

Topics with Python

How to Install Python on Mac and PC

Data Handling in Python

Regression in Python

Multivariate Analysis in Python

Classification in Python
Shares
Association Rule Learning in Python

Simple Artificial Intelligent in Python

Deep Learning in Python

_______

Lets Start with R

Topics with R

How to install R

Data Handling in R Studio

Regression in R Studio

Multivariate Analysis in R Studio

Classification in R Studio

Association Rule Learning in R Studio

Simple Artificial Intelligent in R Studio

Deep Learning in R Studio

STEPHACKING

COPYRIGHT (C) 2016-2017 • ALL RIGHTS RESERVED

© 2018 STEPHACKING

Shares

You might also like