Skip to content

Commit

Permalink
Extend backwards compatibility by refactoring dependency handling, te…
Browse files Browse the repository at this point in the history
…sts & examples
  • Loading branch information
Darius Morawiec committed Jan 29, 2017
1 parent ee66a1d commit d038ade
Show file tree
Hide file tree
Showing 48 changed files with 223 additions and 148 deletions.
15 changes: 7 additions & 8 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: sklearn-porter
dependencies:
- libgcc=4.8.5=1
- mkl=11.3.3=0
- numpy=1.11.2=py27_0
- openssl=1.0.2j=0
- pip=8.1.2=py27_0
- python=2.7.12=1
- mkl=2017.0.1=0
- numpy=1.11.3=py27_0
- openssl=1.0.2k=0
- pip=9.0.1=py27_1
- python=2.7.13=0
- readline=6.2=2
- scikit-learn=0.18=np111py27_0
- scipy=0.18.1=np111py27_0
- scikit-learn=0.18.1=np111py27_1
- scipy=0.18.1=np111py27_1
- setuptools=27.2.0=py27_0
- sqlite=3.13.0=0
- tk=8.5.18=0
Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/AdaBoostClassifier/c/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
base_estimator = DecisionTreeClassifier(max_depth=4, random_state=0)
clf = AdaBoostClassifier(base_estimator=base_estimator, n_estimators=100,
random_state=0)
Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/AdaBoostClassifier/java/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
base_estimator = DecisionTreeClassifier(max_depth=4, random_state=0)
clf = AdaBoostClassifier(base_estimator=base_estimator, n_estimators=100,
random_state=0)
Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/AdaBoostClassifier/js/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
base_estimator = DecisionTreeClassifier(max_depth=4, random_state=0)
clf = AdaBoostClassifier(base_estimator=base_estimator, n_estimators=100,
random_state=0)
Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/BernoulliNB/java/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = BernoulliNB()
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/DecisionTreeClassifier/c/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = tree.DecisionTreeClassifier()
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/DecisionTreeClassifier/java/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = tree.DecisionTreeClassifier()
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/DecisionTreeClassifier/js/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = tree.DecisionTreeClassifier()
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/DecisionTreeClassifier/php/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = tree.DecisionTreeClassifier()
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/ExtraTreesClassifier/c/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = ExtraTreesClassifier(n_estimators=15, random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/ExtraTreesClassifier/java/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = ExtraTreesClassifier(n_estimators=15, random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/ExtraTreesClassifier/js/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = ExtraTreesClassifier(n_estimators=15, random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/GaussianNB/java/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = GaussianNB()
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/KNeighborsClassifier/java/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = KNeighborsClassifier(algorithm='brute', n_neighbors=3, weights='uniform')
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/KNeighborsClassifier/js/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = KNeighborsClassifier(algorithm='brute', n_neighbors=3, weights='uniform')
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/LinearSVC/c/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = svm.LinearSVC(C=1., random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/LinearSVC/c/compiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = svm.LinearSVC(C=1., random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/LinearSVC/go/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = svm.LinearSVC(C=1., random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/LinearSVC/java/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = svm.LinearSVC(C=1., random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/LinearSVC/js/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = svm.LinearSVC(C=1., random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/LinearSVC/php/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = svm.LinearSVC(C=1., random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/LinearSVC/ruby/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = svm.LinearSVC(C=1., random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/MLPClassifier/java/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target

X = shuffle(X, random_state=0)
y = shuffle(y, random_state=0)
Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/MLPClassifier/js/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target

X = shuffle(X, random_state=0)
y = shuffle(y, random_state=0)
Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/NuSVC/c/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = svm.NuSVC(gamma=0.001, kernel='rbf', random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/NuSVC/java/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = svm.NuSVC(gamma=0.001, kernel='rbf', random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/NuSVC/js/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = svm.NuSVC(gamma=0.001, kernel='rbf', random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/NuSVC/php/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = svm.NuSVC(gamma=0.001, kernel='rbf', random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/RandomForestClassifier/c/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = RandomForestClassifier(n_estimators=15, max_depth=None,
min_samples_split=2, random_state=0)
clf.fit(X, y)
Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/RandomForestClassifier/java/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = RandomForestClassifier(n_estimators=15, max_depth=None,
min_samples_split=2, random_state=0)
clf.fit(X, y)
Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/RandomForestClassifier/js/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = RandomForestClassifier(n_estimators=15, max_depth=None,
min_samples_split=2, random_state=0)
clf.fit(X, y)
Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/SVC/c/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = svm.SVC(C=1., gamma=0.001, kernel='rbf', random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/SVC/java/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = svm.SVC(C=1., gamma=0.001, kernel='rbf', random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/SVC/js/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = svm.SVC(C=1., gamma=0.001, kernel='rbf', random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/classifier/SVC/php/basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from sklearn_porter import Porter


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = svm.SVC(C=1., gamma=0.001, kernel='rbf', random_state=0)
clf.fit(X, y)

Expand Down
3 changes: 2 additions & 1 deletion examples/cli/dump_pickle_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
from sklearn.externals import joblib


X, y = load_iris(return_X_y=True)
iris_data = load_iris()
X, y = iris_data.data, iris_data.target
clf = tree.DecisionTreeClassifier()
clf.fit(X, y)

Expand Down
2 changes: 1 addition & 1 deletion license.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2016, Darius Morawiec
Copyright 2016-2017, Darius Morawiec

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
Loading

0 comments on commit d038ade

Please sign in to comment.