Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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)
Comment

PREVIOUS NEXT
Code Example
Python :: python error catching of modules 
Python :: slice in iloc 
Python :: seeparate string without split function python 
Python :: Cget subassembly civid3d 
Python :: c Pythagorean triples 
Python :: obspy stats 
Python :: python discover methods of object/module 
Python :: django form is onvalid 
Python :: python filter dictionary 
Python :: Finding the Sum of a Symmetrical Sub-List 
Python :: pyqt5 udp example 
Python :: convert float to booelan 
Python :: Minimum Number of Operations to Move All Balls to Each Box in python used in function method 
Python :: Freqtrade - Informative Pairs 
Python :: not mutable data type in python 
Python :: Find & set values in pandas Dataframe 
Python :: line to curve dynamo revit 
Python :: how to serial print line break 
Python :: insert in a sorted list python 
Python :: what does << do in python 
Python :: recursionerror maximum recursion depth exceeded in comparison 
Python :: save python plot 
Python :: how to make dice roll in python 
Python :: change value in dataframe 
Python :: python add column with constant value 
Python :: return key from value dictionary python 
Python :: rename folder python 
Python :: jupyter notebook set password 
Python :: get chrome version with python 
Python :: how to read a excel file in python 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =