Hacker News new | comments | show | ask | jobs | submit login
“Practical Artificial Intelligence Programming With Java” by Mark Watson (leanpub.com)
100 points by mark_l_watson 1607 days ago | hide | past | web | 41 comments | favorite



Interesting, I'll buy this for more AI research.

Some people and I are working on Bitcoin Skynet. Basically we are seeing if we can code an independent bot/agent that can support itself through paid hosting with bitcoins, that makes income from automatic exchanges between cryptocurrencies. The bot is given intelligence and set free to see what it does. It switches hosting every month, and can decentralize itself to protect against denial of service, and also sells other services and escrow brokerage.


So you're writing a bot to play currency exchange with the goal of making it migrate its programming between allowed machines and pay for itself?

I'm sorry, since when did currency exchange markets yield reliable, non-normally-distributed profits like that? EDIT FOR DOWNVOTERS: I'm seriously asking this. I honestly thought forex markets were pretty normally distributed and quite a hard place to make a consistent, algorithmically-driven profit.

Also, I feel like this is going to blow up into some huge lesson in Why Capitalism Is Evil, as portrayed by the Capitalism Bot, and people are only really going to get it once they can look at the economic system as a malicious AI. But whatever.


I can't speak for the more complex mathematics being discussed here, but I can say with some confidence that there are definitely more people making money on forex related fraud than on forex.


Hello dobbsbob, author of the book here. A little off topic, but I offer free mentoring (http://markwatson.com/mentoring/) for new projects if you would like to talk about your project.


What could possibly go wrong?


Have you seen gmaxwell's thoughts on a similar subject? https://bitcointalk.org/index.php?topic=53855.msg642768#msg6...


Why did you choose Java? I don't have a problem coding in Java, but I thought it was an interesting language choice considering most AI programs I tend to see are written in some derivation of Lisp.


Author here. I started using Lisp for AI in the early 1980s, had a Lisp Machine, wrote two AI Lisp books for Springer-Verlag back then, etc. I thought that Java 1.0 was an interesting language, and Peter Norvig, who did a tech review of an early edition of this book once said something to me roughly like 'Java is half as good as Lisp for AI, but that is probably good enough' (from an email probably 12 years ago, but that is close to what he said).

Clojure, Python, Common Lisp, are other candidate languages for AI.


Clojure seems like a pretty natural choice, especially if you are planning to use a lot of third party libraries written in Java (though even CL might be useful, if you use ABCL). I suppose the real question here is, "Why Java?" Are there technical considerations, or is it about the syntax being more familiar to potential readers, or is there some other consideration here?


Clojure is a natural choice. One reason this book uses Java is that I wrote the first edition in 1998, this being the fourth edition. I still like Java simply because I use Clojure and JRuby a lot and Java interop is easy.

I love to write, and if I could get a world class Clojure coder (perhaps someone like Alex Ott, or someone with similar skills) to co-write, it would be fun to start over.


Why did you choose Java over Python (imo the only two practical alternatives for a textbook since you want to target the biggest possible audience)? Are the Java AI/ML libraries better or easier to use than Python's?


By looking at the source at Github, some chapters (if not all?) utilize third party tools and libraries written in Java. The community is big.

For example Weka is widely used for data mining (even in academia) and here it's used in the Machine Learning chapter; Drools is an excellent solution from JBoss/Red Hat used in the chapter for Expert Systems, and etc... I even see a Hadoop dependency in the code but I'm not sure (yet) in which chapter it's used.

I bought the book, as a Java developer this is one of the areas I'm less experienced in, so this is a great opportunity to get up to date.


I'm wondering if there were any specific reasons as to why Weka was used instead of Mahout for the machine learning chapter, as both are in Java.


Plenty of NLP/recommendation startups use Java.

Practical AI stuff can be done in most (lower level) practical languages.


"Practical AI stuff can be done in most (lower level) practical languages."

It can be done, but that does not mean that it necessarily makes sense to do so. The question is, what advantage does Java really have here, over something like Clojure?


This is like the third or fourth time I've seen Clojure and Lisp mentioned. I know I'm not answering your question (I'm the least able to do so probably on HN) but as a Java developer, I'd like to know why Lisp-like languages make them a "natural choice" for AI/machine learning?


I think this is so often mentioned, because of AI/Lisp's common history. I am in natural language processing (which is sometimes seen as a subbranch of AI) and I have rarely seen anyone who used Lisp (mostly Perl, Python, Java, Prolog, and C++). Also, most machine learning software is written in C, C++, Java, or Matlab, with a strong and growing Python presence (via NumPy/SciPy).


Homoiconicity (code and data having the same representation) is a commonly cited reason, which is key to the macro system in Lisp. Also commonly cited is the symbol type, which is also very useful in various AI contexts:

http://www.cs.st-andrews.ac.uk/research/aisc

This is not to say that you cannot do equivalent things in Java, but it is a lot easier in Lisp.


Theres a lot of history with lisp and a.i. Take for example the famous koza book for genetic programming in lisp. I think its to do with in lisp, the program is data which can be changed


Well... Java is an interesting choice, but it's far from the strangest.

I still have this (https://www.librarything.com/work/3032548) book somewhere. Working through it as a kid was an interesting experience (amplified by the fact my computer was an Apple II+ at the time).


I haven't seen much AI/machine learning in lisp in long time. Mostly I see people use matlab, java, Python and C.


At $6 this is a no-brainer impulse buy. But I wish it was in Go instead. I use to code in java, but I have no interest going back to it.

I want to get better in Go and it would have allowed me to kill two birds with one stone.


How does this version compare to the one from 2008? The chapters look similar, but then again there could be a lot of advancements and updates. Is this the case, or is it just small revisions?


Hello Ryan, this fourth edition has several new chapters and a fair amount of rework. Some chapters however are very similar to the 2008 edition: search, expert systems, and machine learning. You might want to just get the updated code examples from github.


I have the 1997 version and I liked it! I think I might pick up the updated version even though Java is not my currently favoured language. Converting the examples to another language shouldn't be too arduous for anyone familiar with Java.


I use Clojure and JRuby a lot, and I am working on wrappers for some of the examples. Look in the github repo for the book in a week or two, and they should be there. You may not need the fourth edition since you have the have the first edition, but at least get the new code examples. Also, you can get a free PDF for the third edition from 2008 on my web site.


I just pushed an example to the book's github repo for calling a Java neural network example from JRuby. I'll add a Clojure example tomorrow.


Could you provide a link to a sample chapter and table of contents? Thanks!


I just bought the book (at $6, it is an easy impulse buy...)

Table of contents:

  Introduction 
  # Other JVM Languages 
  # Github Repository for Book Software 
  # Use of Java Generics and Native Types 
  # Notes on Java Coding Styles Used in this Book 
  # Book Summary 
  
  Search 
  # Representation of Search State Space and Search Operators 
  # Finding Paths in Mazes 
  # Finding Paths in Graphs 
  # Adding Heuristics to Breadth First Search 
  # Search and Game Playing 
  
  Reasoning 
  # Logic 
  # PowerLoom Overview 
  # Running PowerLoom Interactively 
  # Using the PowerLoom APIs in Java Programs 
  # Suggestions for Further Study 
  
  Semantic Web 
  # Relational Database Model Has Problems Dealing with Rapidly Changing Data Requirements 59
  # RDF: The Universal Data Format 
  # Extending RDF with RDF Schema 
  # The SPARQL Query Language 
  # Using Sesame 
  # OWL: The Web Ontology Language 
  # Knowledge Representation and REST 
  # Material for Further Study 
  
  Expert Systems 
  # Production Systems 
  # The Drools Rules Language 
  # Using Drools in Java Applications 
  # Example Drools Expert System: Blocks World 
  # Example Drools Expert System: Help Desk System 
  # Notes on the Craft of Building Expert Systems 
  
  Genetic Algorithms 
  # Theory 
  # Java Library for Genetic Algorithms 
  # Finding the Maximum Value of a Function 
  
  Machine Learning with Weka 
  # Using Weka’s Interactive GUI Application 
  # Interactive Command Line Use of Weka 
  # Embedding Weka in a Java Application 
  # Suggestions for Further Study 
  
  Neural Networks 
  # Hopfield Neural Networks 
  # Java Classes for Hopfield Neural Networks 
  # Testing the Hopfield Neural Network Class 
  # Back Propagation Neural Networks 
  # A Java Class Library for Back Propagation 
  # Adding Momentum to Speed Up Back-Prop Training 
  
  Statistical Natural Language Processing 
  # Tokenizing, Stemming, and Part of Speech Tagging Text 
  # Named Entity Extraction From Text 
  # Using the WordNet Linguistic Database 
  # Automatically Assigning Tags to Text 
  # Text Clustering 
  # Spelling Correction 
  # Hidden Markov Models 
  
  Information Gathering 
  # Open Calais 
  # Information Discovery in Relational Databases 
  # Down to the Bare Metal: In-Memory Index and Search 
  # Indexing and Search Using Embedded Lucene 
  # Indexing and Search with Nutch Clients 
  
  Data Science Techniques 
  # A Mix of Open Source and Proprietary Tools 
  # Handling “small big data” in a Cost Effective Way 
  # Writing and Testing MapReduce Applications 
  # Example Application: MapReduce Application for Finding Proper Names in Text 
  # Using Inexpensive Large Memory Leased Servers 
  # Example Application Idea: Using the Google Book Project NGRAM Data Sets 
  # Example Application Idea: Using Wikipedia Data Dumps 
  # Conclusion 
  
  Conclusions


This is stupid question, but based on the ToC, is this book suitable for Java programmer who doesn't know anything about AI other than from Hollywood movies?


Almost definitely not, from the look of it. Even the first few chapters go beyond my old CS387 Intro to AI class in college.

I feel like now that I'm in grad school I should take more and better AI courses, but I just can't find the interest in me, no matter that the field is economically hot right now.


Thanks for posting that! And, of course, thanks for buying a copy of my book.


Could you please paste this under "Table of Contents" of the book page? That would help people decide.


This looks like a pretty broad coverage book. I wonder if the book has same issues as other broad books - they do good in telling you what topics exist but fail to go in depth.


Hello Zura, that is a fair comment. I don't go into a lot of depth for some topics. I introduce an idea, usually explore an idea with some code, and try to suggest possible projects. If you want a thorough and deep coverage of AI, work through http://aima.cs.berkeley.edu/


I am putting together a sample with the first and last chapter, but it may not be on the book page until tomorrow morning.


Purchased, looking forward to reading it over the summer months. Thanks to the author for making it available.


I have this book. I forgot which edition; it's an excellent read. Thanks for updating it.


Congrats to the author to propose the ebook at an affordable price!!


I wonder if you could release your old 90s C++ books as ebooks?


Congratulations, Mark.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: