“Programming Collective Intelligence” code now available
A LOT of people have been emailing me and asking me if the code from the book is downloadable. Had I been clever (and not stressed about just getting the book done), I would have thought of this. I guess this is a downside to books no longer coming with CDs.
Anyway, it’s all available here: PCI_Code.zip
Thanks to everyone who has been posting wonderful comments (e.g. “Programming Collective Intelligence is the best book O’Reilly has published in years”) about the book all over the place. I’ve tried to track you down and send you a thank you email if I could, but there’s a lot of hits for the phrase now so it’s a little hard to keep up.
October 29th, 2007 at 6:56 pm
Fantastic, thanks for the link! I was looking for the code
October 29th, 2007 at 8:23 pm
thanks for your useful code and wonderful book. : )
November 6th, 2007 at 2:07 pm
Loved the book - its been an invaluable resource. I’ll be following your blog now alos. Keep up the good work.
November 8th, 2007 at 12:03 am
I’m only on Chapter 4, but so far, this is the best O’Reilly book (and computer book in general) that I’ve bought in years. I took a graduate course in machine learning which was horribly confusing and left me feeling that I never really knew how to apply the theory we learned in class; so far, your book has really simplified the concepts in my mind and taught me the practical side of this knowledge.
Thanks for this awesome text!
November 12th, 2007 at 4:04 pm
A really great book and thanks for posting the source code!
Just one suggestion, is it possible to post some references for each chapter?
Thanks.
November 16th, 2007 at 5:57 pm
I have learned so much from your book and it took my appreciation of Web 2.0 on a different level.
I just like to ask if you plans to have an online forum where questions on some exercises in the book can be posted. There are some chapters where the code exercises results into error and don’t have anyone to ask. Perhaps those who have tried it and done well can point what I’ve done wrong that caused the errors I’m seeing.
Thank you.
November 18th, 2007 at 8:11 pm
[…] Toby Segaran has released the source code for his book, on his blog . The code is made of various machine learning methodologies coded in python, and providing examples with datasets from various public apis such as facebook, del.icio.us or even the stock market. I just love the fact that somebody includes these things as examples compared to the usual reference datasets we get such as hand-written digits etc. The sourcecode can be found here. Seriously recommended if you are thinking of doing machine learning with one of these services. […]
November 22nd, 2007 at 5:32 pm
[…] A comprehensive overview of useful data mining algorithm Posted November 22, 2007 The book Programming Collective Intelligence from Toby Segaran is a practical useful guide through the most common data mining, more exact classification, algorithms. The book covers the traditional algorithms as decision trees, naive Bayesian classifier, neural networks, clustering and not so common ones as support-vector machines and non-negative matrix factorization. The last one was new for me. The first paper seems not to have surfaced before 2000 so it is relatively new technique and has shown very good results in the case of feature extraction of large numerical spaces. Also optimizing functions like simulated annealing and genetic algorithm are mentioned. Interestingly, there is also a small example for genetic programming. All algorithms are explained with examples and small programs in Python. The only thing I’ve missed is a mathematical representation in addition to the explanation itself, but at least all utility functions are explained more formal in the appendix. […]
December 12th, 2007 at 10:41 pm
The Code download link is broken.
December 12th, 2007 at 10:42 pm
Not Found
The requested URL /PCI_Code.zip was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
December 13th, 2007 at 12:39 pm
Oops, sorry about that. Having domain issues. Should be fixed now!
December 13th, 2007 at 5:26 pm
[…] Sample code from Toby […]
January 27th, 2008 at 11:10 pm
Thank you very much for writing this invaluable resource! I’m using it every day, and of course I certainly appreciate the coding help as well.
February 5th, 2008 at 4:06 am
This is a great resource. I picked it up knowing nothing about python, and two weeks later I have found out that it is going to totally transform an idea I’ve been sitting on.
Is there going to be a follow up book entitled ‘ What do do with All the Money You’ve Made using Cognitive Intelligent Programming Practices’ ?
Are any of you getting as inspired as I am?
February 5th, 2008 at 4:08 am
Also, has one else noticed a problem with url2libs connectivity to wikipedia? I am unable to crawl their site, and their server allows it
February 7th, 2008 at 5:11 pm
Toby
I came across your book accidentally. This is one of the best books written. The way you have explained the very complex algorithms and techniques in a very simple, easy to understand, is amazing. My copy the book is on it’s way.
February 21st, 2008 at 9:44 am
Hi,
I too have noticed that you cannot crawl the Toby’s sample wiki site.
I think I discovered that BeautiflSoup is not extracting the text from the site. But I’m very new to Python.
Toby, can you confirm?
And thanks again for an extraordinary book.
February 24th, 2008 at 12:26 am
Hi,
I made two chages to the code to enable Chapter 4’s searchengine.py.
1. In def gettextonly changed ‘if v==Null:’ th ‘if v==None:’.
2. In ‘def addlinkref’ changed ‘words=self.separateWords(linkText)’ to ‘words=self.separatewords(linkText)’.
Best,
Bob
March 7th, 2008 at 1:04 am
hey, I was doing expert systems in smalltalk 80 on a mac fx in 1988 - thought that was cool so I have been stewing on a number of ideas related to web 2 - you book cracked a few wide open - thanks for everything! You rock.
‘be a rockstar - work for the fan - not the man!’
March 31st, 2008 at 10:31 am
The book contents interests me. Will be getting a copy tomorrow. =D
April 17th, 2008 at 7:01 am
Thanks for the code. Just downloaded the code, gonna give it a test run.
David Lagur
דירות למכירה
May 5th, 2008 at 5:10 am
Great book. I tried the code in Chapter 4 and found it could not parse the page:
>>>import searchengine
>>>crawler=searchengine.crawler(’searchindex.db’)
>>>pages=[’http://kiwitobes.com/wiki/Categorical_list_of_programming_languages.html’]
>>> crawler.crawl(pages)
Indexing http://kiwitobes.com/wiki/Categorical_list_of_programming_languages.html
Could not parse page http://kiwitobes.com/wiki/Categorical_list_of_programming_languages.html
Any ideas?
Thanks.
May 6th, 2008 at 11:07 am
Toby,
I downloaded the source code for your book and am working with the search engine code described in chapter 4, page 57. (searchengine.py)
I have problems with BeautifulSoup. Your code can download any page but can never generate “the soup”. I get the error message “Could not parse page …” regardless of the page fetched.
I am using version 3.0.5 of BeautifulSoup (on Gentoo Linux) and I read that there is a bug related to encoding with this version (http://groups.google.com/group/beautifulsoup/browse_frm/thread/1cc6b2e64a6eb109). I tried the fix suggested there: http://groups.google.com/group/beautifulsoup/tree/browse_frm/thread/1cc6b2e64a6eb109/2b5b147cd2a8f639?rnum=1&_done=%2Fgroup%2Fbeautifulsoup%2Fbrowse_frm%2Fthread%2F1cc6b2e64a6eb109%3F#doc_df73ae1b692652c3 but the error message remains.
Which version of BeautifulSoup did you use when you tested your code? Hopefully by downgrading to that version my problem will go away.
Thanks for your time!
Charles
June 7th, 2008 at 5:47 pm
Bought the book last week when I started learning Python. Didn’t stop reading since then.
July 8th, 2008 at 4:38 pm
Toby
I bought your book couple of months ago and I love it. You have amazingly explained the datamining concepts in simple terms with great example. I am big Java developer and curious if you have the code set for Java platform?
Thanks
Paddy
July 9th, 2008 at 12:12 pm
Toby
I bought your book weeks ago, it’s really a great book to let me clearify almost many topics which are always very complex in a pure theroy-based book.
occasionally, I found that “http:// kiwitobes. com/tree/decision_tree_example.txt” - you mentioned in chapter 7 — dose not exist!
and are you still keeping the data consistence with the book?
or where can we download the data other than the code?
Thanks
Jian (from china)
July 14th, 2008 at 12:54 pm
Downloading the zip now… Wondering what I’ll find there.
Cheers for the link.
Marcus
אזרחות פולנית
July 16th, 2008 at 10:50 pm
How about a php versions of the examples?
August 6th, 2008 at 8:34 am
Hi Toby
Great work but i have a few questions on the code you have done.
def sim_distance(prefs,person1,person2):
# Get the list of shared_items
si={}
for item in prefs[person1]:
if item in prefs[person2]: si[item]=1
# if they have no ratings in common, return 0
if len(si)==0: return 0
# Add up the squares of all the differences
sum_of_squares=sum([pow(prefs[person1][item]-prefs[person2][item],2)
for item in prefs[person1] if item in prefs[person2]])
return 1/(1+sum_of_squares)
This is the code you use to calculate the euclidean distance between 2 users.
This code only gives you the distance between common ratings
if we had 2 users with the the following rates for 4 movies
[ 2 0 3 0] and [ 2 3 0 4 ]
the result is
sqrt ( pow((2-2),2)= 0
where we want
sqrt(pow((2-2),2)+pow((0-3),2)+pow((3-0),2)+pow((0-4),2)=…
pls correct if i am wrong
and check the following code
def euclidian_similarity(data,p1,p2):
p1_squares=0
p2_squares=0
sum_of_comon_squares=0
for item in data[p1]:
if item in data[p2]:
sum_of_comon_squares=sum(pow(data[p1][item]-data[p2][item],2))
for item in data[p1]:
if item not in data[p2]:
p1_squares=sum(pow(data[p1][item],2))
for intem in data[p2]:
if item not in data[p1]:
p2_squares=sum(pow(data[p2][item],2))
sum_of_squares=sqrt(sum_of_comon_squares+p1_squares+p2_squares)
return 1/(1+sum_of_squares)
August 6th, 2008 at 9:16 am
for lines (7)(10)and (13) please use (+=) not (=)
sorry about that
August 18th, 2008 at 7:56 pm
продвижение сайтов екатеринбург разработка сайтов казань umi cms еклама и креатив: создание сайтов, продвижение интернет-проектов: оптимизация для поисковых систем и продвижение (раскрутка) сайтов, повышение рейтинга сайта в поисковых системах, рекламные кампании, создание фирменного стиля компании
Креативное агентство “Корвин”:
занимается поисковой оптимизацией сайтов, продвижением сайтов (раскрутка сайтов) в поисковых системах (Google.ru, Yahoo.com, MSN.com, Yandex.ru, Rambler.ru, Altavista.com, Aport.ru, Nigma.ru), регистрацией сайтов в интернет-системах статистики посещаемости (Mail.ru, Rambler`s Top100, One.Ru, Rate.ru, LiveInternet.ru, SpyLOG, HotLog, CY Яндекса) Поисковая оптимизация сайтов, продвижение сайтов (раскрутка сайтов) в поисковых системах (Google.ru, Yahoo.com, MSN.com, Yandex.ru, Rambler.ru, Altavista.com, Aport.ru, Nigma.ru), регистрацией сайтов в интернет-системах статистики посещаемости (Mail.ru, Rambler`s Top100, One.ru, Rate.ru, LiveInternet.ru, SpyLOG, HotLog, CY Яндекса).
продвижение сайтов (раскрутка сайтов) с помощью контекстной рекламы в системах контекстной рекламы: Begun.ru, Sape.ru Продвижение сайтов (раскрутка сайтов) с помощью контекстной рекламы в системах контекстной рекламы: Begun.ru, Sape.ru
продвижение сайтов (раскрутка сайтов) с помощью контекстной рекламы в тематических каталогах: Яндекс.Директ, каталога Mail.ru., каталога Яндекс Продвижение сайтов (раскрутка сайтов) с помощью контекстной рекламы в тематических каталогах: Яндекс.Директ, каталога Mail.ru., тематического каталога Яндекс.
продвижение сайтов и оптимзация (раскрутка сайтов) по рейтингу: Яндекс.Директ, каталога Mail.ru., каталога Яндекс Продвижение сайтов и поисковая оптимизация (раскрутка сайтов) на Яндексе (поисковая система Yandex.ru), продвижение сайтов и поисковая оптимизация (раскрутка сайтов) в поисковой системе Google.com (русскоязычный сегмент Google.ru), продвижение сайтов и поисковая оптимизация (раскрутка сайтов) в поисковой системе Yahoo.com (русскоязычный сегмент ru.Yahoo.com), продвижение сайтов и поисковая оптимизация (раскрутка сайтов) на Mail.ru, с результатом попадания в рейтинг первых 10-20 результатов: top 10 Yandex.ru, top 20 Google.ru, top 20 ru.Yahoo.com, top 20 Mail.ru.
продвижение сайтов (раскрутка сайтов) с помощью прямой контекстной рекламы по ключевым словам в Яндекс.Директ - показы на рекламных площадках Yandex.ru Продвижение сайтов (раскрутка сайтов) с помощью прямой контекстной рекламы по ключевым словам Яндекс.Директ - показы на рекламных площадках Yandex.ru.
подбирает ключевые слова для поисковых систем и оптимизирует информационное содержимое сайта (тексты и графические элементы, фотографии - контент) для поисковых систем Подбирает ключевые слова для поисковых систем и оптимизирует информационное содержимое сайта (тексты и графические элементы, фотографии - контент) для поисковых систем, создает рекламные тексты.
планирует и проводит рекламные кампании в Интернете: маркетинговый аудит и комплексный анализ интернет проектов, анализ эффективности интернет рекламы, анализ и изучение конкурентной среды, анализ целевой аудитории, продвижение веб сайтов, регистрация в поисковых системах, увеличение популярности сайта среди целевой аудитории, развитие, поддержка и сопровождение интернет проектов Планирование и проведение рекламных кампаний в Интернете: маркетинговый аудит и комплексный анализ интернет проектов, анализ эффективности интернет рекламы, анализ и изучение конкурентной среды, анализ целевой аудитории, продвижение веб сайтов, регистрация в поисковых системах, увеличение популярности сайта среди целевой аудитории, развитие, поддержка и сопровождение интернет проектов.
Как самостоятельно рассчитать бюджет (стоимость) продвижения сайта?
Во - первых существует множество программ, которые за считанные секунды рассчитывают примерный бюджет продвижения по конкретно заданному поисковому запросу.
Во - вторых если вы не хотите покупать программу можете воспользоваться формулой:
Z=E/3xS
где:
Z - примерная стоимость продвижения
Е- стоимость клика в контекстной рекламе поисковика (Директ или Google AdWords)
S - количество запросов в месяц данного ключевого слова (поискового запроса)
Полученная сумма - это стоимость одного месяца продвиженияПродвижение сайтов
У вас есть сайт, и вы решили его продвигать в поисковых системах для увеличения продаж Вашей фирмы.
Каковы действия, сроки, какова стоимость, с чего начать?
Такие вопросы вы задаете сами себе.
В первую очередь надо подобрать ключевые слова (или по-другому - поисковые запросы) по которым ваш сайт будет продвигаться в поисковиках.
Далее необходимо оценить бюджет продвижения сайта по выбранным поисковым запросам, на основе анализа бюджета конкурентов и стоимости клика в контекстной рекламе.
Провести оптимизацию сайта под поисковые запросы.
Здесь надо уточнить.
Желательно, еще до того как вы собрались заказывать сайт, определите список ключевых слов (поисковых запросов) и структуру сайта. Желательно создавать сайт уже оптимизированным под поисковые запросы. Оптимизация вновь созданного сайта требует дополнительных временных затрат, соответственно дополнительных денежных средств. В некоторых случаях необходимую оптимизацию провести невозможно, это зачастую касается сайтов, созданных на бесплатных или “дешевых” cms.
При расчете бюджета продвижения сайта в Mangusts, расходы на оптимизацию сайта, уже включены в стоимость продвижения и равномерно распределяются на все месяцы продвижения сайта.
Далее составляется план продвижения сайта, в котором отображаются финансовые затраты и все проводимые действия для увеличения ссылочного ранжирования.
Существует такой термин, как “поддержка сайта”, в плане SEO он означает недопущения падений достигнутых позиций в поисковиках. Стоимость “поддержки” составляет примерно столько, сколько в среднем продвижение сайта. Разница может составлять 10-15%.
100% гарантий в том, что ваш сайт попадет в ТОП10 - теоретически не может дать никто, если все же такую гарантию дают то, в подавляющих случаях это шарлатанство, либо цена продвижения завышается в 5-10 и более раз, либо вам предлагаются для продвижения очень “редкие” поисковые запросы по которым нет достаточной конкуренции, а следовательно они не приносят целевой трафик. “Продвинув” сайт по таким поисковым запросам вы не получите увеличения продаж за счет дополнительных клиентов, пришедших с Интернета.
August 19th, 2008 at 10:57 am
I am studying the book and re-writing the samples in C#, finished chapter 2 samples, you can download them from this URL: http://nader.shalabi.googlepages.com/CollectiveIntelligence02.zip
I re-wrote some APIs in C# 3.0 if anyone is interested (like del.icio.us and Movielens Dataset reader).
I will post the rest of the chapter once I finish them, hope they are useful.
Nader.
August 26th, 2008 at 10:41 am
I’m reading your wonderful book and re-writing the samples in Ruby (it’ll allow to add them to my playground and it help me understand the algorithms better)
Meanwhile I ported the simulated annealing and genetic optimization algorithms.
When re-writing the latter, I found some things in your code that I didn’t quite understand (or perhaps it’s a bug):
optimization.py:
1. line 155, line 157 - shouldn’t the condition include the step, e.g. vec[i]-step>=domain[i][0] instead of vec[i]>domain[i][0] ?
2. line 189,194,195 - randint(a,b) returns N: a<=N<=b AFAIK. Therefore for choosing an index, it should be c=random.randint(0,topelite-1) instead of c=random.randint(0,topelite), am I missing something?
3. This is a minor issue, but for the last iteration of the main loop, the generation of new population is a waste of cpu cycles, since this population will not be considered.
If it’s of any interest, I can post my ruby implementation.
And again, thanks for the wonderful book!
September 2nd, 2008 at 2:44 pm
Кстати,c радостью поздравляю всех подписчиков блога с первым сентября. (Автора наверное не нужно поздравлять, так как у Вас наверное 1 сентября уже в прошлом ;)) Вчера забыла поздравить, не до этого было. Сейчас вот только отошла немного
September 4th, 2008 at 9:14 am
So you have a large database of data of some sort, what do you do with it next? Do a bunch of SQL queries and display boring tables in HTML? This book opens up a universe of new possibilities! It’s a great read - I’ve found that I can open to any chapter and learn something entirely new on my 15 minute train ride in to work. And the algorithms described are set out in easy to understand terms so that they could be applied immediately to whatever data you have lying around (including the wealth of data available on the Web). An exceptionally good technical book, one of the best I’ve seen in a long time! Thanks, Toby, great job! (and thanks for putting the example code up on this site)
September 19th, 2008 at 9:17 am
Hi - I’m a Python beginner with a bit of experience. PCI is clearly comprehensive and the text reads very well but I just can’t get the code to work. For the example of p11 I keep getting this error:
NameError: name ‘recommendations’ is not defined
I’ve tried everything. Could anyone let me know what the problem might be?
Thanks!
October 19th, 2008 at 5:49 am
How are you ?
The interesting name of a site - blog.kiwitobes.com
I yesterday 8 hours
has spent to the Internet So I have found your site
The interesting site but does not suffice several sections!
However this section is very necessary!
Necessarily I shall advise your site to the friends!
Forgive I is drunk :))
October 19th, 2008 at 6:21 pm
Great Book!
I am all new to applying this (Collective Intelligence) to web trends and search. What is next? Where to start to explore current trends in this technology?
November 4th, 2008 at 6:07 pm
Вау! Пост очень понравился, спасибо.
November 12th, 2008 at 9:20 pm
Спасибо за пост! Добавил блог в RSS-ридер, теперь читать буду регулярно..
November 13th, 2008 at 6:32 pm
chort, prosto zachituvaus’ kogda chitayu eti postu, avtor molodec
November 17th, 2008 at 10:31 pm
Dear sir,
I had bought and read your book which called “OReilly.Programming.Collective.Intelligence.Aug.2007″.
Could you please offer us the “Exercises answer” for our reference.
Your prompt reply will be appreciated.
Thank you very much in advance.
++++++++++++++++++++++
Kevin.H
Mail:kevin@teac.com.tw
++++++++++++++++++++++
November 25th, 2008 at 10:40 am
pishite esche na podpbnue temu
November 25th, 2008 at 11:22 am
November 26th, 2008 at 6:56 am
,
November 28th, 2008 at 1:33 pm
clas, dolgo etot post pisali?
December 4th, 2008 at 7:21 am
The Google Game Is Over! The Most Profitable Ppc Champion Is Here To Stay…
No More Wasting Dollars On Poor Performing Campaigns…
IMPORTANT: Read this, because the doors
to Yahoo Cash won’t stay open for long.
Itwent live yesterday, and the 200 spots are already vanishing.
You can spend thousands on Google Adwords ads, or you
can spend pennies on Yahoo where the competition’s less
and the payoffs can be huge. Yahoo Cash shows you how to do it.
If you’re in a hurry, just go here and see why people
are saying this is the perfect system for anybody to
start squeezing maximum profits from PPC ads on Yahoo:
WHY THIS IS SO URGENT
*************************************************
They’re only releasing 200 copies of the system every
three months so they can provide excellent customer
support. That’s not a gimmick–they mean it. When those
spots are gone, they’re gone.
That’s why you need to get over there, see why this is
like striking gold, and jump on this before the 200 spots disappear.
*************************************************
This is the system that helped these guys milk over
$463,000 from ClickBank. Here’s the link to check it
out for yourself:
http://softflirt.com
All the best!
December 4th, 2008 at 8:50 am
sory za up staroy temu, no virazhayu svoyu blagodarnost’, material ochen’ prigodilsya
January 27th, 2009 at 7:49 pm
Toby,
I too have the parse page problems with Soup in Chapter 4. I have looked for a solution with no success. Can you suggest a path?
Thanks
February 17th, 2009 at 5:57 am
fdsfd sfdsfsdfgreg54dfgb mj,kg.mhgnbgf gfdg
February 17th, 2009 at 12:26 pm
Новый способ давления на кандидата на пост Главы г. Химки
Новый способ “наказать” тех, кто посмел участвовать в выборной кампании не на стороне действующей власти изобрели правоохранительные органы г.о. Химки.
Руководствуясь не нормой закона, а чьей-то “волей” сотрудники милиции решили “проверить” все фирмы, внесшие денежные средства в избирательный фонд неудобных кандидатов.
Начались “проверки” с телефонных звонков - где директор, сколько человек работает на фирме. После чего последовали “письма счастья” с просьбой предоставить всю бухгалтерскую документацию, учредительные документы фирмы, и даже, план экспликации БТИ.
Такие запросы химкинским фирмам рассылает 1 отдел Оперативно-розыскной части № 9 Управления по налоговым преступлениям ГУВД Московской области за подписью начальника подполковника милиции Д.В. Языкова.
И всё это в то время, когда Президент дал прямое указание правоохранительным органам о прекращении всех незаконных проверок малого и среднего бизнеса. С это целью внесены изменения в Федеральный закон “О милиции” - из статьи 11 этого закона исключены пункты 25 и 35, на основании которых ранее правоохранительные органы имели право проверять финансово-хозяйственную деятельность предприятий.
Видно, об изменениях действующего законодательства местные правоохранительные органы не уведомлены. И не смотрят телепередачи с выступлениями Президента.
Может быть, эта публикация подвигнет их к исполнению указаний Президента, а также к изучению и соблюдению действующего законодательства
February 22nd, 2009 at 10:54 am
Действительно, хорошо все написано
February 23rd, 2009 at 4:23 am
Проф раскрутка страниц в вебе основной вид деятельности компании “Badabam” с 2004 года. Мы предлагаем профессиональную раскрутку страниц в поисковых системах - Yandex (yandex), Рамблер, Гугл, Mail.Ru. В собственной работе мы используем лишь “белоснежные” способы раскрутки страниц в поисковиках. Ежели Вам нужна проф, дешевая, раскрутка сайта с финансовыми гарантиями - звоните в данный момент 517-23-23!
Раскрутка сайта, изготовка страниц, мастерски, недорого - Badabam.
March 12th, 2009 at 4:41 pm
установить натяжные потолки
April 12th, 2009 at 4:11 pm
Пожалуй, это один из интереснейших блогов, которые я когда-либо читал :). Прикольные статьи, Занимательные комментарии. Так держать!
April 21st, 2009 at 6:44 am
很好!Thank you!
May 10th, 2009 at 11:56 am
I’m reading your wonderful book and re-writing the samples in Ruby (it’ll allow to add them to my playground and it help me understand the algorithms better)
Meanwhile I ported the simulated annealing and genetic optimization algorithms.
When re-writing the latter, I found some things in your code that I didn’t quite understand (or perhaps it’s a bug):
optimization.py:
1. line 155, line 157 - shouldn’t the condition include the step, e.g. vec[i]-step>=domain[i][0] instead of vec[i]>domain[i][0] ?
2. line 189,194,195 - randint(a,b) returns N: a<=N<=b AFAIK. Therefore for choosing an index, it should be c=random.randint(0,topelite-1) instead of c=random.randint(0,topelite), am I missing something?
3. This is a minor issue, but for the last iteration of the main loop, the generation of new population is a waste of cpu cycles, since this population will not be considered.
If it’s of any interest, I can post my ruby implementation.
And again, thanks for the wonderful book
May 15th, 2009 at 8:34 am
looking for the code for a long time!wondeful~~~
and this is a nice book for me to learn AI or relative,while i am a beginner
June 25th, 2009 at 11:00 am
Hi Toby,
Thanks for putting out this book!
I’ve been a little frustrated with the technical papers available on some of the subjects (neural networks, mostly) and find the text and the exercises to be very helpful.
Unfortunately, I also have problems getting the code for Ch.4 to work.
No matter what I try, the code on p.57 always fails on me.
I’d appreciate any advice you may have.
Sincerely,
~Lina
July 17th, 2009 at 11:06 pm
Very good book, very useful book!!
July 22nd, 2009 at 3:55 am
Всем привет! Я тут новичок. Примите в компанию?
July 23rd, 2009 at 4:44 am
I ported the crawler class to MySQL innodb and lxml, instead of sqlite and beautiful soup. 15/30 times faster, or more.
If someone is interested drop me a line.
July 23rd, 2009 at 7:43 pm
списки кандидатов, выдвигаемые партиями политическими и избирательными объединениями (блоками) на выборах в представительные органы, проводимые по пропорциональной избирательной системе.
July 27th, 2009 at 10:45 am
HI, I get the same problem as JamieOB, What am I doing Wrong?? Thanks
JamieOB:
September 19th, 2008 at 9:17 am
Hi - I’m a Python beginner with a bit of experience. PCI is clearly comprehensive and the text reads very well but I just can’t get the code to work. For the example of p11 I keep getting this error:
NameError: name ‘recommendations’ is not defined
I’ve tried everything. Could anyone let me know what the problem might be?
Thanks!
July 28th, 2009 at 10:07 pm
Большое спасибо за статью, а это тема
В букмарки однозначно, пригодится! 
July 30th, 2009 at 10:35 pm
Разное
August 2nd, 2009 at 1:44 pm
Please use #hashtags for easy theme monitoring by twitter search.
August 21st, 2009 at 1:58 pm
Вопрос к автору сайта, а вот у вас время у каждой статьи и в комментах пишется… Это какое? Московское? Заранее благодарю за ответ.
August 26th, 2009 at 5:20 pm
Контент интересный,почерпнул много новго.
всем рекомендую для прочтения.
September 13th, 2009 at 5:23 pm
tnx a lot toby. I love your book and I waiting for the nest one.
September 14th, 2009 at 5:44 am
Всех благ,как на такси проехался,грамотно,доступно и удобно для прочтения
September 14th, 2009 at 3:48 pm
Самый яркий, торжественный, веселый и добрый праздник Новый год не может обойтись без Деда Мороза и Снегурочки! Вызовите Деда Мороза на дом и других сказочных персонажей. Представьте, как Ваш ребенок будет счастлив, проснувшись утром, когда узнает, что к нему пришел в гости настоящий Дед Мороз с большим мешком подарков. Вместе со Снегурочкой он поздравит вашего малыша, поиграет с ребенком в разные игры, и непременно порадуется вместе с ним, когда малыш сам расскажет стихотворение, станцует или споет песенку. Новый Год - волшебный праздник! Все дети верят и ждут Деда Мороза. Снегурочка вместе с Дедом Морозом - самые долгожданные гости в вашем доме! Сделайте вызов Деда Мороза в офис Вашей фирмы и профессиональные артисты в образе этих сказочных персонажей создадут праздничное настроение, позволят Вам и Вашим коллегам расслабиться, весело проводить старый год и встретить Новый год. Заказ Деда Мороза на дом - яркое, красочное событие для вашего ребенка, которое оставит у него самое приятное впечатление, подарите же ему сказку!
Вызов Деда Мороза в офис по телефонам: (495) 662-98-64
http://www.f-slon.ru/?mode=pages&page=new_year&d=n
http://www.goodparty.ru/zakaz-deda-moroza/
September 20th, 2009 at 6:41 am
Не могу согласиться с Вами, а если быть честным, то видел уже с десяток разных вариантов этой темы
September 20th, 2009 at 3:15 pm
Предлагаю рассылку рекламы:
-на форумы 20$ на 30000 форумов
-на доски 6$ на 10000 досок
-регистрация в каталогах 6$ на 6000 каталогов
-ручная регистрация влюбых ресурсах 0.2$ за регистрацию
-за 50$ 1000 уникальных посетителей
-делаю сайты от 30$ баннеры от 10$
E-mail: rot789@mail.ru
Базы свежие, использую лицензионную программу с распознованием капчи.
September 25th, 2009 at 1:15 pm
Предлагаю раскрутку сайтов путем рассылки рекламы:
-на форумы 20$ на 30000 форумов
-на доски 6$ на 10000 досок
-регистрация в каталогах 6$ на 6000 каталогов
-ручная регистрация влюбых ресурсах 0.2$ за регистрацию
-за 50$ 1000 уникальных посетителей
-делаю сайты от 30$ баннеры от 10$
E-mail: got765@mail.ru
Базы свежие, использую лицензионную программу с распознованием капчи.
September 26th, 2009 at 9:33 am
Fully agree with you, about a week ago wrote about the same in his blog!
September 26th, 2009 at 4:21 pm
Купить или продать квартиру (или комнату) в городе Одинцово Аренда, продажа, квартир и комнат в Одинцово.
September 26th, 2009 at 6:02 pm
Запчасти субару, лексус, митсубиши, тойота и другие японские марки!
September 27th, 2009 at 12:52 pm
мне понравилось,в тему
September 28th, 2009 at 8:18 am
Понравился блог, материал подобран по тематике, Молодец автор.
September 29th, 2009 at 7:30 am
>>>Взлом контакта<<<
Я бы общался вконтакте чаще но тупое добавление фоток, друзей, групп мягко говоря напрягает. Когда увидел рекламу на этот сайт подумал что какойто левак. Был не прав, признаю. Все что здесь обещают реально работает. Теперь мне не надо тратить время на формальности, я трачу его на дело
>>>Взлом контакта<<<
September 29th, 2009 at 9:25 am
>>>Не известные возможности сайта контакт<<<
У меня вконтакте 500+ друзей, и это конечно не предел! Хочу знать обо всех всё! Если родители не начинают трандеть, что мол пора спать, завтра рано вставать блаблабла, я могу просидеть вконтакте до 4-5 утра легко! Потом, правда, сплю до 2-3 дня. Но я не об этом. Я узнала столько секретов о сайте вообще и каждом из своих знакомых в отдельности!!! Недавно вступила в группу «флэшмобистов» и даже организовала встречу среди друзей. Было супер!!!
>>>вконтакте.ру<<<
October 2nd, 2009 at 9:39 am
Так же думаю, что это лучше в другой теме обсуждать и не засирать комментами блог.
October 2nd, 2009 at 7:00 pm
фильтруйте ваши всказывания слишком много воды
October 2nd, 2009 at 8:05 pm
спасибо
October 3rd, 2009 at 10:50 am
да блог классный а коменты ….
October 4th, 2009 at 1:50 am
Интерестно человек пишет,хорошо провел свободное время за оригинальной статьей!Спасибо.
October 5th, 2009 at 1:09 pm
dsnqelzpheeu
October 5th, 2009 at 4:38 pm
Привет. Возникла проблема - прикупил я электродрель на магазин ру
А она сломалась у меня в тот же день - гарантии никакой не дали. Просто почта пришла с коробкой, а там все на китайском. Прописал в торговый центр этот, ответили, что обращайтесь в сервис центр, но у меня ни документов на руках нет, ничего. Как возможно приструнить этот онлайн магазин? Есть ли какие-то компетентные органы, что писать. Куда писать, кому писать. Ошибся, да, нужно было в магазине нормальном купить, но нужной мне модели просто не было, да и дешевле в интернет-магазине. А вот и уже сижу у разбитого корыта. Подскажите, что делать.
November 11th, 2009 at 5:46 am
Желаю автору плодотворной деятельности,все понравилось,написано как следует а краеугольный камень так и не раскрыт.удачи.
November 19th, 2009 at 9:10 am
Aha, now it is clear … And then I just not very much and did not understand where is the link with the very title …
November 21st, 2009 at 8:52 pm
can any one help me with 8th chapter 5th question
when i try to optimize the parameters the unwanted parameter the are not becoming zero and i am getting cross validation error in a range of 155835 to 255578 and the probguess is zero every time
please help
November 24th, 2009 at 4:49 pm
Что то в верхнем углу высплыло, и Каспер показал что сайт заражон вирусом,
аффтар, да у тебя iframe вирус …
December 9th, 2009 at 10:03 am
Whatch this - dumps visa binlist
December 14th, 2009 at 4:23 am
Do not regret that I spent a couple of minutes to read your blog. Write often, even inevitably’ll come to read something new.
December 14th, 2009 at 5:56 am
Думаю всем читателям этого блога будет полезна следующая ссылка - Поджелудочная железа
December 16th, 2009 at 5:06 am
Посетите сайт http://www.svojadvokat.ru. На нем вы найдете множество полезной информации. Услуги адвоката, юридические услуги, семейный адвокат, личный адвокат
December 20th, 2009 at 8:40 pm
A really great book and thanks for posting the source code!
January 2nd, 2010 at 4:19 am
Article written ochentochno. In other words, and not say.
January 8th, 2010 at 9:26 am
chapter4 源码好像有错
chapter4
Traceback (most recent call last):
File “”, line 1, in
crawler.crawl(pagelist)
File “E:\python\searchengine.py”, line 83, in crawl
def addlinkref(self,urlFrom,urlTo,linkText):
File “E:\python\searchengine.py”, line 38, in addtoindex
# Index an individual page
File “E:\python\searchengine.py”, line 116, in getentryid
url=url.split(’#')[0] # remove location portion
OperationalError: unrecognized token: “‘==””
January 13th, 2010 at 11:30 am
Toby -
Thank you for the code. It’s been a real timesaver.
January 21st, 2010 at 10:24 am
Very professional highly trained written article. Thanks to the creators for a good site.
January 21st, 2010 at 10:39 am
качественно и не дорого!
Пиши в том же духе далее - статья очень помогла.
January 28th, 2010 at 7:49 pm
I came across your book accidentally. This is one of the best books written. The way you have explained the very complex algorithms and techniques in a very simple, easy to understand, is amazing. My copy the book is on it’s way.
February 1st, 2010 at 5:05 pm
Обследуйте зданий и сооружения и будет вам счастье
February 3rd, 2010 at 11:09 pm
Thank you very much for this information.
Good post thanks for sharin.
I like this site
February 5th, 2010 at 5:23 am
thx a lot !!!