Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
BB committed Jan 3, 2017
0 parents commit d32c78b
Show file tree
Hide file tree
Showing 23,744 changed files with 8,967,706 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
7 changes: 7 additions & 0 deletions AI_A_Modern_Approach_Russell_Norvig/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2012 Juan Pedro Fisanotti <[email protected]>, Rafael Carrascosa <[email protected]>, Santiago Romero <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
107 changes: 107 additions & 0 deletions AI_A_Modern_Approach_Russell_Norvig/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
Metadata-Version: 1.1
Name: simpleai
Version: 0.5.3
Summary: An implementation of AI algorithms based on aima-python
Home-page: http://github.com/simpleai-team/simpleai
Author: Juan Pedro Fisanotti
Author-email: [email protected]
License: LICENSE.txt
Description: Simple AI
=========

Project home: http://github.com/simpleai-team/simpleai

This lib implements many of the artificial intelligence algorithms described on the book "Artificial Ingelligence, a Modern Approach", from Stuart Russel and Peter Norvig. We strongly recommend you to read the book, or at least the introductory chapters and the ones related to the components you want to use, because we won't explain the algorithms here.

This implementation takes some of the ideas from the Norvig's implementation (the `aima-python <https://code.google.com/p/aima-python/>`_ lib), but it's made with a more "pythonic" approach, and more emphasis on creating a stable, modern, and mantenible version. We are testing the majority of the lib, it's available via pip install, has a standar repo and lib architecture, well documented, respects the python pep8 guidelines, provides only working code (no placeholders for future things), etc. Even the internal code is written with readability in mind, not only the external API.

At this moment, the implementation includes:

* Search
* Traditional search algorithms (not informed and informed)
* Local Search algorithms
* Constraint Satisfaction Problems algorithms
* Machine Learning
* Statistical Classification

And we are working on an interactive execution viewer for search algorithms (display the search tree on each iteration).


Installation
============

Just get it:

.. code-block:: none

pip install simpleai


Examples
========

Simple AI allows you to define problems and look for the solution with
different strategies. Another samples are in the ``samples`` directory, but
here is an easy one.

This problem tries to create the string "HELLO WORLD" using the A* algorithm:

.. code-block:: python


from simpleai.search import SearchProblem, astar

GOAL = 'HELLO WORLD'

class HelloProblem(SearchProblem):
def actions(self, state):
if len(state) < len(GOAL):
return [c for c in ' ABCDEFGHIJKLMNOPQRSTUVWXYZ']
else:
return []

def result(self, state, action):
return state + action

def is_goal(self, state):
return state == GOAL

def heuristic(self, state):
# how far are we from the goal?
wrong = sum([1 if state[i] != GOAL[i] else 0
for i in range(len(state))])
missing = len(GOAL) - len(state)
return wrong + missing


problem = HelloProblem(initial_state='')
result = astar(problem)

print result.state
print result.path()


More detailed documentation
===========================

You can read the docs online `here <http://simpleai.readthedocs.org/en/latest/>`_. Or for offline access, you can clone the project code repository and read them from the ``docs`` folder.


Authors
=======

* Juan Pedro Fisanotti <[email protected]>
* Rafael Carrascosa <[email protected]>
* Santiago Romero <[email protected]>
* Gonzalo García Berrotarán <[email protected]>

Special acknowledgements to `Machinalis <http://www.machinalis.com/>`_ for the
time provided to work on this project.

Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
91 changes: 91 additions & 0 deletions AI_A_Modern_Approach_Russell_Norvig/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
Simple AI
=========

Project home: http://github.com/simpleai-team/simpleai

This lib implements many of the artificial intelligence algorithms described on the book "Artificial Ingelligence, a Modern Approach", from Stuart Russel and Peter Norvig. We strongly recommend you to read the book, or at least the introductory chapters and the ones related to the components you want to use, because we won't explain the algorithms here.

This implementation takes some of the ideas from the Norvig's implementation (the `aima-python <https://code.google.com/p/aima-python/>`_ lib), but it's made with a more "pythonic" approach, and more emphasis on creating a stable, modern, and mantenible version. We are testing the majority of the lib, it's available via pip install, has a standar repo and lib architecture, well documented, respects the python pep8 guidelines, provides only working code (no placeholders for future things), etc. Even the internal code is written with readability in mind, not only the external API.

At this moment, the implementation includes:

* Search
* Traditional search algorithms (not informed and informed)
* Local Search algorithms
* Constraint Satisfaction Problems algorithms
* Machine Learning
* Statistical Classification

And we are working on an interactive execution viewer for search algorithms (display the search tree on each iteration).


Installation
============

Just get it:

.. code-block:: none
pip install simpleai
Examples
========

Simple AI allows you to define problems and look for the solution with
different strategies. Another samples are in the ``samples`` directory, but
here is an easy one.

This problem tries to create the string "HELLO WORLD" using the A* algorithm:

.. code-block:: python
from simpleai.search import SearchProblem, astar
GOAL = 'HELLO WORLD'
class HelloProblem(SearchProblem):
def actions(self, state):
if len(state) < len(GOAL):
return [c for c in ' ABCDEFGHIJKLMNOPQRSTUVWXYZ']
else:
return []
def result(self, state, action):
return state + action
def is_goal(self, state):
return state == GOAL
def heuristic(self, state):
# how far are we from the goal?
wrong = sum([1 if state[i] != GOAL[i] else 0
for i in range(len(state))])
missing = len(GOAL) - len(state)
return wrong + missing
problem = HelloProblem(initial_state='')
result = astar(problem)
print result.state
print result.path()
More detailed documentation
===========================

You can read the docs online `here <http://simpleai.readthedocs.org/en/latest/>`_. Or for offline access, you can clone the project code repository and read them from the ``docs`` folder.


Authors
=======

* Juan Pedro Fisanotti <[email protected]>
* Rafael Carrascosa <[email protected]>
* Santiago Romero <[email protected]>
* Gonzalo García Berrotarán <[email protected]>

Special acknowledgements to `Machinalis <http://www.machinalis.com/>`_ for the
time provided to work on this project.
24 changes: 24 additions & 0 deletions AI_A_Modern_Approach_Russell_Norvig/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from distutils.core import setup

setup(
name='simpleai',
version='0.5.3',
description=u'An implementation of AI algorithms based on aima-python',
long_description=open('README.rst').read(),
author = u'Juan Pedro Fisanotti',
author_email = '[email protected]',
url='http://github.com/simpleai-team/simpleai',
packages=['simpleai', 'simpleai.search', 'simpleai.machine_learning'],
license='LICENSE.txt',
classifiers = [
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
],
)
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-

from simpleai.machine_learning.models import ClassificationProblem, \
VectorDataClassificationProblem, \
Attribute, VectorIndexAttribute, \
is_attribute, \
Classifier
from simpleai.machine_learning.classifiers import DecisionTreeLearner, \
DecisionTreeLearner_Queued, \
DecisionTreeLearner_LargeData, \
NaiveBayes, \
KNearestNeighbors
from simpleai.machine_learning.evaluation import precision, kfold
Loading

0 comments on commit d32c78b

Please sign in to comment.