The “mysterious Universe” data science project

Welcome to the docs. I hope these are informative enough.

Tutorial

This demonstrates how to use the DeepThought class to deal with your personal philosophical issues.

Initial steps

First, let us import the what we need.

[1]:
import sys
sys.path.append('../src')

from features import computer

We will be using an instance of the special computer named DeepThought

[2]:
thinker = computer.DeepThought()

Finding the answer

The answer for “Ultimate Question of Life, the Universe, and Everything” can be easily computed.

[3]:
thinker.get_the_answer()
[3]:
42

Finding the question

The frustrating thing about finding the answer to “Ultimate Question of Life, the Universe, and Everything” is that “the Question” is actually a harder problem.

For those in a hurry

If you don’t too much time in your hands, you can get away with “a question” (which may or may not be the right one). This can be done using the following method:

[4]:
thinker.get_a_question()
[4]:
'What do you get if you multiply six by nine?'

Note that this may change if re-executed… therefore, we added the tag: ``nbval-ignore-output`` to it

[5]:
thinker.get_a_question()
[5]:
'How many roads must a man walk down?'

For those with time

You may want to execute the following command to get a definite answer…

[6]:
thinker.get_the_question()
This may take some time...
...
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-6-8fb74e69032b> in <module>
----> 1 thinker.get_the_question()

~/notebooks-for-docs-and-tests-demo/src/features/computer.py in get_the_question(self)
     52             print('This may take some time...')
     53             print('...')
---> 54             time.sleep(10)
     55
     56         return thingy.something

KeyboardInterrupt:

The above execution was interrupted due to the demo’s time constraints.

To to prevent it from entering the validation, we added the tag ``nbval-skip`` to it.

src package

Subpackages

src.data package

Submodules
src.data.make_dataset module

src.features package

Submodules
src.features.build_features module
src.features.computer module
class src.features.computer.DeepThought(questions=None)[source]

Bases: object

Designed to allow better examining the “Ultimate Question of Life, the Universe, and Everything” [1]

1
  1. Adams, “The Hitchhiker’s Guide to the Galaxy”

Parameters

questions (list) – Optional list of potential “Ultimate Questions..”. If absent, common sense will be used.

get_a_question()[source]

Finds a (possible) “Ultimate Question of Life, the Universe, and Everything”

Note

This may or may not be satisfying… but it is a bit better than waiting.

Returns

question – A… question!

Return type

str

get_the_answer()[source]

Finds the answer for the “Ultimate Question of Life, the Universe, and Everything”!

Returns

question – The Answer!

Return type

str

get_the_question()[source]

Finds the “Ultimate Question of Life, the Universe, and Everything”!

Returns

question – The Question!

Return type

str

src.features.thingy module

Something may be happening here… but I will not tell you

src.models package

Submodules
src.models.predict_model module
src.models.train_model module

src.visualization package

Submodules
src.visualization.visualize module

Indices and tables