Machine Learning con Python: costruire algoritmi per generare conoscenza (Italian Edition) by Sebastian Raschka

Machine Learning con Python: costruire algoritmi per generare conoscenza (Italian Edition) by Sebastian Raschka

Author:Sebastian Raschka [Raschka, Sebastian]
Language: ita
Format: azw3, epub
ISBN: 9788850317912
Publisher: Feltrinelli Editore
Published: 2017-09-30T04:00:00+00:00


Parameters

----------

X : {array-like, sparse matrix},

Shape = [n_samples, n_features]

Matrix of training samples.

Returns

----------

maj_vote : array-like, shape = [n_samples]

Predicted class labels.

"""

if self.vote == 'probability':

maj_vote = np.argmax(self.predict_proba(X),

axis=1)

else: # 'classlabel' vote

# Collect results from clf.predict calls

predictions = np.asarray([clf.predict(X)

for clf in

self.classifiers_]).T

maj_vote = np.apply_along_axis(

lambda x:

np.argmax(np.bincount(x,

weights=self.weights)),

axis=1,

arr=predictions)

maj_vote = self.lablenc_.inverse_transform(maj_vote)

return maj_vote



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.