Building and running Bear

Bear is written in ANSI C (C89) with minimal dependencies.

Bear will build itself, but you need to have some code development tools installed.

Building Bear

I provide detailed instructions for building and running Bear. You can do it:

Either way, first download this file:

and untar it:

$ tar -xf bear.tar.gz

You will see a _README file.

To build and run on your own Mac or Linux machine, follow the instructions in Section 1 of the _README file.

To build and run on AWS EC2, follow the instructions in Section 2 of the _README file.

For working through the Bear tutorials, add its bin directory to your path:

$ export PATH=`pwd`/build/opt/bin:$PATH

You can check that it is set correctly with

$ which memory_bear

If you intend to use this installation more permanently, add the path export to one of your profile files.

Not building Bear

You can also work through the Bear tutorials without building Bear at all. I provide all of Bear’s output.

Testing your build of Bear

If you added Bear to your path, then just run this command:

$ memory_bear

You should see output that looks something like this:

The help screen that you should get from memory_bear if
      you run it with no arguments

The help screen that you should get from memory_bear if you run it with no arguments

Bear is running properly if you see this.

Included programs

Your build of Bear contains ten programs:

memory_bear
In-memory implementation of Bear. See the simple tutorial and the intermediate tutorial to learn how to use it.
bear_model_details
Print or save some high-level details of the individual models within any saved Bear model file.
bear_model_features
Print or save the features actually used in a Bear model file.
bear_features_list
Print the list of feature names for an input file with a header row; useful for understanding the features used in a Bear model file.
bear_predict
Stream production data through a Bear model created by memory_bear. See the simple tutorial.
simple_bear_tutorial_data
Creates the data used in the simple tutorial and the first part of intermediate tutorial.
intermediate_bear_tutorial_data
Creates the other data used in the intermediate tutorial.
intermediate_bear_tutorial_reformat
Reformats the data created by the above program and the output from Bear so that it can be easily visualized in Microsoft Excel.
spiral_classification_data
Creates the spiral classification data used at the end of the intermediate tutorial.
compare_data
Simple program for comparing two data text files for essential equality. Handles different default format and round-off from Python.

I also include 107 executables of unit tests and death tests for the classes supporting Bear, if you are interested.

Old versions

All released versions of Bear are here.

Bear predictions from within Python

To use a Bear model to make predictions from within a Python script, use my Python implementation of bear_predict:

The Python script bear_predict.py should be functionally equivalent to bear_predict, but may not be as performant.

Fine print

These Bear pages describe personal hobby research that I have undertaken since 2008.

All opinions are mine alone. All code is from my personal codebase, supplied under the MIT License.