Horje
VectorIndexer pyspark Code Example
VectorIndexer pyspark
from pyspark.ml import Pipeline
from pyspark.ml.regression import LinearRegression
from pyspark.ml.feature import VectorIndexer
from pyspark.ml.evaluation import RegressionEvaluator

# Automatically identify categorical features, and index them.
# We specify maxCategories so features with > 4 distinct values are treated as continuous.

featureIndexer = VectorIndexer(inputCol="features", \
                               outputCol="indexedFeatures",\
                               maxCategories=4).fit(transformed)

data = featureIndexer.transform(transformed)




Python

Related
python import Code Example python import Code Example
tuples in python Code Example tuples in python Code Example
removing stop words in python Code Example removing stop words in python Code Example
have python script continuously run in background Code Example have python script continuously run in background Code Example
pylatex multicolumn align Code Example pylatex multicolumn align Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7