Error in Rose Method (class balancing)

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Error in Rose Method (class balancing)

NehaBologna
Hello,


I get the following error when I use the ROSE class balancing method but
when I use other methods like SMOTE, up, down, I do not get any error
message.


Something is wrong; all the ROC metric values are missing:

ROC Sens Spec

Min. : NA Min. : NA Min. : NA

1st Qu.: NA 1st Qu.: NA 1st Qu.: NA

Median : NA Median : NA Median : NA

Mean :NaN Mean :NaN Mean :NaN

3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA

Max. : NA Max. : NA Max. : NA



library(DMwR)

d=readARFF("bughunter.arff")

index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)

tr <- d[index, ]

ts <- d[-index, ]

boot3 <- trainControl(method = "repeatedcv", number=10,
repeats=10,classProbs = TRUE,verboseIter = FALSE,

summaryFunction = twoClassSummary, sampling = "rose")

set.seed(30218)

ct <- train(`Bug class` ~ ., data = tr,

method = "pls",

metric = "AUC",

preProc = c("center", "scale", "nzv"),

trControl = boot3)

getTrainPerf(ct)

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Error in Rose Method (class balancing)

David Winsemius

On 7/22/20 3:43 PM, Neha gupta wrote:

> Hello,
>
>
> I get the following error when I use the ROSE class balancing method but
> when I use other methods like SMOTE, up, down, I do not get any error
> message.
>
>
> Something is wrong; all the ROC metric values are missing:
>
> ROC Sens Spec
>
> Min. : NA Min. : NA Min. : NA
>
> 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
>
> Median : NA Median : NA Median : NA
>
> Mean :NaN Mean :NaN Mean :NaN
>
> 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
>
> Max. : NA Max. : NA Max. : NA
>
>
>
> library(DMwR)
>
> d=readARFF("bughunter.arff")

After installing that package and loading pkg:DMwR I get:


Error in readARFF("bughunter.arff") : could not find function "readARFF"


Since you also posted in HTML, I suggest you read the Posting Guide,
restart and R session and post a reproducible example that loads all
needed packages and data.

--

David.

>
> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>
> tr <- d[index, ]
>
> ts <- d[-index, ]
>
> boot3 <- trainControl(method = "repeatedcv", number=10,
> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>
> summaryFunction = twoClassSummary, sampling = "rose")
>
> set.seed(30218)
>
> ct <- train(`Bug class` ~ ., data = tr,
>
> method = "pls",
>
> metric = "AUC",
>
> preProc = c("center", "scale", "nzv"),
>
> trControl = boot3)
>
> getTrainPerf(ct)
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Error in Rose Method (class balancing)

Rasmus Liland-3
On 2020-07-22 16:08 -0700, David Winsemius wrote:
| On 7/22/20 3:43 PM, Neha gupta wrote:
| | Hello,
| |
| | I get the following error when I use
| | the ROSE class balancing method but
| | when I use other methods like SMOTE,
| | up, down, I do not get any error
| | message.
| |
| | Something is wrong; all the ROC
| | metric values are missing:
| |
| | ROC Sens Spec
| | Min. : NA Min. : NA Min. : NA
| | 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
| | Median : NA Median : NA Median : NA
| | Mean :NaN Mean :NaN Mean :NaN
| | 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
| | Max. : NA Max. : NA Max. : NA
| |
| | library(DMwR)
| | d=readARFF("bughunter.arff")
|
| After installing that package and
| loading pkg:DMwR I get:
|
| Error in readARFF("bughunter.arff") : could not find function "readARFF"

*Psst* ... I think this is
farff::readARFF ... Where is
"bughunter.arff" from?

| | [[alternative HTML version deleted]]
|
| Since you also posted in HTML, I
| suggest you read the Posting Guide,
| restart and R session and post a
| reproducible example that loads all
| needed packages and data.

Hear, hear

| | index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)

Maybe this is
caret::createDataPartition?

| | tr <- d[index, ]
| |
| | ts <- d[-index, ]
| |
| | boot3 <- trainControl(method = "repeatedcv", number=10,
| | repeats=10,classProbs = TRUE,verboseIter = FALSE,

Also caret ... ?caret::trainControl

| | summaryFunction = twoClassSummary, sampling = "rose")

Missing “(” also perhaps other params
have fallen off here ?  The C looks like
a paranthesis because of camel-case
maybe ... hmmm ...

| | set.seed(30218)
| |
| | ct <- train(`Bug class` ~ ., data = tr,
| | method = "pls",
| | metric = "AUC",
| | preProc = c("center", "scale", "nzv"),
| | trControl = boot3)
| |
| | getTrainPerf(ct)
|

V

r

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Error in Rose Method (class balancing)

NehaBologna
In reply to this post by David Winsemius
Hello David, thanks for your reply. I have added the information.

library(caret)
library(farff)
library(DMwR)

d=readARFF("bughunter.arff")
dput( head( d, 30 ) )

index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)

tr <- d[index, ]

ts <- d[-index, ]

boot3 <- trainControl(method = "repeatedcv", number=10,
repeats=10,classProbs = TRUE,verboseIter = FALSE,

summaryFunction = twoClassSummary, sampling = "rose")

set.seed(30218)

ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric = "AUC", preProc
= c("center", "scale", "nzv"), trControl = boot3)

getTrainPerf(ct)

On Thu, Jul 23, 2020 at 1:08 AM David Winsemius <[hidden email]>
wrote:

>
> On 7/22/20 3:43 PM, Neha gupta wrote:
> > Hello,
> >
> >
> > I get the following error when I use the ROSE class balancing method but
> > when I use other methods like SMOTE, up, down, I do not get any error
> > message.
> >
> >
> > Something is wrong; all the ROC metric values are missing:
> >
> > ROC Sens Spec
> >
> > Min. : NA Min. : NA Min. : NA
> >
> > 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
> >
> > Median : NA Median : NA Median : NA
> >
> > Mean :NaN Mean :NaN Mean :NaN
> >
> > 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
> >
> > Max. : NA Max. : NA Max. : NA
> >
> >
> >
> > library(DMwR)
> >
> > d=readARFF("bughunter.arff")
>
> After installing that package and loading pkg:DMwR I get:
>
>
> Error in readARFF("bughunter.arff") : could not find function "readARFF"
>
>
> Since you also posted in HTML, I suggest you read the Posting Guide,
> restart and R session and post a reproducible example that loads all
> needed packages and data.
>
> --
>
> David.
>
> >
> > index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
> >
> > tr <- d[index, ]
> >
> > ts <- d[-index, ]
> >
> > boot3 <- trainControl(method = "repeatedcv", number=10,
> > repeats=10,classProbs = TRUE,verboseIter = FALSE,
> >
> > summaryFunction = twoClassSummary, sampling = "rose")
> >
> > set.seed(30218)
> >
> > ct <- train(`Bug class` ~ ., data = tr,
> >
> > method = "pls",
> >
> > metric = "AUC",
> >
> > preProc = c("center", "scale", "nzv"),
> >
> > trControl = boot3)
> >
> > getTrainPerf(ct)
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Error in Rose Method (class balancing)

David Winsemius

On 7/23/20 7:01 AM, Neha gupta wrote:
>
> library(caret)
> library(farff)
> library(DMwR)
>
> d=readARFF("bughunter.arff")


Error in readARFF("bughunter.arff") :
   Assertion on 'path' failed: File does not exist: 'bughunter.arff'.


I say again:

> I suggest you read the Posting Guide,
> restart and R session and post a reproducible example that loads all
> needed packages and data.

--

David.


> dput( head( d, 30 ) )
>
> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>
> tr <- d[index, ]
>
> ts <- d[-index, ]
>
> boot3 <- trainControl(method = "repeatedcv", number=10,
> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>
> summaryFunction = twoClassSummary, sampling = "rose")
>
> set.seed(30218)
>
> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric =
> "AUC", preProc = c("center", "scale", "nzv"), trControl = boot3)
>
> getTrainPerf(ct)
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Error in Rose Method (class balancing)

NehaBologna
In reply to this post by NehaBologna
Hello David, file not found should be the path problem I guess. I just
forgot the pROC library, which I included here. These are all the libraries
I am using.

library(caret)
library(farff)
library(DMwR)
library(pROC)
library(pls)

setwd("C:/Users/PC/Documents")
d=readARFF("bughunter.arff")
dput( head( d, 30 ) )

index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)

tr <- d[index, ]

ts <- d[-index, ]

boot3 <- trainControl(method = "repeatedcv", number=10,
repeats=10,classProbs = TRUE,verboseIter = FALSE,

summaryFunction = twoClassSummary, sampling = "rose")

set.seed(30218)

ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric = "AUC", preProc
= c("center", "scale", "nzv"), trControl = boot3)

getTrainPerf(ct)


<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, Jul 23, 2020 at 4:01 PM Neha gupta <[hidden email]> wrote:

>
> Hello David, thanks for your reply. I have added the information.
>
> library(caret)
> library(farff)
> library(DMwR)
>
> d=readARFF("bughunter.arff")
> dput( head( d, 30 ) )
>
> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>
> tr <- d[index, ]
>
> ts <- d[-index, ]
>
> boot3 <- trainControl(method = "repeatedcv", number=10,
> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>
> summaryFunction = twoClassSummary, sampling = "rose")
>
> set.seed(30218)
>
> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric = "AUC", preProc
> = c("center", "scale", "nzv"), trControl = boot3)
>
> getTrainPerf(ct)
>
> On Thu, Jul 23, 2020 at 1:08 AM David Winsemius <[hidden email]>
> wrote:
>
>>
>> On 7/22/20 3:43 PM, Neha gupta wrote:
>> > Hello,
>> >
>> >
>> > I get the following error when I use the ROSE class balancing method but
>> > when I use other methods like SMOTE, up, down, I do not get any error
>> > message.
>> >
>> >
>> > Something is wrong; all the ROC metric values are missing:
>> >
>> > ROC Sens Spec
>> >
>> > Min. : NA Min. : NA Min. : NA
>> >
>> > 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
>> >
>> > Median : NA Median : NA Median : NA
>> >
>> > Mean :NaN Mean :NaN Mean :NaN
>> >
>> > 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
>> >
>> > Max. : NA Max. : NA Max. : NA
>> >
>> >
>> >
>> > library(DMwR)
>> >
>> > d=readARFF("bughunter.arff")
>>
>> After installing that package and loading pkg:DMwR I get:
>>
>>
>> Error in readARFF("bughunter.arff") : could not find function "readARFF"
>>
>>
>> Since you also posted in HTML, I suggest you read the Posting Guide,
>> restart and R session and post a reproducible example that loads all
>> needed packages and data.
>>
>> --
>>
>> David.
>>
>> >
>> > index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>> >
>> > tr <- d[index, ]
>> >
>> > ts <- d[-index, ]
>> >
>> > boot3 <- trainControl(method = "repeatedcv", number=10,
>> > repeats=10,classProbs = TRUE,verboseIter = FALSE,
>> >
>> > summaryFunction = twoClassSummary, sampling = "rose")
>> >
>> > set.seed(30218)
>> >
>> > ct <- train(`Bug class` ~ ., data = tr,
>> >
>> > method = "pls",
>> >
>> > metric = "AUC",
>> >
>> > preProc = c("center", "scale", "nzv"),
>> >
>> > trControl = boot3)
>> >
>> > getTrainPerf(ct)
>> >
>> >       [[alternative HTML version deleted]]
>> >
>> > ______________________________________________
>> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> > and provide commented, minimal, self-contained, reproducible code.
>>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Error in Rose Method (class balancing)

Bert Gunter-2
Actually, you are using no libraries. You are using R *packages* .

Don't ask me why the call is library() and not package() -- I'm just
another worker bee.

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Thu, Jul 23, 2020 at 9:35 AM Neha gupta <[hidden email]> wrote:

> Hello David, file not found should be the path problem I guess. I just
> forgot the pROC library, which I included here. These are all the libraries
> I am using.
>
> library(caret)
> library(farff)
> library(DMwR)
> library(pROC)
> library(pls)
>
> setwd("C:/Users/PC/Documents")
> d=readARFF("bughunter.arff")
> dput( head( d, 30 ) )
>
> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>
> tr <- d[index, ]
>
> ts <- d[-index, ]
>
> boot3 <- trainControl(method = "repeatedcv", number=10,
> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>
> summaryFunction = twoClassSummary, sampling = "rose")
>
> set.seed(30218)
>
> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric = "AUC",
> preProc
> = c("center", "scale", "nzv"), trControl = boot3)
>
> getTrainPerf(ct)
>
>
> <
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon
> >
> Virus-free.
> www.avast.com
> <
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link
> >
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> On Thu, Jul 23, 2020 at 4:01 PM Neha gupta <[hidden email]>
> wrote:
>
> >
> > Hello David, thanks for your reply. I have added the information.
> >
> > library(caret)
> > library(farff)
> > library(DMwR)
> >
> > d=readARFF("bughunter.arff")
> > dput( head( d, 30 ) )
> >
> > index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
> >
> > tr <- d[index, ]
> >
> > ts <- d[-index, ]
> >
> > boot3 <- trainControl(method = "repeatedcv", number=10,
> > repeats=10,classProbs = TRUE,verboseIter = FALSE,
> >
> > summaryFunction = twoClassSummary, sampling = "rose")
> >
> > set.seed(30218)
> >
> > ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric = "AUC",
> preProc
> > = c("center", "scale", "nzv"), trControl = boot3)
> >
> > getTrainPerf(ct)
> >
> > On Thu, Jul 23, 2020 at 1:08 AM David Winsemius <[hidden email]>
> > wrote:
> >
> >>
> >> On 7/22/20 3:43 PM, Neha gupta wrote:
> >> > Hello,
> >> >
> >> >
> >> > I get the following error when I use the ROSE class balancing method
> but
> >> > when I use other methods like SMOTE, up, down, I do not get any error
> >> > message.
> >> >
> >> >
> >> > Something is wrong; all the ROC metric values are missing:
> >> >
> >> > ROC Sens Spec
> >> >
> >> > Min. : NA Min. : NA Min. : NA
> >> >
> >> > 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
> >> >
> >> > Median : NA Median : NA Median : NA
> >> >
> >> > Mean :NaN Mean :NaN Mean :NaN
> >> >
> >> > 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
> >> >
> >> > Max. : NA Max. : NA Max. : NA
> >> >
> >> >
> >> >
> >> > library(DMwR)
> >> >
> >> > d=readARFF("bughunter.arff")
> >>
> >> After installing that package and loading pkg:DMwR I get:
> >>
> >>
> >> Error in readARFF("bughunter.arff") : could not find function "readARFF"
> >>
> >>
> >> Since you also posted in HTML, I suggest you read the Posting Guide,
> >> restart and R session and post a reproducible example that loads all
> >> needed packages and data.
> >>
> >> --
> >>
> >> David.
> >>
> >> >
> >> > index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
> >> >
> >> > tr <- d[index, ]
> >> >
> >> > ts <- d[-index, ]
> >> >
> >> > boot3 <- trainControl(method = "repeatedcv", number=10,
> >> > repeats=10,classProbs = TRUE,verboseIter = FALSE,
> >> >
> >> > summaryFunction = twoClassSummary, sampling = "rose")
> >> >
> >> > set.seed(30218)
> >> >
> >> > ct <- train(`Bug class` ~ ., data = tr,
> >> >
> >> > method = "pls",
> >> >
> >> > metric = "AUC",
> >> >
> >> > preProc = c("center", "scale", "nzv"),
> >> >
> >> > trControl = boot3)
> >> >
> >> > getTrainPerf(ct)
> >> >
> >> >       [[alternative HTML version deleted]]
> >> >
> >> > ______________________________________________
> >> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> >> > https://stat.ethz.ch/mailman/listinfo/r-help
> >> > PLEASE do read the posting guide
> >> http://www.R-project.org/posting-guide.html
> >> > and provide commented, minimal, self-contained, reproducible code.
> >>
> >
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Error in Rose Method (class balancing)

Jeff Newmiller
The R Administration and Installation manual explains this nomenclature. OP _is_ typically using two libraries... the one installed with R and the "personal" library which contains the packages installed by the user. You retrieve packages from libraries using library(somepackage)

Of more relevance here is the fact that OP has yet again failed to read the Posting Guide, and appears to have attempted to send a disallowed attachment type through the mailing list and it has been removed from the message. Ordinarily I would recommend trying to use dput() to remove the need for the file, but in this case it may be best for the OP to send a link to the file stored on a file sharing website.

In any event, making the example reproducible is the responsibility of the p person asking the question. I highly recommend reading [1][2] and using [3] to verify that the plain text example actually runs up to the point where the error occurs.

[1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

[2] http://adv-r.had.co.nz/Reproducibility.html

[3] https://cran.r-project.org/web/packages/reprex/index.html (read the vignette)


On July 23, 2020 10:42:55 AM PDT, Bert Gunter <[hidden email]> wrote:

>Actually, you are using no libraries. You are using R *packages* .
>
>Don't ask me why the call is library() and not package() -- I'm just
>another worker bee.
>
>Bert Gunter
>
>"The trouble with having an open mind is that people keep coming along
>and
>sticking things into it."
>-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
>On Thu, Jul 23, 2020 at 9:35 AM Neha gupta <[hidden email]>
>wrote:
>
>> Hello David, file not found should be the path problem I guess. I
>just
>> forgot the pROC library, which I included here. These are all the
>libraries
>> I am using.
>>
>> library(caret)
>> library(farff)
>> library(DMwR)
>> library(pROC)
>> library(pls)
>>
>> setwd("C:/Users/PC/Documents")
>> d=readARFF("bughunter.arff")
>> dput( head( d, 30 ) )
>>
>> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>>
>> tr <- d[index, ]
>>
>> ts <- d[-index, ]
>>
>> boot3 <- trainControl(method = "repeatedcv", number=10,
>> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>>
>> summaryFunction = twoClassSummary, sampling = "rose")
>>
>> set.seed(30218)
>>
>> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric =
>"AUC",
>> preProc
>> = c("center", "scale", "nzv"), trControl = boot3)
>>
>> getTrainPerf(ct)
>>
>>
>> <
>>
>https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon
>> >
>> Virus-free.
>> www.avast.com
>> <
>>
>https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link
>> >
>> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>
>> On Thu, Jul 23, 2020 at 4:01 PM Neha gupta <[hidden email]>
>> wrote:
>>
>> >
>> > Hello David, thanks for your reply. I have added the information.
>> >
>> > library(caret)
>> > library(farff)
>> > library(DMwR)
>> >
>> > d=readARFF("bughunter.arff")
>> > dput( head( d, 30 ) )
>> >
>> > index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>> >
>> > tr <- d[index, ]
>> >
>> > ts <- d[-index, ]
>> >
>> > boot3 <- trainControl(method = "repeatedcv", number=10,
>> > repeats=10,classProbs = TRUE,verboseIter = FALSE,
>> >
>> > summaryFunction = twoClassSummary, sampling = "rose")
>> >
>> > set.seed(30218)
>> >
>> > ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric =
>"AUC",
>> preProc
>> > = c("center", "scale", "nzv"), trControl = boot3)
>> >
>> > getTrainPerf(ct)
>> >
>> > On Thu, Jul 23, 2020 at 1:08 AM David Winsemius
><[hidden email]>
>> > wrote:
>> >
>> >>
>> >> On 7/22/20 3:43 PM, Neha gupta wrote:
>> >> > Hello,
>> >> >
>> >> >
>> >> > I get the following error when I use the ROSE class balancing
>method
>> but
>> >> > when I use other methods like SMOTE, up, down, I do not get any
>error
>> >> > message.
>> >> >
>> >> >
>> >> > Something is wrong; all the ROC metric values are missing:
>> >> >
>> >> > ROC Sens Spec
>> >> >
>> >> > Min. : NA Min. : NA Min. : NA
>> >> >
>> >> > 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
>> >> >
>> >> > Median : NA Median : NA Median : NA
>> >> >
>> >> > Mean :NaN Mean :NaN Mean :NaN
>> >> >
>> >> > 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
>> >> >
>> >> > Max. : NA Max. : NA Max. : NA
>> >> >
>> >> >
>> >> >
>> >> > library(DMwR)
>> >> >
>> >> > d=readARFF("bughunter.arff")
>> >>
>> >> After installing that package and loading pkg:DMwR I get:
>> >>
>> >>
>> >> Error in readARFF("bughunter.arff") : could not find function
>"readARFF"
>> >>
>> >>
>> >> Since you also posted in HTML, I suggest you read the Posting
>Guide,
>> >> restart and R session and post a reproducible example that loads
>all
>> >> needed packages and data.
>> >>
>> >> --
>> >>
>> >> David.
>> >>
>> >> >
>> >> > index <- createDataPartition(d$`Bug class`, p = .70,list =
>FALSE)
>> >> >
>> >> > tr <- d[index, ]
>> >> >
>> >> > ts <- d[-index, ]
>> >> >
>> >> > boot3 <- trainControl(method = "repeatedcv", number=10,
>> >> > repeats=10,classProbs = TRUE,verboseIter = FALSE,
>> >> >
>> >> > summaryFunction = twoClassSummary, sampling = "rose")
>> >> >
>> >> > set.seed(30218)
>> >> >
>> >> > ct <- train(`Bug class` ~ ., data = tr,
>> >> >
>> >> > method = "pls",
>> >> >
>> >> > metric = "AUC",
>> >> >
>> >> > preProc = c("center", "scale", "nzv"),
>> >> >
>> >> > trControl = boot3)
>> >> >
>> >> > getTrainPerf(ct)
>> >> >
>> >> >       [[alternative HTML version deleted]]
>> >> >
>> >> > ______________________________________________
>> >> > [hidden email] mailing list -- To UNSUBSCRIBE and more,
>see
>> >> > https://stat.ethz.ch/mailman/listinfo/r-help
>> >> > PLEASE do read the posting guide
>> >> http://www.R-project.org/posting-guide.html
>> >> > and provide commented, minimal, self-contained, reproducible
>code.
>> >>
>> >
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>[hidden email] mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

--
Sent from my phone. Please excuse my brevity.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Error in Rose Method (class balancing)

David Winsemius
In reply to this post by NehaBologna

On 7/23/20 9:34 AM, Neha gupta wrote:

>
> Hello David, file not found should be the path problem I guess. I just
> forgot the pROC library, which I included here. These are all the
> libraries I am using.
>
> library(caret)
> library(farff)
> library(DMwR)
> library(pROC)
> library(pls)
>
> setwd("C:/Users/PC/Documents")
> d=readARFF("bughunter.arff")


I suppose *you* might have such a file in that directory, but do you
assume that *we* will????

A reproducible example will allow others to run your code. Seems fairly
clear that we are not there yet.

--

David.

> dput( head( d, 30 ) )
>
> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>
> tr <- d[index, ]
>
> ts <- d[-index, ]
>
> boot3 <- trainControl(method = "repeatedcv", number=10,
> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>
> summaryFunction = twoClassSummary, sampling = "rose")
>
> set.seed(30218)
>
> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric =
> "AUC", preProc = c("center", "scale", "nzv"), trControl = boot3)
>
> getTrainPerf(ct)
>
>
>
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
> Virus-free. www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
>
>
>
> On Thu, Jul 23, 2020 at 4:01 PM Neha gupta <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>
>     Hello David, thanks for your reply. I have added the information.
>
>     library(caret)
>     library(farff)
>     library(DMwR)
>
>     d=readARFF("bughunter.arff")
>     dput( head( d, 30 ) )
>
>     index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>
>     tr <- d[index, ]
>
>     ts <- d[-index, ]
>
>     boot3 <- trainControl(method = "repeatedcv", number=10,
>     repeats=10,classProbs = TRUE,verboseIter = FALSE,
>
>     summaryFunction = twoClassSummary, sampling = "rose")
>
>     set.seed(30218)
>
>     ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric =
>     "AUC", preProc = c("center", "scale", "nzv"), trControl = boot3)
>
>     getTrainPerf(ct)
>
>
>     On Thu, Jul 23, 2020 at 1:08 AM David Winsemius
>     <[hidden email] <mailto:[hidden email]>> wrote:
>
>
>         On 7/22/20 3:43 PM, Neha gupta wrote:
>         > Hello,
>         >
>         >
>         > I get the following error when I use the ROSE class
>         balancing method but
>         > when I use other methods like SMOTE, up, down, I do not get
>         any error
>         > message.
>         >
>         >
>         > Something is wrong; all the ROC metric values are missing:
>         >
>         > ROC Sens Spec
>         >
>         > Min. : NA Min. : NA Min. : NA
>         >
>         > 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
>         >
>         > Median : NA Median : NA Median : NA
>         >
>         > Mean :NaN Mean :NaN Mean :NaN
>         >
>         > 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
>         >
>         > Max. : NA Max. : NA Max. : NA
>         >
>         >
>         >
>         > library(DMwR)
>         >
>         > d=readARFF("bughunter.arff")
>
>         After installing that package and loading pkg:DMwR I get:
>
>
>         Error in readARFF("bughunter.arff") : could not find function
>         "readARFF"
>
>
>         Since you also posted in HTML, I suggest you read the Posting
>         Guide,
>         restart and R session and post a reproducible example that
>         loads all
>         needed packages and data.
>
>         --
>
>         David.
>
>         >
>         > index <- createDataPartition(d$`Bug class`, p = .70,list =
>         FALSE)
>         >
>         > tr <- d[index, ]
>         >
>         > ts <- d[-index, ]
>         >
>         > boot3 <- trainControl(method = "repeatedcv", number=10,
>         > repeats=10,classProbs = TRUE,verboseIter = FALSE,
>         >
>         > summaryFunction = twoClassSummary, sampling = "rose")
>         >
>         > set.seed(30218)
>         >
>         > ct <- train(`Bug class` ~ ., data = tr,
>         >
>         > method = "pls",
>         >
>         > metric = "AUC",
>         >
>         > preProc = c("center", "scale", "nzv"),
>         >
>         > trControl = boot3)
>         >
>         > getTrainPerf(ct)
>         >
>         >       [[alternative HTML version deleted]]
>         >
>         > ______________________________________________
>         > [hidden email] <mailto:[hidden email]> mailing
>         list -- To UNSUBSCRIBE and more, see
>         > https://stat.ethz.ch/mailman/listinfo/r-help
>         > PLEASE do read the posting guide
>         http://www.R-project.org/posting-guide.html
>         > and provide commented, minimal, self-contained, reproducible
>         code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Error in Rose Method (class balancing)

NehaBologna
David, I understand that the file will not be in your directory but I have
provided the data using dput? Didn't I? Previously members of this group
have used dput to provide the detail about their data. Seriously, I have no
idea how else I can provide a reproducible example.



<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, Jul 23, 2020 at 10:47 PM David Winsemius <[hidden email]>
wrote:

>
> On 7/23/20 9:34 AM, Neha gupta wrote:
>
>
> Hello David, file not found should be the path problem I guess. I just
> forgot the pROC library, which I included here. These are all the libraries
> I am using.
>
> library(caret)
> library(farff)
> library(DMwR)
> library(pROC)
> library(pls)
>
> setwd("C:/Users/PC/Documents")
> d=readARFF("bughunter.arff")
>
>
> I suppose *you* might have such a file in that directory, but do you
> assume that *we* will????
>
> A reproducible example will allow others to run your code. Seems fairly
> clear that we are not there yet.
>
> --
>
> David.
>
> dput( head( d, 30 ) )
>
> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>
> tr <- d[index, ]
>
> ts <- d[-index, ]
>
> boot3 <- trainControl(method = "repeatedcv", number=10,
> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>
> summaryFunction = twoClassSummary, sampling = "rose")
>
> set.seed(30218)
>
> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric = "AUC", preProc
> = c("center", "scale", "nzv"), trControl = boot3)
>
> getTrainPerf(ct)
>
>
>
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon> Virus-free.
> www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
>
> On Thu, Jul 23, 2020 at 4:01 PM Neha gupta <[hidden email]>
> wrote:
>
>>
>> Hello David, thanks for your reply. I have added the information.
>>
>> library(caret)
>> library(farff)
>> library(DMwR)
>>
>> d=readARFF("bughunter.arff")
>> dput( head( d, 30 ) )
>>
>> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>>
>> tr <- d[index, ]
>>
>> ts <- d[-index, ]
>>
>> boot3 <- trainControl(method = "repeatedcv", number=10,
>> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>>
>> summaryFunction = twoClassSummary, sampling = "rose")
>>
>> set.seed(30218)
>>
>> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric = "AUC", preProc
>> = c("center", "scale", "nzv"), trControl = boot3)
>>
>> getTrainPerf(ct)
>>
>> On Thu, Jul 23, 2020 at 1:08 AM David Winsemius <[hidden email]>
>> wrote:
>>
>>>
>>> On 7/22/20 3:43 PM, Neha gupta wrote:
>>> > Hello,
>>> >
>>> >
>>> > I get the following error when I use the ROSE class balancing method
>>> but
>>> > when I use other methods like SMOTE, up, down, I do not get any error
>>> > message.
>>> >
>>> >
>>> > Something is wrong; all the ROC metric values are missing:
>>> >
>>> > ROC Sens Spec
>>> >
>>> > Min. : NA Min. : NA Min. : NA
>>> >
>>> > 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
>>> >
>>> > Median : NA Median : NA Median : NA
>>> >
>>> > Mean :NaN Mean :NaN Mean :NaN
>>> >
>>> > 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
>>> >
>>> > Max. : NA Max. : NA Max. : NA
>>> >
>>> >
>>> >
>>> > library(DMwR)
>>> >
>>> > d=readARFF("bughunter.arff")
>>>
>>> After installing that package and loading pkg:DMwR I get:
>>>
>>>
>>> Error in readARFF("bughunter.arff") : could not find function "readARFF"
>>>
>>>
>>> Since you also posted in HTML, I suggest you read the Posting Guide,
>>> restart and R session and post a reproducible example that loads all
>>> needed packages and data.
>>>
>>> --
>>>
>>> David.
>>>
>>> >
>>> > index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>>> >
>>> > tr <- d[index, ]
>>> >
>>> > ts <- d[-index, ]
>>> >
>>> > boot3 <- trainControl(method = "repeatedcv", number=10,
>>> > repeats=10,classProbs = TRUE,verboseIter = FALSE,
>>> >
>>> > summaryFunction = twoClassSummary, sampling = "rose")
>>> >
>>> > set.seed(30218)
>>> >
>>> > ct <- train(`Bug class` ~ ., data = tr,
>>> >
>>> > method = "pls",
>>> >
>>> > metric = "AUC",
>>> >
>>> > preProc = c("center", "scale", "nzv"),
>>> >
>>> > trControl = boot3)
>>> >
>>> > getTrainPerf(ct)
>>> >
>>> >       [[alternative HTML version deleted]]
>>> >
>>> > ______________________________________________
>>> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>>> > https://stat.ethz.ch/mailman/listinfo/r-help
>>> > PLEASE do read the posting guide
>>> http://www.R-project.org/posting-guide.html
>>> > and provide commented, minimal, self-contained, reproducible code.
>>>
>>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Error in Rose Method (class balancing)

Jeff Newmiller
All you did was include the dput command in your example. We need the output of dput, not the command itself.

On July 23, 2020 2:43:31 PM PDT, Neha gupta <[hidden email]> wrote:

>David, I understand that the file will not be in your directory but I
>have
>provided the data using dput? Didn't I? Previously members of this
>group
>have used dput to provide the detail about their data. Seriously, I
>have no
>idea how else I can provide a reproducible example.
>
>
>
><https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
>Virus-free.
>www.avast.com
><https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
><#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
>On Thu, Jul 23, 2020 at 10:47 PM David Winsemius
><[hidden email]>
>wrote:
>
>>
>> On 7/23/20 9:34 AM, Neha gupta wrote:
>>
>>
>> Hello David, file not found should be the path problem I guess. I
>just
>> forgot the pROC library, which I included here. These are all the
>libraries
>> I am using.
>>
>> library(caret)
>> library(farff)
>> library(DMwR)
>> library(pROC)
>> library(pls)
>>
>> setwd("C:/Users/PC/Documents")
>> d=readARFF("bughunter.arff")
>>
>>
>> I suppose *you* might have such a file in that directory, but do you
>> assume that *we* will????
>>
>> A reproducible example will allow others to run your code. Seems
>fairly
>> clear that we are not there yet.
>>
>> --
>>
>> David.
>>
>> dput( head( d, 30 ) )
>>
>> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>>
>> tr <- d[index, ]
>>
>> ts <- d[-index, ]
>>
>> boot3 <- trainControl(method = "repeatedcv", number=10,
>> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>>
>> summaryFunction = twoClassSummary, sampling = "rose")
>>
>> set.seed(30218)
>>
>> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric =
>"AUC", preProc
>> = c("center", "scale", "nzv"), trControl = boot3)
>>
>> getTrainPerf(ct)
>>
>>
>>
>>
><https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
>Virus-free.
>> www.avast.com
>>
><https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
>>
>> On Thu, Jul 23, 2020 at 4:01 PM Neha gupta <[hidden email]>
>> wrote:
>>
>>>
>>> Hello David, thanks for your reply. I have added the information.
>>>
>>> library(caret)
>>> library(farff)
>>> library(DMwR)
>>>
>>> d=readARFF("bughunter.arff")
>>> dput( head( d, 30 ) )
>>>
>>> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>>>
>>> tr <- d[index, ]
>>>
>>> ts <- d[-index, ]
>>>
>>> boot3 <- trainControl(method = "repeatedcv", number=10,
>>> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>>>
>>> summaryFunction = twoClassSummary, sampling = "rose")
>>>
>>> set.seed(30218)
>>>
>>> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric =
>"AUC", preProc
>>> = c("center", "scale", "nzv"), trControl = boot3)
>>>
>>> getTrainPerf(ct)
>>>
>>> On Thu, Jul 23, 2020 at 1:08 AM David Winsemius
><[hidden email]>
>>> wrote:
>>>
>>>>
>>>> On 7/22/20 3:43 PM, Neha gupta wrote:
>>>> > Hello,
>>>> >
>>>> >
>>>> > I get the following error when I use the ROSE class balancing
>method
>>>> but
>>>> > when I use other methods like SMOTE, up, down, I do not get any
>error
>>>> > message.
>>>> >
>>>> >
>>>> > Something is wrong; all the ROC metric values are missing:
>>>> >
>>>> > ROC Sens Spec
>>>> >
>>>> > Min. : NA Min. : NA Min. : NA
>>>> >
>>>> > 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
>>>> >
>>>> > Median : NA Median : NA Median : NA
>>>> >
>>>> > Mean :NaN Mean :NaN Mean :NaN
>>>> >
>>>> > 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
>>>> >
>>>> > Max. : NA Max. : NA Max. : NA
>>>> >
>>>> >
>>>> >
>>>> > library(DMwR)
>>>> >
>>>> > d=readARFF("bughunter.arff")
>>>>
>>>> After installing that package and loading pkg:DMwR I get:
>>>>
>>>>
>>>> Error in readARFF("bughunter.arff") : could not find function
>"readARFF"
>>>>
>>>>
>>>> Since you also posted in HTML, I suggest you read the Posting
>Guide,
>>>> restart and R session and post a reproducible example that loads
>all
>>>> needed packages and data.
>>>>
>>>> --
>>>>
>>>> David.
>>>>
>>>> >
>>>> > index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>>>> >
>>>> > tr <- d[index, ]
>>>> >
>>>> > ts <- d[-index, ]
>>>> >
>>>> > boot3 <- trainControl(method = "repeatedcv", number=10,
>>>> > repeats=10,classProbs = TRUE,verboseIter = FALSE,
>>>> >
>>>> > summaryFunction = twoClassSummary, sampling = "rose")
>>>> >
>>>> > set.seed(30218)
>>>> >
>>>> > ct <- train(`Bug class` ~ ., data = tr,
>>>> >
>>>> > method = "pls",
>>>> >
>>>> > metric = "AUC",
>>>> >
>>>> > preProc = c("center", "scale", "nzv"),
>>>> >
>>>> > trControl = boot3)
>>>> >
>>>> > getTrainPerf(ct)
>>>> >
>>>> >       [[alternative HTML version deleted]]
>>>> >
>>>> > ______________________________________________
>>>> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>>>> > https://stat.ethz.ch/mailman/listinfo/r-help
>>>> > PLEASE do read the posting guide
>>>> http://www.R-project.org/posting-guide.html
>>>> > and provide commented, minimal, self-contained, reproducible
>code.
>>>>
>>>
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>[hidden email] mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

--
Sent from my phone. Please excuse my brevity.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Error in Rose Method (class balancing)

NehaBologna
Ohhhh, I am very sorry for that, I have now included

output of dput is: structure(list(unique_id = c("L116", "L117", "L496",
"L9719",
"L9720", "L9721", "L9722", "L9723", "L10200", "L10201", "L10202",
"L10203", "L10204", "L10205", "L10206", "L10705", "L10706", "L10707",
"L10708", "L10709", "L10710", "L10711", "L10712", "L10713", "L10714",
"L10715", "L10716", "L10717", "L10718", "L13486"), McCC = c(6,
40, 115, 12, 14, 1, 56, 17, 1, 22, 24, 3, 59, 67, 11, 30, 1,
16, 1, 18, 4, 4, 1, 44, 1, 18, 40, 54, 1, 23), CLOC = c(0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0), LLOC = c(52, 276, 663, 73, 82, 28, 318,
167, 50, 110, 98, 22, 374, 532, 39, 266, 67, 198, 37, 84, 63,
68, 4, 372, 58, 97, 290, 318, 8, 90), `Number of previous fixes` = c(1,
2, 6, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1,
0, 1, 0, 0, 0, 1, 0, 0), `Number of previous modifications` = c(19,
58, 195, 50, 22, 11, 43, 47, 25, 14, 24, 10, 53, 97, 13, 58,
22, 94, 23, 51, 34, 18, 19, 75, 47, 28, 79, 96, 4, 10), `Number of
committers` = c(3,
3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 1, 3, 2, 2,
1, 2, 2, 2, 2, 3, 1, 1), `Number of developer commits` = c(1843,
1843, 1843, 1300, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843,
1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843,
1843, 1843, 1843, 1843, 1843, 1843, 1843), `Bug class` = structure(c(2L,
2L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("true",
"false"), class = "factor")), row.names = c(NA, 30L), class = "data.frame")

library(caret)
library(farff)
library(DMwR)
library(pROC)
library(pls)

setwd("C:/Users/PC/Documents")
d=readARFF("bughunter.arff")
dput( head( d, 30 ) )

index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)

tr <- d[index, ]

ts <- d[-index, ]

boot3 <- trainControl(method = "repeatedcv", number=10,
repeats=10,classProbs = TRUE,verboseIter = FALSE,

summaryFunction = twoClassSummary, sampling = "rose")

set.seed(30218)

ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric = "AUC", preProc
= c("center", "scale", "nzv"), trControl = boot3)

getTrainPerf(ct)

On Thu, Jul 23, 2020 at 11:50 PM Jeff Newmiller <[hidden email]>
wrote:

> All you did was include the dput command in your example. We need the
> output of dput, not the command itself.
>
> On July 23, 2020 2:43:31 PM PDT, Neha gupta <[hidden email]>
> wrote:
> >David, I understand that the file will not be in your directory but I
> >have
> >provided the data using dput? Didn't I? Previously members of this
> >group
> >have used dput to provide the detail about their data. Seriously, I
> >have no
> >idea how else I can provide a reproducible example.
> >
> >
> >
> ><
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon
> >
> >Virus-free.
> >www.avast.com
> ><
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link
> >
> ><#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> >
> >On Thu, Jul 23, 2020 at 10:47 PM David Winsemius
> ><[hidden email]>
> >wrote:
> >
> >>
> >> On 7/23/20 9:34 AM, Neha gupta wrote:
> >>
> >>
> >> Hello David, file not found should be the path problem I guess. I
> >just
> >> forgot the pROC library, which I included here. These are all the
> >libraries
> >> I am using.
> >>
> >> library(caret)
> >> library(farff)
> >> library(DMwR)
> >> library(pROC)
> >> library(pls)
> >>
> >> setwd("C:/Users/PC/Documents")
> >> d=readARFF("bughunter.arff")
> >>
> >>
> >> I suppose *you* might have such a file in that directory, but do you
> >> assume that *we* will????
> >>
> >> A reproducible example will allow others to run your code. Seems
> >fairly
> >> clear that we are not there yet.
> >>
> >> --
> >>
> >> David.
> >>
> >> dput( head( d, 30 ) )
> >>
> >> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
> >>
> >> tr <- d[index, ]
> >>
> >> ts <- d[-index, ]
> >>
> >> boot3 <- trainControl(method = "repeatedcv", number=10,
> >> repeats=10,classProbs = TRUE,verboseIter = FALSE,
> >>
> >> summaryFunction = twoClassSummary, sampling = "rose")
> >>
> >> set.seed(30218)
> >>
> >> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric =
> >"AUC", preProc
> >> = c("center", "scale", "nzv"), trControl = boot3)
> >>
> >> getTrainPerf(ct)
> >>
> >>
> >>
> >>
> ><
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon
> >
> >Virus-free.
> >> www.avast.com
> >>
> ><
> https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link
> >
> >>
> >> On Thu, Jul 23, 2020 at 4:01 PM Neha gupta <[hidden email]>
> >> wrote:
> >>
> >>>
> >>> Hello David, thanks for your reply. I have added the information.
> >>>
> >>> library(caret)
> >>> library(farff)
> >>> library(DMwR)
> >>>
> >>> d=readARFF("bughunter.arff")
> >>> dput( head( d, 30 ) )
> >>>
> >>> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
> >>>
> >>> tr <- d[index, ]
> >>>
> >>> ts <- d[-index, ]
> >>>
> >>> boot3 <- trainControl(method = "repeatedcv", number=10,
> >>> repeats=10,classProbs = TRUE,verboseIter = FALSE,
> >>>
> >>> summaryFunction = twoClassSummary, sampling = "rose")
> >>>
> >>> set.seed(30218)
> >>>
> >>> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric =
> >"AUC", preProc
> >>> = c("center", "scale", "nzv"), trControl = boot3)
> >>>
> >>> getTrainPerf(ct)
> >>>
> >>> On Thu, Jul 23, 2020 at 1:08 AM David Winsemius
> ><[hidden email]>
> >>> wrote:
> >>>
> >>>>
> >>>> On 7/22/20 3:43 PM, Neha gupta wrote:
> >>>> > Hello,
> >>>> >
> >>>> >
> >>>> > I get the following error when I use the ROSE class balancing
> >method
> >>>> but
> >>>> > when I use other methods like SMOTE, up, down, I do not get any
> >error
> >>>> > message.
> >>>> >
> >>>> >
> >>>> > Something is wrong; all the ROC metric values are missing:
> >>>> >
> >>>> > ROC Sens Spec
> >>>> >
> >>>> > Min. : NA Min. : NA Min. : NA
> >>>> >
> >>>> > 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
> >>>> >
> >>>> > Median : NA Median : NA Median : NA
> >>>> >
> >>>> > Mean :NaN Mean :NaN Mean :NaN
> >>>> >
> >>>> > 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
> >>>> >
> >>>> > Max. : NA Max. : NA Max. : NA
> >>>> >
> >>>> >
> >>>> >
> >>>> > library(DMwR)
> >>>> >
> >>>> > d=readARFF("bughunter.arff")
> >>>>
> >>>> After installing that package and loading pkg:DMwR I get:
> >>>>
> >>>>
> >>>> Error in readARFF("bughunter.arff") : could not find function
> >"readARFF"
> >>>>
> >>>>
> >>>> Since you also posted in HTML, I suggest you read the Posting
> >Guide,
> >>>> restart and R session and post a reproducible example that loads
> >all
> >>>> needed packages and data.
> >>>>
> >>>> --
> >>>>
> >>>> David.
> >>>>
> >>>> >
> >>>> > index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
> >>>> >
> >>>> > tr <- d[index, ]
> >>>> >
> >>>> > ts <- d[-index, ]
> >>>> >
> >>>> > boot3 <- trainControl(method = "repeatedcv", number=10,
> >>>> > repeats=10,classProbs = TRUE,verboseIter = FALSE,
> >>>> >
> >>>> > summaryFunction = twoClassSummary, sampling = "rose")
> >>>> >
> >>>> > set.seed(30218)
> >>>> >
> >>>> > ct <- train(`Bug class` ~ ., data = tr,
> >>>> >
> >>>> > method = "pls",
> >>>> >
> >>>> > metric = "AUC",
> >>>> >
> >>>> > preProc = c("center", "scale", "nzv"),
> >>>> >
> >>>> > trControl = boot3)
> >>>> >
> >>>> > getTrainPerf(ct)
> >>>> >
> >>>> >       [[alternative HTML version deleted]]
> >>>> >
> >>>> > ______________________________________________
> >>>> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> >>>> > https://stat.ethz.ch/mailman/listinfo/r-help
> >>>> > PLEASE do read the posting guide
> >>>> http://www.R-project.org/posting-guide.html
> >>>> > and provide commented, minimal, self-contained, reproducible
> >code.
> >>>>
> >>>
> >
> >       [[alternative HTML version deleted]]
> >
> >______________________________________________
> >[hidden email] mailing list -- To UNSUBSCRIBE and more, see
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide
> >http://www.R-project.org/posting-guide.html
> >and provide commented, minimal, self-contained, reproducible code.
>
> --
> Sent from my phone. Please excuse my brevity.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Error in Rose Method (class balancing)

David Winsemius

On 7/24/20 3:08 AM, Neha gupta wrote:

> Ohhhh, I am very sorry for that, I have now included
>
> output of dput is: structure(list(unique_id = c("L116", "L117",
> "L496", "L9719",
> "L9720", "L9721", "L9722", "L9723", "L10200", "L10201", "L10202",
> "L10203", "L10204", "L10205", "L10206", "L10705", "L10706", "L10707",
> "L10708", "L10709", "L10710", "L10711", "L10712", "L10713", "L10714",
> "L10715", "L10716", "L10717", "L10718", "L13486"), McCC = c(6,
> 40, 115, 12, 14, 1, 56, 17, 1, 22, 24, 3, 59, 67, 11, 30, 1,
> 16, 1, 18, 4, 4, 1, 44, 1, 18, 40, 54, 1, 23), CLOC = c(0, 0,
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, 0), LLOC = c(52, 276, 663, 73, 82, 28, 318,
> 167, 50, 110, 98, 22, 374, 532, 39, 266, 67, 198, 37, 84, 63,
> 68, 4, 372, 58, 97, 290, 318, 8, 90), `Number of previous fixes` = c(1,
> 2, 6, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1,
> 0, 1, 0, 0, 0, 1, 0, 0), `Number of previous modifications` = c(19,
> 58, 195, 50, 22, 11, 43, 47, 25, 14, 24, 10, 53, 97, 13, 58,
> 22, 94, 23, 51, 34, 18, 19, 75, 47, 28, 79, 96, 4, 10), `Number of
> committers` = c(3,
> 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 1, 3, 2, 2,
> 1, 2, 2, 2, 2, 3, 1, 1), `Number of developer commits` = c(1843,
> 1843, 1843, 1300, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843,
> 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843,
> 1843, 1843, 1843, 1843, 1843, 1843, 1843), `Bug class` = structure(c(2L,
> 2L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
> 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("true",
> "false"), class = "factor")), row.names = c(NA, 30L), class =
> "data.frame")


I suggest this pre-processing step:


names(d) <- gsub("\\s", "", names(d) )

# then add `library(ROSE)`


# and rerun. Some packages are not adept at handling non-standard column
names.

--

David

>
> library(caret)
> library(farff)
> library(DMwR)
> library(pROC)
> library(pls)
>
> setwd("C:/Users/PC/Documents")
> d=readARFF("bughunter.arff")
> dput( head( d, 30 ) )
>
> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>
> tr <- d[index, ]
>
> ts <- d[-index, ]
>
> boot3 <- trainControl(method = "repeatedcv", number=10,
> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>
> summaryFunction = twoClassSummary, sampling = "rose")
>
> set.seed(30218)
>
> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric =
> "AUC", preProc = c("center", "scale", "nzv"), trControl = boot3)
>
> getTrainPerf(ct)
>
>
> On Thu, Jul 23, 2020 at 11:50 PM Jeff Newmiller
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     All you did was include the dput command in your example. We need
>     the output of dput, not the command itself.
>
>     On July 23, 2020 2:43:31 PM PDT, Neha gupta
>     <[hidden email] <mailto:[hidden email]>> wrote:
>     >David, I understand that the file will not be in your directory but I
>     >have
>     >provided the data using dput? Didn't I? Previously members of this
>     >group
>     >have used dput to provide the detail about their data. Seriously, I
>     >have no
>     >idea how else I can provide a reproducible example.
>     >
>     >
>     >
>     ><https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
>     >Virus-free.
>     >www.avast.com <
>     ><https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
>     ><#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>     >
>     >On Thu, Jul 23, 2020 at 10:47 PM David Winsemius
>     ><[hidden email] <mailto:[hidden email]>>
>     >wrote:
>     >
>     >>
>     >> On 7/23/20 9:34 AM, Neha gupta wrote:
>     >>
>     >>
>     >> Hello David, file not found should be the path problem I guess. I
>     >just
>     >> forgot the pROC library, which I included here. These are all the
>     >libraries
>     >> I am using.
>     >>
>     >> library(caret)
>     >> library(farff)
>     >> library(DMwR)
>     >> library(pROC)
>     >> library(pls)
>     >>
>     >> setwd("C:/Users/PC/Documents")
>     >> d=readARFF("bughunter.arff")
>     >>
>     >>
>     >> I suppose *you* might have such a file in that directory, but
>     do you
>     >> assume that *we* will????
>     >>
>     >> A reproducible example will allow others to run your code. Seems
>     >fairly
>     >> clear that we are not there yet.
>     >>
>     >> --
>     >>
>     >> David.
>     >>
>     >> dput( head( d, 30 ) )
>     >>
>     >> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>     >>
>     >> tr <- d[index, ]
>     >>
>     >> ts <- d[-index, ]
>     >>
>     >> boot3 <- trainControl(method = "repeatedcv", number=10,
>     >> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>     >>
>     >> summaryFunction = twoClassSummary, sampling = "rose")
>     >>
>     >> set.seed(30218)
>     >>
>     >> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric =
>     >"AUC", preProc
>     >> = c("center", "scale", "nzv"), trControl = boot3)
>     >>
>     >> getTrainPerf(ct)
>     >>
>     >>
>     >>
>     >>
>     ><https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
>     >Virus-free.
>     >> www.avast.com <
>     >>
>     ><https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
>     >>
>     >> On Thu, Jul 23, 2020 at 4:01 PM Neha gupta
>     <[hidden email] <mailto:[hidden email]>>
>     >> wrote:
>     >>
>     >>>
>     >>> Hello David, thanks for your reply. I have added the information.
>     >>>
>     >>> library(caret)
>     >>> library(farff)
>     >>> library(DMwR)
>     >>>
>     >>> d=readARFF("bughunter.arff")
>     >>> dput( head( d, 30 ) )
>     >>>
>     >>> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>     >>>
>     >>> tr <- d[index, ]
>     >>>
>     >>> ts <- d[-index, ]
>     >>>
>     >>> boot3 <- trainControl(method = "repeatedcv", number=10,
>     >>> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>     >>>
>     >>> summaryFunction = twoClassSummary, sampling = "rose")
>     >>>
>     >>> set.seed(30218)
>     >>>
>     >>> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric =
>     >"AUC", preProc
>     >>> = c("center", "scale", "nzv"), trControl = boot3)
>     >>>
>     >>> getTrainPerf(ct)
>     >>>
>     >>> On Thu, Jul 23, 2020 at 1:08 AM David Winsemius
>     ><[hidden email] <mailto:[hidden email]>>
>     >>> wrote:
>     >>>
>     >>>>
>     >>>> On 7/22/20 3:43 PM, Neha gupta wrote:
>     >>>> > Hello,
>     >>>> >
>     >>>> >
>     >>>> > I get the following error when I use the ROSE class balancing
>     >method
>     >>>> but
>     >>>> > when I use other methods like SMOTE, up, down, I do not get any
>     >error
>     >>>> > message.
>     >>>> >
>     >>>> >
>     >>>> > Something is wrong; all the ROC metric values are missing:
>     >>>> >
>     >>>> > ROC Sens Spec
>     >>>> >
>     >>>> > Min. : NA Min. : NA Min. : NA
>     >>>> >
>     >>>> > 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
>     >>>> >
>     >>>> > Median : NA Median : NA Median : NA
>     >>>> >
>     >>>> > Mean :NaN Mean :NaN Mean :NaN
>     >>>> >
>     >>>> > 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
>     >>>> >
>     >>>> > Max. : NA Max. : NA Max. : NA
>     >>>> >
>     >>>> >
>     >>>> >
>     >>>> > library(DMwR)
>     >>>> >
>     >>>> > d=readARFF("bughunter.arff")
>     >>>>
>     >>>> After installing that package and loading pkg:DMwR I get:
>     >>>>
>     >>>>
>     >>>> Error in readARFF("bughunter.arff") : could not find function
>     >"readARFF"
>     >>>>
>     >>>>
>     >>>> Since you also posted in HTML, I suggest you read the Posting
>     >Guide,
>     >>>> restart and R session and post a reproducible example that loads
>     >all
>     >>>> needed packages and data.
>     >>>>
>     >>>> --
>     >>>>
>     >>>> David.
>     >>>>
>     >>>> >
>     >>>> > index <- createDataPartition(d$`Bug class`, p = .70,list =
>     FALSE)
>     >>>> >
>     >>>> > tr <- d[index, ]
>     >>>> >
>     >>>> > ts <- d[-index, ]
>     >>>> >
>     >>>> > boot3 <- trainControl(method = "repeatedcv", number=10,
>     >>>> > repeats=10,classProbs = TRUE,verboseIter = FALSE,
>     >>>> >
>     >>>> > summaryFunction = twoClassSummary, sampling = "rose")
>     >>>> >
>     >>>> > set.seed(30218)
>     >>>> >
>     >>>> > ct <- train(`Bug class` ~ ., data = tr,
>     >>>> >
>     >>>> > method = "pls",
>     >>>> >
>     >>>> > metric = "AUC",
>     >>>> >
>     >>>> > preProc = c("center", "scale", "nzv"),
>     >>>> >
>     >>>> > trControl = boot3)
>     >>>> >
>     >>>> > getTrainPerf(ct)
>     >>>> >
>     >>>> >       [[alternative HTML version deleted]]
>     >>>> >
>     >>>> > ______________________________________________
>     >>>> > [hidden email] <mailto:[hidden email]> mailing
>     list -- To UNSUBSCRIBE and more, see
>     >>>> > https://stat.ethz.ch/mailman/listinfo/r-help
>     >>>> > PLEASE do read the posting guide
>     >>>> http://www.R-project.org/posting-guide.html
>     >>>> > and provide commented, minimal, self-contained, reproducible
>     >code.
>     >>>>
>     >>>
>     >
>     >       [[alternative HTML version deleted]]
>     >
>     >______________________________________________
>     >[hidden email] <mailto:[hidden email]> mailing list
>     -- To UNSUBSCRIBE and more, see
>     >https://stat.ethz.ch/mailman/listinfo/r-help
>     >PLEASE do read the posting guide
>     >http://www.R-project.org/posting-guide.html
>     >and provide commented, minimal, self-contained, reproducible code.
>
>     --
>     Sent from my phone. Please excuse my brevity.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Error in Rose Method (class balancing)

NehaBologna
OK thanks a lot David, I hope it will work for me.

Best regards
Neha

On Saturday, July 25, 2020, David Winsemius <[hidden email]> wrote:

>
> On 7/24/20 3:08 AM, Neha gupta wrote:
>
> Ohhhh, I am very sorry for that, I have now included
>
> output of dput is: structure(list(unique_id = c("L116", "L117", "L496",
> "L9719",
> "L9720", "L9721", "L9722", "L9723", "L10200", "L10201", "L10202",
> "L10203", "L10204", "L10205", "L10206", "L10705", "L10706", "L10707",
> "L10708", "L10709", "L10710", "L10711", "L10712", "L10713", "L10714",
> "L10715", "L10716", "L10717", "L10718", "L13486"), McCC = c(6,
> 40, 115, 12, 14, 1, 56, 17, 1, 22, 24, 3, 59, 67, 11, 30, 1,
> 16, 1, 18, 4, 4, 1, 44, 1, 18, 40, 54, 1, 23), CLOC = c(0, 0,
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> 0, 0, 0, 0, 0, 0, 0), LLOC = c(52, 276, 663, 73, 82, 28, 318,
> 167, 50, 110, 98, 22, 374, 532, 39, 266, 67, 198, 37, 84, 63,
> 68, 4, 372, 58, 97, 290, 318, 8, 90), `Number of previous fixes` = c(1,
> 2, 6, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1,
> 0, 1, 0, 0, 0, 1, 0, 0), `Number of previous modifications` = c(19,
> 58, 195, 50, 22, 11, 43, 47, 25, 14, 24, 10, 53, 97, 13, 58,
> 22, 94, 23, 51, 34, 18, 19, 75, 47, 28, 79, 96, 4, 10), `Number of
> committers` = c(3,
> 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 1, 3, 2, 2,
> 1, 2, 2, 2, 2, 3, 1, 1), `Number of developer commits` = c(1843,
> 1843, 1843, 1300, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843,
> 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843, 1843,
> 1843, 1843, 1843, 1843, 1843, 1843, 1843), `Bug class` = structure(c(2L,
> 2L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
> 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("true",
> "false"), class = "factor")), row.names = c(NA, 30L), class = "data.frame")
>
>
> I suggest this pre-processing step:
>
>
> names(d) <- gsub("\\s", "", names(d) )
>
> # then add `library(ROSE)`
>
>
> # and rerun. Some packages are not adept at handling non-standard column
> names.
>
> --
>
> David
>
>
> library(caret)
> library(farff)
> library(DMwR)
> library(pROC)
> library(pls)
>
> setwd("C:/Users/PC/Documents")
> d=readARFF("bughunter.arff")
> dput( head( d, 30 ) )
>
> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>
> tr <- d[index, ]
>
> ts <- d[-index, ]
>
> boot3 <- trainControl(method = "repeatedcv", number=10,
> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>
> summaryFunction = twoClassSummary, sampling = "rose")
>
> set.seed(30218)
>
> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric = "AUC", preProc
> = c("center", "scale", "nzv"), trControl = boot3)
>
> getTrainPerf(ct)
>
> On Thu, Jul 23, 2020 at 11:50 PM Jeff Newmiller <[hidden email]>
> wrote:
>
>> All you did was include the dput command in your example. We need the
>> output of dput, not the command itself.
>>
>> On July 23, 2020 2:43:31 PM PDT, Neha gupta <[hidden email]>
>> wrote:
>> >David, I understand that the file will not be in your directory but I
>> >have
>> >provided the data using dput? Didn't I? Previously members of this
>> >group
>> >have used dput to provide the detail about their data. Seriously, I
>> >have no
>> >idea how else I can provide a reproducible example.
>> >
>> >
>> >
>> ><https://www.avast.com/sig-email?utm_medium=email&utm_
>> source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
>> >Virus-free.
>> >www.avast.com
>> ><https://www.avast.com/sig-email?utm_medium=email&utm_
>> source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
>> ><#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>> >
>> >On Thu, Jul 23, 2020 at 10:47 PM David Winsemius
>> ><[hidden email]>
>> >wrote:
>> >
>> >>
>> >> On 7/23/20 9:34 AM, Neha gupta wrote:
>> >>
>> >>
>> >> Hello David, file not found should be the path problem I guess. I
>> >just
>> >> forgot the pROC library, which I included here. These are all the
>> >libraries
>> >> I am using.
>> >>
>> >> library(caret)
>> >> library(farff)
>> >> library(DMwR)
>> >> library(pROC)
>> >> library(pls)
>> >>
>> >> setwd("C:/Users/PC/Documents")
>> >> d=readARFF("bughunter.arff")
>> >>
>> >>
>> >> I suppose *you* might have such a file in that directory, but do you
>> >> assume that *we* will????
>> >>
>> >> A reproducible example will allow others to run your code. Seems
>> >fairly
>> >> clear that we are not there yet.
>> >>
>> >> --
>> >>
>> >> David.
>> >>
>> >> dput( head( d, 30 ) )
>> >>
>> >> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>> >>
>> >> tr <- d[index, ]
>> >>
>> >> ts <- d[-index, ]
>> >>
>> >> boot3 <- trainControl(method = "repeatedcv", number=10,
>> >> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>> >>
>> >> summaryFunction = twoClassSummary, sampling = "rose")
>> >>
>> >> set.seed(30218)
>> >>
>> >> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric =
>> >"AUC", preProc
>> >> = c("center", "scale", "nzv"), trControl = boot3)
>> >>
>> >> getTrainPerf(ct)
>> >>
>> >>
>> >>
>> >>
>> ><https://www.avast.com/sig-email?utm_medium=email&utm_
>> source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
>> >Virus-free.
>> >> www.avast.com
>> >>
>> ><https://www.avast.com/sig-email?utm_medium=email&utm_
>> source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
>> >>
>> >> On Thu, Jul 23, 2020 at 4:01 PM Neha gupta <[hidden email]>
>> >> wrote:
>> >>
>> >>>
>> >>> Hello David, thanks for your reply. I have added the information.
>> >>>
>> >>> library(caret)
>> >>> library(farff)
>> >>> library(DMwR)
>> >>>
>> >>> d=readARFF("bughunter.arff")
>> >>> dput( head( d, 30 ) )
>> >>>
>> >>> index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>> >>>
>> >>> tr <- d[index, ]
>> >>>
>> >>> ts <- d[-index, ]
>> >>>
>> >>> boot3 <- trainControl(method = "repeatedcv", number=10,
>> >>> repeats=10,classProbs = TRUE,verboseIter = FALSE,
>> >>>
>> >>> summaryFunction = twoClassSummary, sampling = "rose")
>> >>>
>> >>> set.seed(30218)
>> >>>
>> >>> ct <- train(`Bug class` ~ ., data = tr, method = "pls", metric =
>> >"AUC", preProc
>> >>> = c("center", "scale", "nzv"), trControl = boot3)
>> >>>
>> >>> getTrainPerf(ct)
>> >>>
>> >>> On Thu, Jul 23, 2020 at 1:08 AM David Winsemius
>> ><[hidden email]>
>> >>> wrote:
>> >>>
>> >>>>
>> >>>> On 7/22/20 3:43 PM, Neha gupta wrote:
>> >>>> > Hello,
>> >>>> >
>> >>>> >
>> >>>> > I get the following error when I use the ROSE class balancing
>> >method
>> >>>> but
>> >>>> > when I use other methods like SMOTE, up, down, I do not get any
>> >error
>> >>>> > message.
>> >>>> >
>> >>>> >
>> >>>> > Something is wrong; all the ROC metric values are missing:
>> >>>> >
>> >>>> > ROC Sens Spec
>> >>>> >
>> >>>> > Min. : NA Min. : NA Min. : NA
>> >>>> >
>> >>>> > 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA
>> >>>> >
>> >>>> > Median : NA Median : NA Median : NA
>> >>>> >
>> >>>> > Mean :NaN Mean :NaN Mean :NaN
>> >>>> >
>> >>>> > 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA
>> >>>> >
>> >>>> > Max. : NA Max. : NA Max. : NA
>> >>>> >
>> >>>> >
>> >>>> >
>> >>>> > library(DMwR)
>> >>>> >
>> >>>> > d=readARFF("bughunter.arff")
>> >>>>
>> >>>> After installing that package and loading pkg:DMwR I get:
>> >>>>
>> >>>>
>> >>>> Error in readARFF("bughunter.arff") : could not find function
>> >"readARFF"
>> >>>>
>> >>>>
>> >>>> Since you also posted in HTML, I suggest you read the Posting
>> >Guide,
>> >>>> restart and R session and post a reproducible example that loads
>> >all
>> >>>> needed packages and data.
>> >>>>
>> >>>> --
>> >>>>
>> >>>> David.
>> >>>>
>> >>>> >
>> >>>> > index <- createDataPartition(d$`Bug class`, p = .70,list = FALSE)
>> >>>> >
>> >>>> > tr <- d[index, ]
>> >>>> >
>> >>>> > ts <- d[-index, ]
>> >>>> >
>> >>>> > boot3 <- trainControl(method = "repeatedcv", number=10,
>> >>>> > repeats=10,classProbs = TRUE,verboseIter = FALSE,
>> >>>> >
>> >>>> > summaryFunction = twoClassSummary, sampling = "rose")
>> >>>> >
>> >>>> > set.seed(30218)
>> >>>> >
>> >>>> > ct <- train(`Bug class` ~ ., data = tr,
>> >>>> >
>> >>>> > method = "pls",
>> >>>> >
>> >>>> > metric = "AUC",
>> >>>> >
>> >>>> > preProc = c("center", "scale", "nzv"),
>> >>>> >
>> >>>> > trControl = boot3)
>> >>>> >
>> >>>> > getTrainPerf(ct)
>> >>>> >
>> >>>> >       [[alternative HTML version deleted]]
>> >>>> >
>> >>>> > ______________________________________________
>> >>>> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> >>>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> >>>> > PLEASE do read the posting guide
>> >>>> http://www.R-project.org/posting-guide.html
>> >>>> > and provide commented, minimal, self-contained, reproducible
>> >code.
>> >>>>
>> >>>
>> >
>> >       [[alternative HTML version deleted]]
>> >
>> >______________________________________________
>> >[hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> >https://stat.ethz.ch/mailman/listinfo/r-help
>> >PLEASE do read the posting guide
>> >http://www.R-project.org/posting-guide.html
>> >and provide commented, minimal, self-contained, reproducible code.
>>
>> --
>> Sent from my phone. Please excuse my brevity.
>>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Error in Rose Method (class balancing)

Rasmus Liland-3
In reply to this post by Jeff Newmiller
On 2020-07-23 13:10 -0700, Jeff Newmiller wrote:
>
> I would recommend trying to use dput()
> to remove the need for the file

Awesome!  I've been looking for dput()
for a long time.  Thank you!

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

signature.asc (849 bytes) Download Attachment