Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

label binarizer

>>> from sklearn import preprocessing
>>> lb = preprocessing.LabelBinarizer()
>>> lb.fit([1, 2, 6, 4, 2])
LabelBinarizer()
>>> lb.classes_
array([1, 2, 4, 6])
>>> lb.transform([1, 6])
array([[1, 0, 0, 0],
       [0, 0, 0, 1]])
Comment

PREVIOUS NEXT
Code Example
Python :: python loop to a tuple 
Python :: circular dependencies in python 
Python :: remove python 2.7 centos 7 
Python :: get n largest values from 2D numpy array matrix 
Python :: Convert a Pandas Column of Timestamps to Datetimes 
Python :: find index of value in list python 
Python :: python all but the last element 
Python :: python strip() 
Python :: python TypeError: function takes positional arguments but were given 
Python :: standard noramlization 
Python :: py array contains 
Python :: python reverse dictionary 
Python :: python split string by specific word 
Python :: add vertical line in plot python 
Python :: iterate array python with index 
Python :: anonymous function python 
Python :: api testing python 
Python :: upload file setup django url 
Python :: delete file in django terminal 
Python :: what is django python 
Python :: Example of break, continue and pass statements in python 
Python :: how to do more than or less than as a condition in pythonb 
Python :: reaction role discord.py 
Python :: child class in python 
Python :: map vs apply pandas 
Python :: e in python 
Python :: print list of list line by line python 
Python :: python minimum 
Python :: pyautogui 
Python :: download gzip file python 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =