f8055dc9c5fc07aaf80c0f0994cf3fe70cb082a6,ml_munging_functions.py,MultiColBinarize,transform,#MultiColBinarize#Any#,40

Before Change


	def transform(self, X):
		 iterate through the input columns, binarizing each 
		self.cols_list = list(self.X.columns)
		encoder = LabelBinarizer()	
		self.binarized_cols = encoder.fit_transform(self.X[self.cols_list.pop(0)])
		self.classes_ = list(encoder.classes_)
		for i in self.cols_list:
			encoder = LabelBinarizer()
			binarized_col = encoder.fit_transform(self.X[i])

After Change


		self.X = X
		self.binarized_cols = self.binarizers[0].transform(self.X[self.cols_list[0]])
		self.classes_ = list(self.binarizers[0].classes_)
		for i in range(1,len(self.cols_list)):
			binarized_col = self.binarizers[i].transform(self.X[self.cols_list[i]])
			self.binarized_cols = np.concatenate((self.binarized_cols , binarized_col), axis = 1)
			self.classes_.extend(list(self.binarizers[i].classes_))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: CNuge/kaggle-code
Commit Name: f8055dc9c5fc07aaf80c0f0994cf3fe70cb082a6
Time: 2017-09-12
Author: nugentc@uoguelph.ca
File Name: ml_munging_functions.py
Class Name: MultiColBinarize
Method Name: transform


Project Name: alfredfrancis/ai-chatbot-framework
Commit Name: d3d75272141f7dfabcddb743d42c0c6d367e5f4d
Time: 2018-04-22
Author: alfredfranciz@gmail.com
File Name: app/nlu/intent_classifer.py
Class Name: IntentClassifier
Method Name: train


Project Name: inspirehep/magpie
Commit Name: 7b881943c322c1a98eaab359b3ee9b148c9c3268
Time: 2015-12-16
Author: jan.stypka@cern.ch
File Name: magpie/base/global_index.py
Class Name: GlobalFrequencyIndex
Method Name: __init__