Hands-On Machine Learning with Scikit-Learn and TensorFlow


| Chapter 2: End-to-End Machine Learning Project



Download 26,57 Mb.
Pdf ko'rish
bet54/225
Sana16.03.2022
Hajmi26,57 Mb.
#497859
1   ...   50   51   52   53   54   55   56   57   ...   225
Bog'liq
Hands on Machine Learning with Scikit Learn Keras and TensorFlow

70 | Chapter 2: End-to-End Machine Learning Project


17
Some predictors also provide methods to measure the confidence of their predictions.
18
This class is available since Scikit-Learn 0.20. If you use an earlier version, please consider upgrading, or use
Pandas’ 
Series.factorize()
method.
a test set (and the corresponding labels in the case of supervised learning
algorithms).
17
• Inspection. All the estimator’s hyperparameters are accessible directly via public
instance variables (e.g., 
imputer.strategy
), and all the estimator’s learned
parameters are also accessible via public instance variables with an underscore
suffix (e.g., 
imputer.statistics_
).

Nonproliferation of classes. Datasets are represented as NumPy arrays or SciPy
sparse matrices, instead of homemade classes. Hyperparameters are just regular
Python strings or numbers.

Composition. Existing building blocks are reused as much as possible. For
example, it is easy to create a 
Pipeline
estimator from an arbitrary sequence of
transformers followed by a final estimator, as we will see.

Sensible defaults. Scikit-Learn provides reasonable default values for most
parameters, making it easy to create a baseline working system quickly.
Handling Text and Categorical Attributes
Earlier we left out the categorical attribute 
ocean_proximity
because it is a text
attribute so we cannot compute its median:
>>> 
housing_cat
=
housing
[[
"ocean_proximity"
]]
>>> 
housing_cat
.
head
(
10
)
ocean_proximity
17606 <1H OCEAN
18632 <1H OCEAN
14650 NEAR OCEAN
3230 INLAND
3555 <1H OCEAN
19480 INLAND
8879 <1H OCEAN
13685 INLAND
4937 <1H OCEAN
4861 <1H OCEAN
Most Machine Learning algorithms prefer to work with numbers anyway, so let’s con‐
vert these categories from text to numbers. For this, we can use Scikit-Learn’s 
Ordina
lEncoder
class
18
:

Download 26,57 Mb.

Do'stlaringiz bilan baham:
1   ...   50   51   52   53   54   55   56   57   ...   225




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish