Mlxtend (ส่วนขยายการเรียนรู้ของเครื่อง) คือไลบรารี Python ของเครื่องมือที่มีประโยชน์สำหรับงานวิทยาศาสตร์ข้อมูลในแต่ละวัน
เซบาสเตียน ราชกา 2014-2024
หากต้องการติดตั้ง mlxtend เพียงดำเนินการ
pip install mlxtend
หรือคุณสามารถดาวน์โหลดแพ็คเกจด้วยตนเองจาก Python Package Index https://pypi.python.org/pypi/mlxtend คลายซิปมัน นำทางไปยังแพ็คเกจ และใช้คำสั่ง:
python setup.py install
หากคุณใช้ conda เพื่อติดตั้ง mlxtend เพียงแค่ดำเนินการ
conda install -c conda-forge mlxtend
เวอร์ชัน mlxtend บน PyPI อาจจะล้าหลังไปหนึ่งก้าวเสมอ คุณสามารถติดตั้งเวอร์ชันการพัฒนาล่าสุดได้จากที่เก็บ GitHub โดยดำเนินการ
pip install git+git://github.com/rasbt/mlxtend.git#egg=mlxtend
หรือคุณสามารถแยกพื้นที่เก็บข้อมูล GitHub จาก https://github.com/rasbt/mlxtend และติดตั้ง mlxtend จากไดรฟ์ในเครื่องของคุณผ่าน
python setup.py install
import numpy as np
import matplotlib . pyplot as plt
import matplotlib . gridspec as gridspec
import itertools
from sklearn . linear_model import LogisticRegression
from sklearn . svm import SVC
from sklearn . ensemble import RandomForestClassifier
from mlxtend . classifier import EnsembleVoteClassifier
from mlxtend . data import iris_data
from mlxtend . plotting import plot_decision_regions
# Initializing Classifiers
clf1 = LogisticRegression ( random_state = 0 )
clf2 = RandomForestClassifier ( random_state = 0 )
clf3 = SVC ( random_state = 0 , probability = True )
eclf = EnsembleVoteClassifier ( clfs = [ clf1 , clf2 , clf3 ], weights = [ 2 , 1 , 1 ], voting = 'soft' )
# Loading some example data
X , y = iris_data ()
X = X [:,[ 0 , 2 ]]
# Plotting Decision Regions
gs = gridspec . GridSpec ( 2 , 2 )
fig = plt . figure ( figsize = ( 10 , 8 ))
for clf , lab , grd in zip ([ clf1 , clf2 , clf3 , eclf ],
[ 'Logistic Regression' , 'Random Forest' , 'RBF kernel SVM' , 'Ensemble' ],
itertools . product ([ 0 , 1 ], repeat = 2 )):
clf . fit ( X , y )
ax = plt . subplot ( gs [ grd [ 0 ], grd [ 1 ]])
fig = plot_decision_regions ( X = X , y = y , clf = clf , legend = 2 )
plt . title ( lab )
plt . show ()
หากคุณใช้ mlxtend เป็นส่วนหนึ่งของขั้นตอนการทำงานของคุณในสิ่งพิมพ์ทางวิทยาศาสตร์ โปรดพิจารณาอ้างอิงพื้นที่เก็บข้อมูล mlxtend ด้วย DOI ต่อไปนี้:
@article{raschkas_2018_mlxtend,
author = {Sebastian Raschka},
title = {MLxtend: Providing machine learning and data science
utilities and extensions to Python’s
scientific computing stack},
journal = {The Journal of Open Source Software},
volume = {3},
number = {24},
month = apr,
year = 2018,
publisher = {The Open Journal},
doi = {10.21105/joss.00638},
url = {https://joss.theoj.org/papers/10.21105/joss.00638}
}
วิธีที่ดีที่สุดในการถามคำถามคือผ่านช่องทางการสนทนา GitHub ในกรณีที่คุณพบข้อบกพร่องในการใช้งาน โปรดอย่าลังเลที่จะใช้เครื่องมือติดตามปัญหาของ GitHub โดยตรง