Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

What is StringIndexer , VectorIndexer, and how to use them?

Dataset<Row> dataFrame = ... ;   
StringIndexerModel labelIndexer = new StringIndexer()
               .setInputCol("label")
               .setOutputCol("indexedLabel")
               .fit(dataFrame);

 VectorIndexerModel featureIndexer = new VectorIndexer()
               .setInputCol("s")
               .setOutputCol("indexedFeatures")
               .setMaxCategories(4)
               .fit(dataFrame);
IndexToString labelConverter = new IndexToString()
               .setInputCol("prediction")
               .setOutputCol("predictedLabel")
               .setLabels(labelIndexer.labels());
Comment

PREVIOUS NEXT
Code Example
Python :: point at the middle of a dataframe 
Python :: split one str variable into two str variable using split 
Python :: video in python without cv2 
Python :: add service files in setup.py ROS2 
Python :: menampilkan data dalam range tertentu di python 
Python :: mostFrequentDays python 
Python :: Generators 
Python :: module django contrib admin has no attribute action ACTION_CHECKBOX_NAME 
Python :: add constant to all values of columns in dataframe python 
Python :: cython could not creat pyd file no such file or directory 
Python :: print all elements of dictionary except one in python 
Python :: dbscan clustering of latitudes and longitudes 
Python :: django get without exception 
Python :: nlp generate parse tree in python 
Python :: how to crack a 4 way handshake with python 
Python :: islink(node1 node2) is used for 
Python :: how to load multiple list of dictionary values which is stored in python file and load into another python file in python over loop 
Python :: access matrix value opencv 
Python :: fix certain parameters during curve fit python lambda 
Python :: python hash md5 unicode 
Python :: dd-mm-yy to yyyy-mm-dd in python 
Python :: aiml python install 
Python :: multiprocessing module in python 
Python :: scipy get frequencies of image 
Python :: python tokenize sentence italian spacy 
Python :: hi guys 
Python :: mechanize python #5 
Python :: pandas get only entries that match list 
Python :: ENUM AS STRING GODOT 
Python :: # swap variables 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =