Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[MINOR][DOCS] Replace DataFrame with Dataset in Javadoc.
  • Loading branch information
dongjoon-hyun committed Mar 12, 2016
commit 80418efcd6c55fd9ce4a22862872d6b06a8df96d
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* <h2>ML attributes</h2>
*
* The ML pipeline API uses {@link org.apache.spark.sql.DataFrame}s as ML datasets.
* The ML pipeline API uses {@link org.apache.spark.sql.Dataset}s as ML datasets.
* Each dataset consists of typed columns, e.g., string, double, vector, etc.
* However, knowing only the column type may not be sufficient to handle the data properly.
* For instance, a double column with values 0.0, 1.0, 2.0, ... may represent some label indices,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* The `ml.feature` package provides common feature transformers that help convert raw data or
* features into more suitable forms for model fitting.
* Most feature transformers are implemented as {@link org.apache.spark.ml.Transformer}s, which
* transforms one {@link org.apache.spark.sql.DataFrame} into another, e.g.,
* transforms one {@link org.apache.spark.sql.Dataset} into another, e.g.,
* {@link org.apache.spark.ml.feature.HashingTF}.
* Some feature transformers are implemented as {@link org.apache.spark.ml.Estimator}}s, because the
* transformation requires some aggregated information of the dataset, e.g., document
Expand All @@ -31,7 +31,7 @@
* obtain the model first, e.g., {@link org.apache.spark.ml.feature.IDFModel}, in order to apply
* transformation.
* The transformation is usually done by appending new columns to the input
* {@link org.apache.spark.sql.DataFrame}, so all input columns are carried over.
* {@link org.apache.spark.sql.Dataset}, so all input columns are carried over.
*
* We try to make each transformer minimal, so it becomes flexible to assemble feature
* transformation pipelines.
Expand All @@ -46,7 +46,7 @@
* import org.apache.spark.api.java.JavaRDD;
* import static org.apache.spark.sql.types.DataTypes.*;
* import org.apache.spark.sql.types.StructType;
* import org.apache.spark.sql.DataFrame;
* import org.apache.spark.sql.Dataset;
* import org.apache.spark.sql.RowFactory;
* import org.apache.spark.sql.Row;
*
Expand All @@ -66,7 +66,7 @@
* RowFactory.create(0, "Hi I heard about Spark", 3.0),
* RowFactory.create(1, "I wish Java could use case classes", 4.0),
* RowFactory.create(2, "Logistic regression models are neat", 4.0)));
* DataFrame df = jsql.createDataFrame(rowRDD, schema);
* Dataset<Row> dataset = jsql.createDataFrame(rowRDD, schema);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor thing, we usually use ds instead of dataset to name a temporary Dataset in example code. But it's OK here.

* // define feature transformers
* RegexTokenizer tok = new RegexTokenizer()
* .setInputCol("text")
Expand All @@ -88,10 +88,10 @@
* // assemble and fit the feature transformation pipeline
* Pipeline pipeline = new Pipeline()
* .setStages(new PipelineStage[] {tok, sw, tf, idf, assembler});
* PipelineModel model = pipeline.fit(df);
* PipelineModel model = pipeline.fit(dataset);
*
* // save transformed features with raw data
* model.transform(df)
* model.transform(dataset)
* .select("id", "text", "rating", "features")
* .write().format("parquet").save("/output/path");
* </code>
Expand Down