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

fastknn for regression #1

Open
hutaohutc opened this issue Apr 9, 2017 · 6 comments
Open

fastknn for regression #1

hutaohutc opened this issue Apr 9, 2017 · 6 comments

Comments

@hutaohutc
Copy link

Hi , I want to ask can this fastknn funcion use for regression?

@davpinto
Copy link
Owner

davpinto commented Apr 9, 2017

I'm sorry but for now, unfortunately, fastknn works only for classification problems. I'm planning to include regression capabilities, but it can take a few weeks or months. Here it follows the to do list:

  • implement the knnExtract() method for feature extraction and dimensionality reduction
  • add an automatic feature ranking procedure to the knnDecision() method
  • implement the knnStack() method to generate metafeatures from the original data that can be used in stacked models
  • implement the knnImpute() method for missing values imputation
  • extend the fastknn() method to work with regression problems

However, some methods like knnDecision() and knnExtract() cannot be extended to deal with regression problems. They require nominal target variables.

@yunxileo
Copy link

when i run : knnDecision(x.tr, y.tr, x.te, y.te, k = 15) . Error in viridisLite::viridis(256, alpha, begin, end, direction, option) : unused argument (option)

@davpinto
Copy link
Owner

davpinto commented Apr 15, 2017

Hi @yunxileo,

I can't reproduce your problem. I need more details about your data. Have you tried the toy example in the documentation?

library(fastknn)

## Load toy data
data("spirals", package = "fastknn")

## Split data for training and test
set.seed(123)
tr.idx <- which(caTools::sample.split(Y = spirals$y, SplitRatio = 0.7))
x.tr   <- spirals$x[tr.idx, ]
x.te   <- spirals$x[-tr.idx, ]
y.tr   <- spirals$y[tr.idx]
y.te   <- spirals$y[-tr.idx]

## Plot decision boundary
knnDecision(x.tr, y.tr, x.te, y.te, k = 15)

Try it and let me know if the problem persists. In addition, check your version of the viridis package. It must be greater than 0.3.4.

@yunxileo
Copy link

I am sorry ,but the problem persists .
my Info:
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
and viridis_0.4.0

@davpinto
Copy link
Owner

Hi @yunxileo,

I'm not able to reproduce this problem on Ubuntu 16.04 x64, so I used devtools::build_win() to submit the package to winbuilder. Again, I'm not able to reproduce your problem. Here is the link to the report: test fastknn on Windows. It will expire in 3 days.

Note that all tests returned without error, including the tests for the knnDecision() method.

Unfortunately, I have no idea about the origin of your problem. Try to reinstall the viridis package.

If there is something else I can do to help you, please ask me! I hope you find a solution.

@yunxileo
Copy link

Actually,after I reinstall the viridisLite package,the knnDecision() works.Thanks a lot for your help!

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

3 participants