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

Missing dependencies in .R files? #12

Closed
isabelgiang opened this issue Nov 29, 2018 · 1 comment
Closed

Missing dependencies in .R files? #12

isabelgiang opened this issue Nov 29, 2018 · 1 comment

Comments

@isabelgiang
Copy link

Hello,

I am having problems running some of the algorithms because they seem to expect me to have certain variables or methods loaded that I do not have.

For example, for DecisionTree.R:

library(rpart)
x <- cbind(x_train,y_train)
# grow tree 
fit <- rpart(y_train ~ ., data = x,method="class")
summary(fit)
# Predict Output 
predicted= predict(fit,x_test)

When I attempt to run this script in RStudio, I get the following errors:

Error in cbind(x_train, y_train) : object 'x_train' not found
> # grow tree 
> fit <- rpart(y_train ~ ., data = x,method="class")
Error in is.data.frame(data) : object 'x' not found
> summary(fit)
Error in object[[i]] : object of type 'closure' is not subsettable
> # Predict Output 
> predicted= predict(fit,x_test)
Error in UseMethod("predict") : 
  no applicable method for 'predict' applied to an object of class "function"
> predicted= predict(fit,x_test)
Error in UseMethod("predict") : 
  no applicable method for 'predict' applied to an object of class "function"

Are there other R files or packages that the user is expected to have installed, aside from the packages already included?

I am using a fresh RStudio install (version 1.1.463) on Ubuntu 16.04 with R version 3.2.3.

@Eurus-Holmes
Copy link
Member

@hollowsunsets oh, sure, I'm sorry for not indicating the source of the relevant dataset. The DecisionTree.R is only about the implement thought of the DecisionTree Algorithm by R, and you can find the dataset for testing on your own by google, such as: http://archive.ics.uci.edu/ml/datasets/Bank+Marketing

good luck~

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

No branches or pull requests

2 participants