Skip to content

Commit d32c78b

Browse files
author
BB
committed
Initial commit
0 parents  commit d32c78b

File tree

23,744 files changed

+8967706
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

23,744 files changed

+8967706
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2012 Juan Pedro Fisanotti <fisadev@gmail.com>, Rafael Carrascosa <rcarrascosa@machinalis.com>, Santiago Romero <sromero@machinalis.com>
2+
3+
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:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
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.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
Metadata-Version: 1.1
2+
Name: simpleai
3+
Version: 0.5.3
4+
Summary: An implementation of AI algorithms based on aima-python
5+
Home-page: http://github.com/simpleai-team/simpleai
6+
Author: Juan Pedro Fisanotti
7+
Author-email: fisadev@gmail.com
8+
License: LICENSE.txt
9+
Description: Simple AI
10+
=========
11+
12+
Project home: http://github.com/simpleai-team/simpleai
13+
14+
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.
15+
16+
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.
17+
18+
At this moment, the implementation includes:
19+
20+
* Search
21+
* Traditional search algorithms (not informed and informed)
22+
* Local Search algorithms
23+
* Constraint Satisfaction Problems algorithms
24+
* Machine Learning
25+
* Statistical Classification
26+
27+
And we are working on an interactive execution viewer for search algorithms (display the search tree on each iteration).
28+
29+
30+
Installation
31+
============
32+
33+
Just get it:
34+
35+
.. code-block:: none
36+
37+
pip install simpleai
38+
39+
40+
Examples
41+
========
42+
43+
Simple AI allows you to define problems and look for the solution with
44+
different strategies. Another samples are in the ``samples`` directory, but
45+
here is an easy one.
46+
47+
This problem tries to create the string "HELLO WORLD" using the A* algorithm:
48+
49+
.. code-block:: python
50+
51+
52+
from simpleai.search import SearchProblem, astar
53+
54+
GOAL = 'HELLO WORLD'
55+
56+
class HelloProblem(SearchProblem):
57+
def actions(self, state):
58+
if len(state) < len(GOAL):
59+
return [c for c in ' ABCDEFGHIJKLMNOPQRSTUVWXYZ']
60+
else:
61+
return []
62+
63+
def result(self, state, action):
64+
return state + action
65+
66+
def is_goal(self, state):
67+
return state == GOAL
68+
69+
def heuristic(self, state):
70+
# how far are we from the goal?
71+
wrong = sum([1 if state[i] != GOAL[i] else 0
72+
for i in range(len(state))])
73+
missing = len(GOAL) - len(state)
74+
return wrong + missing
75+
76+
77+
problem = HelloProblem(initial_state='')
78+
result = astar(problem)
79+
80+
print result.state
81+
print result.path()
82+
83+
84+
More detailed documentation
85+
===========================
86+
87+
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.
88+
89+
90+
Authors
91+
=======
92+
93+
* Juan Pedro Fisanotti <fisadev@gmail.com>
94+
* Rafael Carrascosa <rcarrascosa@machinalis.com>
95+
* Santiago Romero <sromero@machinalis.com>
96+
* Gonzalo García Berrotarán <ggarcia@machinalis.com>
97+
98+
Special acknowledgements to `Machinalis <http://www.machinalis.com/>`_ for the
99+
time provided to work on this project.
100+
101+
Platform: UNKNOWN
102+
Classifier: Intended Audience :: Developers
103+
Classifier: License :: OSI Approved :: MIT License
104+
Classifier: Natural Language :: English
105+
Classifier: Operating System :: OS Independent
106+
Classifier: Programming Language :: Python
107+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
Simple AI
2+
=========
3+
4+
Project home: http://github.com/simpleai-team/simpleai
5+
6+
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.
7+
8+
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.
9+
10+
At this moment, the implementation includes:
11+
12+
* Search
13+
* Traditional search algorithms (not informed and informed)
14+
* Local Search algorithms
15+
* Constraint Satisfaction Problems algorithms
16+
* Machine Learning
17+
* Statistical Classification
18+
19+
And we are working on an interactive execution viewer for search algorithms (display the search tree on each iteration).
20+
21+
22+
Installation
23+
============
24+
25+
Just get it:
26+
27+
.. code-block:: none
28+
29+
pip install simpleai
30+
31+
32+
Examples
33+
========
34+
35+
Simple AI allows you to define problems and look for the solution with
36+
different strategies. Another samples are in the ``samples`` directory, but
37+
here is an easy one.
38+
39+
This problem tries to create the string "HELLO WORLD" using the A* algorithm:
40+
41+
.. code-block:: python
42+
43+
44+
from simpleai.search import SearchProblem, astar
45+
46+
GOAL = 'HELLO WORLD'
47+
48+
class HelloProblem(SearchProblem):
49+
def actions(self, state):
50+
if len(state) < len(GOAL):
51+
return [c for c in ' ABCDEFGHIJKLMNOPQRSTUVWXYZ']
52+
else:
53+
return []
54+
55+
def result(self, state, action):
56+
return state + action
57+
58+
def is_goal(self, state):
59+
return state == GOAL
60+
61+
def heuristic(self, state):
62+
# how far are we from the goal?
63+
wrong = sum([1 if state[i] != GOAL[i] else 0
64+
for i in range(len(state))])
65+
missing = len(GOAL) - len(state)
66+
return wrong + missing
67+
68+
69+
problem = HelloProblem(initial_state='')
70+
result = astar(problem)
71+
72+
print result.state
73+
print result.path()
74+
75+
76+
More detailed documentation
77+
===========================
78+
79+
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.
80+
81+
82+
Authors
83+
=======
84+
85+
* Juan Pedro Fisanotti <fisadev@gmail.com>
86+
* Rafael Carrascosa <rcarrascosa@machinalis.com>
87+
* Santiago Romero <sromero@machinalis.com>
88+
* Gonzalo García Berrotarán <ggarcia@machinalis.com>
89+
90+
Special acknowledgements to `Machinalis <http://www.machinalis.com/>`_ for the
91+
time provided to work on this project.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
from distutils.core import setup
5+
6+
setup(
7+
name='simpleai',
8+
version='0.5.3',
9+
description=u'An implementation of AI algorithms based on aima-python',
10+
long_description=open('README.rst').read(),
11+
author = u'Juan Pedro Fisanotti',
12+
author_email = 'fisadev@gmail.com',
13+
url='http://github.com/simpleai-team/simpleai',
14+
packages=['simpleai', 'simpleai.search', 'simpleai.machine_learning'],
15+
license='LICENSE.txt',
16+
classifiers = [
17+
'Intended Audience :: Developers',
18+
'License :: OSI Approved :: MIT License',
19+
'Natural Language :: English',
20+
'Operating System :: OS Independent',
21+
'Programming Language :: Python',
22+
'Topic :: Scientific/Engineering :: Artificial Intelligence',
23+
],
24+
)

AI_A_Modern_Approach_Russell_Norvig/simpleai/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# -*- coding: utf-8 -*-
2+
3+
from simpleai.machine_learning.models import ClassificationProblem, \
4+
VectorDataClassificationProblem, \
5+
Attribute, VectorIndexAttribute, \
6+
is_attribute, \
7+
Classifier
8+
from simpleai.machine_learning.classifiers import DecisionTreeLearner, \
9+
DecisionTreeLearner_Queued, \
10+
DecisionTreeLearner_LargeData, \
11+
NaiveBayes, \
12+
KNearestNeighbors
13+
from simpleai.machine_learning.evaluation import precision, kfold

0 commit comments

Comments
 (0)