Git Product home page Git Product logo

discriminer's People

Contributors

gastonstat avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

discriminer's Issues

Error in linDA() when priors specified and validation = "crossval"

There is an error in linDA() when priors are specified and validation = "crossval" is specified.

set.seed(1)
num_class <- length(unique(iris$Species))
# Works
DiscriMiner::linDA(variables = iris[1:4], group = iris$Species, prior = rep(1/num_class, num_class))
# Error
DiscriMiner::linDA(variables = iris[1:4], group = iris$Species, prior = rep(1/num_class, num_class), validation = "crossval")
# Error: object 'props' not found

In looking at the source code for linDA() the problem seems to be that in the validation == "crossval" section of the code it references the object props (line 154), but if priors are specified (lines 101-111) the object props is not created, unlike if prior is no specified (lines 111-115). I did some testing and adding
props = prior at line 111 seems to resolve the issue. See my pull request to resolve the issue.

Problem with installation

The commands written in the installation section didn't work:

  • Package has been removed from CRAN
  • install_github('DiscriMiner', username='gastonstat') gave an error "Invalid git repo specification: 'DiscriMiner'"

The command that did work was:

install_github('gastonstat/DiscriMiner')

On R 4.2.3 with devtools 2.4.5

plsDA throws error (sometimes)

set.seed(3)
data(Sonar)
data = Sonar
class.col = 61
trainIds = sample(seq_row(data), size=0.66*nrow(data))
model = plsDA(variables=data[trainIds,-class.col], group=data[trainIds,class.col])
#Error in Wh[, i] : incorrect number of dimensions.

Depending on the seed it sometimes also works without problems.

Error message with plsDA

Dear Gaston,

I'm trying to use the function "plsDA" of your package, using the following command :
model <- plsDA(data[,-1],data[, 1],autosel = TRUE, cv = "LKO", k=10)
where the first column of "data" contains the groups (two groups).
But I get the following error message :
Error in if (sum(w.dif^2) < 1e-06 || iter == 100) break :
missing value where TRUE/FALSE needed

Could you help me to find out what the problem is ?

Kind regards,
Arnaud.

How to explain the Q2 result of plsDA?

Hi,
When I run the following example code in DiscriMiner package:
data(iris)
my_pls1 = plsDA(iris[,1:4], iris$Species, autosel=FALSE, comps=2)

The Q2 output is below:
my_pls1$Q2
Q2.setosa Q2.versicolor Q2.virginica Q2.global
t1 0.8594805 0.03936045 0.5009850 0.46660863
t2 0.2133430 0.16897758 0.1028906 -0.01269048

  1. Could you please tell me how to explain the result?
  2. The value of Q2.global for t2 is -0.01269048, what's the meaning?
    Best regards!
    Bo

Error in linDA, quaDA, geoDA, plsDA when specifying only one predictor

When I try to fit a model using only one variable I receive an error message. This happens for linDA, quaDA, geoDA, plsDA.

set.seed(1)
DiscriMiner::linDA(variables = iris[1], group = iris$Species)
# Error in matrix(0, ng, ncol(X)) : non-numeric matrix extent

DiscriMiner::quaDA(variables = iris[1], group = iris$Species)
# Error in matrix(0, ng, ncol(X)) : non-numeric matrix extent

DiscriMiner::geoDA(variables = iris[1], group = iris$Species)
# Error in matrix(0, ng, ncol(X)) : non-numeric matrix extent

DiscriMiner::plsDA(variables = iris[1], group = iris$Species, autosel = F, comps = 2)
# Error in if (nc == n) nc = n - 1 : argument is of length zero

geoDA with "learntest" validation buggy

In geoDA.R, lines 99-102:

    if (any(learn) <= 0 || any(learn) > n)
      stop("\nsubscript out of bounds in 'learn' set")
    if (any(test) <= 0 || any(test) > n)
      stop("\nsubscript out of bounds in 'test' set")

It should be any(learn <= 0) || any(learn > n) and similarly any(test <= 0) || any(test > n). The parentheses are wrong.

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.