Code Monkey home page Code Monkey logo

Comments (3)

srah99 avatar srah99 commented on June 14, 2024

I found this error doing an assignment that I could not finish because of it. I made a file to help but seem to confuse working on the package to wanting to install the package.

from arules.

srah99 avatar srah99 commented on June 14, 2024

#would this work?

Install the devtools package if you haven't already

install.packages("devtools")

Fork the arules repository on GitHub and clone it to your local machine

Make modifications to the arules source code to handle multiple items on the RHS

Build and install the modified arules package

devtools::install("<path_to_your_local_arules_clone>")

Load the modified arules package

library(arules)

Function to perform rule induction with multiple items on RHS

ruleInduction <- function(data, min_support, min_confidence, rhs_items) {

Convert data to transactions

transactions <- read.transactions(data, format = "basket", sep = ",", cols = c("TransactionID", "Items"))

Mine association rules with modified apriori function

rules <- apriori(transactions, parameter = list(support = min_support, confidence = min_confidence), rhs_items = rhs_items)

Print the modified rules

print(rules)
}

Example usage

data <- "TransactionID,Items
1,A, B, C
2,A, B
3,B, C
4,A, C
5,B"

min_support <- 0.2
min_confidence <- 0.7
rhs_items <- c("B", "C")

Call the function

ruleInduction(data, min_support, min_confidence, rhs_items)

from arules.

mhahsler avatar mhahsler commented on June 14, 2024

Do you have an implementation of rule induction with multiple items in the RHS?

from arules.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.