Algorithms For Dummies



Download 7,18 Mb.
Pdf ko'rish
bet144/651
Sana15.07.2021
Hajmi7,18 Mb.
#120357
1   ...   140   141   142   143   144   145   146   147   ...   651
Bog'liq
Algorithms

 

»

load_boston()

: Regression analysis with the Boston house-prices dataset

 

»

load_iris()

: Classification with the iris dataset

 

»

load_diabetes()

: Regression with the diabetes dataset

 

»

load_digits([n_class])

: Classification with the digits dataset

 

»

fetch_20newsgroups(



subset='train'

):

 Data from 20 newsgroups



 

»

fetch_olivetti_faces()

:Olivetti faces dataset from AT&T

FIGURE 3-13: 

The files that you 

want to add to 

the repository 

appear as part of 

an upload list 

consisting of one 

or more 


filenames.


66

 

   


  PART 1 

 Getting Started

The technique for loading each of these datasets is the same across examples. The 

following example shows how to load the Boston house-prices dataset. You can 

find the code in the 

A4D; 03; Dataset Load.ipynb

 notebook.

from sklearn.datasets import load_boston

Boston = load_boston()

print(Boston.data.shape)

  

(506, 13)



To see how the code works, click Run Cell. The output from the 

print()


 call is 

(506, 13)

. You can see the output shown in Figure 3-14.

FIGURE 3-14: 

The Boston object 

contains the 

loaded dataset.




CHAPTER 4

  Introducing Python for Algorithm Programming 

     67


IN THIS CHAPTER

 

» Performing numeric and logic-based 

tasks

 

» Working with strings

 

» Performing tasks with dates

 

» Packaging code by using functions

 

» Making decisions and repeating steps

 

» Managing data in memory

 

» Reading data in storage objects

 

» Finding data faster by using 

dictionaries

Introducing Python for 

Algorithm Programming

A

 recipe is a kind of algorithm because it helps you cook tasty food by using 

a series of steps (and thereby get rid of your hunger). You can devise many 

ways to create a sequence of steps that solve a problem. Procedures of 

every variety and description abound, all of which describe a sequence of steps 

used to solve a problem. Not every sequence of steps is concrete. Mathematical 

notations present a series of steps to solve a numeric problem, but many people 

view them as so many oddly shaped symbols in an arcane language that few can 

understand. A computer language can turn the arcane language into a concrete 

form of English-like statements that solve the problem in a manner that works 

for most humans.

The previous chapter in this book, Chapter 3, helps you install a copy of Python 

to work with the examples in this book. You use Python throughout the book to 

solve  numeric  problems  using  algorithms  that  you  can  also  express  in 

Chapter 

4



68

 

   


  PART 1 


Download 7,18 Mb.

Do'stlaringiz bilan baham:
1   ...   140   141   142   143   144   145   146   147   ...   651




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2025
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