@@ -748,10 +748,10 @@ setMethod("predict", signature(object = "KMeansModel"),
748748# ' sparkR.session()
749749# ' # binary logistic regression
750750# ' label <- c(0.0, 0.0, 0.0, 1.0, 1.0)
751- # ' feature <- c(1.1419053, 0.9194079, -0.9498666, -1.1069903, 0.2809776)
752- # ' binary_data <- as.data.frame(cbind(label, feature ))
751+ # ' features <- c(1.1419053, 0.9194079, -0.9498666, -1.1069903, 0.2809776)
752+ # ' binary_data <- as.data.frame(cbind(label, features ))
753753# ' binary_df <- createDataFrame(binary_data)
754- # ' blr_model <- spark.logit(binary_df, label ~ feature , thresholds = 1.0)
754+ # ' blr_model <- spark.logit(binary_df, label ~ features , thresholds = 1.0)
755755# ' blr_predict <- collect(select(predict(blr_model, binary_df), "prediction"))
756756# '
757757# ' # summary of binary logistic regression
@@ -769,11 +769,11 @@ setMethod("predict", signature(object = "KMeansModel"),
769769# ' # multinomial logistic regression
770770# '
771771# ' label <- c(0.0, 1.0, 2.0, 0.0, 0.0)
772- # ' feature1 <- c(4.845940, 5.64480, 7.430381, 6.464263, 5.555667)
773- # ' feature2 <- c(2.941319, 2.614812, 2.162451, 3.339474, 2.970987)
774- # ' feature3 <- c(1.322733, 1.348044, 3.861237, 9.686976, 3.447130)
775- # ' feature4 <- c(1.3246388, 0.5510444, 0.9225810, 1.2147881, 1.6020842)
776- # ' data <- as.data.frame(cbind(label, feature1, feature2, feature3, feature4 ))
772+ # ' features1 <- c(4.845940, 5.64480, 7.430381, 6.464263, 5.555667)
773+ # ' features2 <- c(2.941319, 2.614812, 2.162451, 3.339474, 2.970987)
774+ # ' features3 <- c(1.322733, 1.348044, 3.861237, 9.686976, 3.447130)
775+ # ' features4 <- c(1.3246388, 0.5510444, 0.9225810, 1.2147881, 1.6020842)
776+ # ' data <- as.data.frame(cbind(label, features1, features2, features3, features4 ))
777777# ' df <- createDataFrame(data)
778778# '
779779# ' # Note that summary of multinomial logistic regression is not implemented yet
0 commit comments