Displaying 4 results from an estimated 4 matches for "train_data".
2012 Nov 20
1
Removing columns that are na or constant
...function(.col){
all(is.na(.col)) || all(.col[1L] == .col)
})
dataset <- dataset[!same]
This works GREAT (thanks to the r-users list archive I found this)
however, then when I do my data sampling like so:
testSize <- floor(nrow(x) * 10/100)
test <- sample(1:nrow(x), testSize)
train_data <- x[-test,]
test_data <- x[test, -1]
test_class <- x[test, 1]
It is now possible that test_data or train_data contain columns that are constants, however as one dataset they did not.
So the solution for me is to just re-run lines to remove all constants......not a problem, but is this n...
2009 Oct 23
1
Data format for KSVM
Hi,
I have a process using svm from the e1071 library. it works.
I want to try using the KSVM library instead. The same data used wiht
e1071 gives me an error with KSVM.
My data is a data.frame.
sample code:
svm_formula <- formula(y ~ a + B + C)
svm_model <- ksvm(formula, data=train_data, type="C-svc",
kernel="rbfdot", C=1)
I get the following error:
"object is not a matrix"
So I tried this:
svm_model <- ksvm(formula, data=as.matrix(train_data), type="C-svc",
kernel="rbfdot", C=1, scaled=FALSE)
Now I get this error:
"...
2009 Aug 02
2
Strange column shifting with read.table
Hi,
I am reading in a dataframe from a CSV file. It has 70 columns. I do
not have any kind of unique "row id".
rawdata <- read.table("r_work/train_data.csv", header=T, sep=",",
na.strings=0)
When training an svm, I keep getting an error
So, as an experiment, I wrote the data back out to a new file so that I
could see what the svm function sees.
write.table(rawdata, file="r_work/output_data.csv", quote=FALSE, sep="...
2012 May 11
3
Calculating all possible ratios
I have a data matrix with genes as columns and samples as rows. I want to
create all possible gene ratios.Is there an elegant and fast way to do it in
R and write it to a dataframe?
Thanks for any help.
Som.
--
View this message in context: http://r.789695.n4.nabble.com/Calculating-all-possible-ratios-tp4627405.html
Sent from the R help mailing list archive at Nabble.com.
[[alternative HTML