Skip to content

Commit

Permalink
Merge pull request #14 from csinva/python3.8-support
Browse files Browse the repository at this point in the history
Python3.8 support
  • Loading branch information
csinva authored Dec 4, 2020
2 parents d66f74d + 3b7b76f commit 098a129
Show file tree
Hide file tree
Showing 3 changed files with 873 additions and 10 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@

name: tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]
python-version: [3.7, 3.8.5]

steps:
- uses: actions/checkout@v2
Expand All @@ -26,7 +22,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install . --no-cache-dir
- name: Test with pytest
run: |
pytest
10 changes: 7 additions & 3 deletions tests/brl_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import unittest
from urllib.request import urlretrieve

import numpy as np
from scipy.io.arff import loadarff
from sklearn.datasets import fetch_openml
from sklearn.model_selection import train_test_split

Expand Down Expand Up @@ -30,9 +32,11 @@ def test_integration_fitting(self):
"Triceps skin fold thickness(mm)",
"2-Hour serum insulin (mu U/ml)", "Body mass index", "Diabetes pedigree function",
"Age (years)"]
data = fetch_openml("diabetes") # get dataset
X = data.data
y = (data.target == 'tested_positive').astype(np.int) # labels 0-1

data = loadarff("tests/test_data/diabetes.arff")
data_np = np.array(list(map(lambda x: np.array(list(x)), data[0])))
X, y_text = data_np[:, :-1].astype('float32'), data_np[:, -1].astype('str')
y = (y_text == 'tested_positive').astype(np.int) # labels 0-1

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.75) # split

Expand Down
Loading

0 comments on commit 098a129

Please sign in to comment.