Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in evaluating the argument 'x' in selecting a method for function 'colSums': 'NA' indices are not (yet?) supported for sparse Matrices #64

Closed
javiercoh opened this issue May 11, 2021 · 4 comments
Assignees
Labels

Comments

@javiercoh
Copy link

javiercoh commented May 11, 2021

The following code:

`df<-read.csv("df1.csv")

colnames(df) <- c("customer_id", "customer_size", "sku_nbr", "avg_ROS", "sku_id", "sku_amount", "sku_qty", "category_id", "city_id", "channel_id", "sector_id", "top_skus", "avg_sku_ros")

dataset <- as(split(df[,"sku_id"], df[,"customer_id"]), "transactions")

category <- df%>% select(sku_id, category_id) %>% distinct()

itemInfo(dataset) <- data.frame(labels = category$sku_id, category_id = category$category_id)

dataset <- addAggregate(dataset, "category_id")

rules <- apriori(dataset, parameter = list(support=0.15, conf=.3, minlen=2, maxlen=15))    

rules <- subset(rules, subset=lift>1)

rules <- filterAggregate(rules)

`

throws:

error in evaluating the argument 'x' in selecting a method for function 'colSums': 'NA' indices are not (yet?) supported for sparse Matrices
at
rules <- filterAggregate(rules)
Repo here

Is this an issue with filterAggregate?

@mhahsler
Copy link
Owner

I cannot run your code since I do not have dataframe1.

@javiercoh
Copy link
Author

I cannot run your code since I do not have dataframe1.

Sorry, just updated the code replacing dataframe1 with df

@mhahsler mhahsler added the bug label May 13, 2021
@mhahsler mhahsler self-assigned this May 13, 2021
@mhahsler
Copy link
Owner

mhahsler commented May 13, 2021

Hi, I have confirmed the bug. I have fixed it in the version on GitHub and a fixed version will be released on CRAN soon. Thank you for helping to improve arules by reporting bugs.

Regards,
-MFH

@javiercoh
Copy link
Author

Hi, I have confirmed the bug. I have fixed it in the version on GitHub and a fixed version will be released on CRAN soon. Thank you for helping to improve arules by reporting bugs.

Regards,
-MFH

thank you for this amazing library!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants