Skip to content

Commit

Permalink
Update README, travis files, and tests.py
Browse files Browse the repository at this point in the history
change test
  • Loading branch information
tcfuji committed Feb 18, 2016
1 parent cf579a5 commit df0f07f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ virtualenv:
env:
matrix:
# let's start simple:
- PYTHON_VERSION="2.7" LATEST="true" "DEAP_VERSION=1.0.1"
- PYTHON_VERSION="3.4" LATEST="true" "DEAP_VERSION=1.0.1"
- PYTHON_VERSION="3.4" COVERAGE="true" LATEST="true" "DEAP_VERSION=1.0.1"
- PYTHON_VERSION="3.5" LATEST="true" "DEAP_VERSION=1.0.1"
- PYTHON_VERSION="2.7" LATEST="true" "DEAP_VERSION=1.0.1" "XGBOOST_VERSION=0.4a30"
- PYTHON_VERSION="3.4" LATEST="true" "DEAP_VERSION=1.0.1" "XGBOOST_VERSION=0.4a30"
- PYTHON_VERSION="3.4" COVERAGE="true" LATEST="true" "DEAP_VERSION=1.0.1" "XGBOOST_VERSION=0.4a30"
- PYTHON_VERSION="3.5" LATEST="true" "DEAP_VERSION=1.0.1" "XGBOOST_VERSION=0.4a30"
install: source ./ci/.travis_install.sh
script: bash ./ci/.travis_test.sh
after_success:
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ TPOT is built on top of several existing Python libraries, including:

* DEAP

* XGBoost

Except for DEAP, all of the necessary Python packages can be installed via the [Anaconda Python distribution](https://www.continuum.io/downloads), which we strongly recommend that you use. We also strongly recommend that you use of Python 3 over Python 2 if you're given the choice.

NumPy, SciPy, pandas, and scikit-learn can be installed in Anaconda via the command:
Expand All @@ -51,12 +53,14 @@ NumPy, SciPy, pandas, and scikit-learn can be installed in Anaconda via the comm
conda install numpy scipy pandas scikit-learn
```

DEAP can be installed with `pip` via the command:
DEAP and XGBoost can be installed with `pip` via the command:

```Shell
pip install deap
pip install deap xgboost
```

Optional: For OS X users who want to use OpenMP-enabled compilers to install XGBoost, gcc-5.x.x can be installed with Homebrew: `brew install gcc --without-multilib`.

Finally to install TPOT itself, run the following command:

```Shell
Expand Down
2 changes: 2 additions & 0 deletions ci/.travis_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ fi

source activate testenv
pip install deap==$DEAP_VERSION
pip install xgboost==$XGBOOST_VERSION

if [[ "$COVERAGE" == "true" ]]; then
pip install coverage coveralls
Expand All @@ -56,4 +57,5 @@ python -c "import scipy; print('scipy %s' % scipy.__version__)"
python -c "import sklearn; print('sklearn %s' % sklearn.__version__)"
python -c "import pandas; print('pandas %s' % pandas.__version__)"
python -c "import deap; print('deap %s' % deap.__version__)"
python -c "import xgboost; print('xgboost %s ' % xgboost.__version__)"
python setup.py build_ext --inplace
5 changes: 3 additions & 2 deletions ci/.travis_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ python -c "import scipy; print('scipy %s' % scipy.__version__)"
python -c "import sklearn; print('sklearn %s' % sklearn.__version__)"
python -c "import pandas; print('pandas %s' % pandas.__version__)"
python -c "import deap; print('deap %s' % deap.__version__)"
python -c "import xgboost; print('xgboost %s ' % xgboost.__version__)"

if [[ "$COVERAGE" == "true" ]]; then
nosetests -s -v --with-coverage
nosetests -s -v --with-coverage
else
nosetests -s -v
nosetests -s -v
fi
#make test-doc test-sphinxext
5 changes: 3 additions & 2 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from sklearn.linear_model import LogisticRegression
from sklearn.neighbors import KNeighborsClassifier

from xgboost import XGBClassifier

# Set up the iris data set for testing
mnist_data = load_digits()
Expand Down Expand Up @@ -88,10 +89,10 @@ def test_xgboost():
'''

tpot_obj = TPOT()
result = tpot_obj.xgboost(training_testing_data, 100, 0)
result = tpot_obj.xgradient_boosting(training_testing_data, n_estimators=100, learning_rate=0, max_depth=3)
result = result[result['group'] == 'testing']

xgb = XGBClassifier(n_estimators=100, max_depth=None, seed=42)
xgb = XGBClassifier(n_estimators=100, learning_rate=0.0001, max_depth=3, seed=42)
xgb.fit(training_features, training_classes)

assert np.array_equal(result['guess'].values, xgb.predict(testing_features))
Expand Down

0 comments on commit df0f07f

Please sign in to comment.