write.ml {SparkR}R Documentation

Save the Bernoulli naive Bayes model to the input path.

Description

Save the Bernoulli naive Bayes model to the input path.

Save the AFT survival regression model to the input path.

Save the generalized linear model to the input path.

Save the k-means model to the input path.

Usage

write.ml(object, path, ...)

## S4 method for signature 'NaiveBayesModel,character'
write.ml(object, path,
  overwrite = FALSE)

## S4 method for signature 'AFTSurvivalRegressionModel,character'
write.ml(object, path,
  overwrite = FALSE)

## S4 method for signature 'GeneralizedLinearRegressionModel,character'
write.ml(object, path,
  overwrite = FALSE)

## S4 method for signature 'KMeansModel,character'
write.ml(object, path, overwrite = FALSE)

Arguments

object

A fitted Bernoulli naive Bayes model

path

The directory where the model is saved

overwrite

Overwrites or not if the output path already exists. Default is FALSE which means throw exception if the output path exists.

object

A fitted AFT survival regression model

path

The directory where the model is saved

overwrite

Overwrites or not if the output path already exists. Default is FALSE which means throw exception if the output path exists.

object

A fitted generalized linear model

path

The directory where the model is saved

overwrite

Overwrites or not if the output path already exists. Default is FALSE which means throw exception if the output path exists.

object

A fitted k-means model

path

The directory where the model is saved

overwrite

Overwrites or not if the output path already exists. Default is FALSE which means throw exception if the output path exists.

Examples

## Not run: 
##D df <- createDataFrame(sqlContext, infert)
##D model <- spark.naiveBayes(df, education ~ ., laplace = 0)
##D path <- "path/to/model"
##D write.ml(model, path)
## End(Not run)
## Not run: 
##D model <- spark.survreg(trainingData, Surv(futime, fustat) ~ ecog_ps + rx)
##D path <- "path/to/model"
##D write.ml(model, path)
## End(Not run)
## Not run: 
##D model <- glm(y ~ x, trainingData)
##D path <- "path/to/model"
##D write.ml(model, path)
## End(Not run)
## Not run: 
##D model <- spark.kmeans(trainingData, ~ ., k = 2)
##D path <- "path/to/model"
##D write.ml(model, path)
## End(Not run)

[Package SparkR version 2.0.0 Index]