Displaying 4 results from an estimated 4 matches for "y_test".
Did you mean:
my_test
2023 May 09
1
RandomForest tuning the parameters
...gt; > x2=as.factor(x2)
> >
> > X=data.frame(x1,x2)
> > y=y
> >
> > #Split data into training and test sets
> > index=createDataPartition(y, p=0.75, list=FALSE)
> > X_train = X[index, ]
> > X_test = X[-index, ]
> > y_train= y[index ]
> > y_test = y[-index ]
> >
> > #Train de model
> > regr=randomForest (x=X_train, y=y_train, maxnodes=10, ntree=10)
> >
> > regr<-randomForest(y~x1+x2, data=X_train, proximity=TRUE)
> > regr
> >
> > #Make prediction
> > predictions= predict(regr, X_test...
2023 May 08
1
RandomForest tuning the parameters
...0,1,0,0,1,0,0,0,1,1,0,1,0,0,0,1,1,1,1,0,1,0,1,0,0,1,1,0,0,1,0,0,1,1)
?
y=as.numeric(y)
x1=as.numeric(x1)
x2=as.factor(x2)
?
X=data.frame(x1,x2)
y=y
?
#Split data into training and test sets
index=createDataPartition(y, p=0.75, list=FALSE)
X_train = X[index, ]
X_test = X[-index, ]
y_train= y[index ]
y_test = y[-index ]
?
#Train de model
regr=randomForest (x=X_train, y=y_train, maxnodes=10, ntree=10)
regr<-randomForest(y~x1+x2, data=X_train, proximity=TRUE)
regr
?
#Make prediction
predictions= predict(regr, X_test)
?
result= X_test
result['y'] = y_test
result['prediction'] = predic...
2009 Mar 23
0
Scaled MPSE as a test for regressors?
...is really more a stats question than a R one, but....
Does anyone have any familiarity with using the mean prediction
squared error scaled by the variance of the response, as a 'scale
free' criterion for evaluating different regression algorithms.
E.g.
Generate X_train, Y_train, X_test, Y_test from true f. X_test/Y_test
are generated without noise, maybe?
Use X_train, Y_train and the algorithm to make \hat{f}
Look at var(Y_test - \hat{f}(X_test))/var(Y_test)
(Some of these var maybe should be replaced with mean squared values instead.)
It seems sort of reasonable to me. You get a nu...
2009 Mar 04
0
Error in -class : invalid argument to unary operator
...ine<- read.csv("C:\\Rproject\\Wine\\wine.csv")
split<-sample(nrow(wine), floor(nrow(wine) * 0.5))
wine_training <- wine[split, ]
wine_testing <- iris[-split, ]
naive_bayes <-naiveBayes(class~.,data=wine_training)
x_testing <- subset(wine_testing, select = -class)
y_testing <- wine_testing$class # just grab Species variable of
iris_training
pred <- predict(naive_bayes, x_testing)
tab<-table(pred, y_testing)
ca <- classAgreement(tab)
print(tab)
print(ca)
when I enter this code in I get the error
Error in -class : invalid argument to unary opera...