aimodelshare 0.1.3__tar.gz → 0.1.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of aimodelshare might be problematic. Click here for more details.
- {aimodelshare-0.1.3/aimodelshare.egg-info → aimodelshare-0.1.5}/PKG-INFO +1 -3
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/aimsonnx.py +20 -10
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/api.py +2 -1
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/eval_lambda.txt +14 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/playground.py +8 -1
- {aimodelshare-0.1.3 → aimodelshare-0.1.5/aimodelshare.egg-info}/PKG-INFO +1 -3
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare.egg-info/requires.txt +1 -1
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/setup.py +2 -2
- aimodelshare-0.1.5/tests/test_aimsonnx.py +135 -0
- aimodelshare-0.1.5/tests/test_playground.py +721 -0
- aimodelshare-0.1.3/tests/test_aimsonnx.py +0 -0
- aimodelshare-0.1.3/tests/test_playground.py +0 -345
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/LICENSE +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/MANIFEST.in +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/README.md +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/README.md +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/__init__.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/aws.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/aws_client.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/base_image.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/bucketpolicy.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/color_mappings/color_mapping_keras.csv +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/color_mappings/color_mapping_pytorch.csv +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/containerisation.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/containerization.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/containerization_templates/Dockerfile.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/containerization_templates/Dockerfile_PySpark.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/containerization_templates/buildspec.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/containerization_templates/lambda_function.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/custom_approach/__init__.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/custom_approach/lambda_function.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/custom_eval_metrics.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/data_sharing/__init__.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/data_sharing/data_sharing_templates/Dockerfile.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/data_sharing/data_sharing_templates/__init__.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/data_sharing/data_sharing_templates/buildspec.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/data_sharing/data_sharing_templates/codebuild_policies.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/data_sharing/data_sharing_templates/codebuild_trust_relationship.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/data_sharing/download_data.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/data_sharing/share_data.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/data_sharing/utils.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/deploy_custom_lambda.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/Makefile +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/__init__.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/_version.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/breadcrumbs.html +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/layout.html +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/search.html +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/searchbox.html +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/static/css/custom.css +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/static/css/custom.css.map +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/static/css/theme.css +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/static/css/theme.css.map +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/static/css/theme.min.css +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/static/css/theme.min.css.map +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/static/font/fontello.eot +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/static/font/fontello.svg +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/static/font/fontello.ttf +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/static/font/fontello.woff +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/static/font/fontello.woff2 +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/static/js/theme.js +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/karma_sphinx_theme/theme.conf +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/make.bat +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/requirements.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/about.rst +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/advanced_features.rst +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/competition.rst +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/conf.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/create_credentials.rst +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/example_notebooks.rst +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/functions.rst +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/gettingstarted.rst +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/images/creds1.png +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/images/creds2.png +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/images/creds3.png +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/images/creds4.png +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/images/creds5.png +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/images/creds_file_example.png +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/images/predict_tab.png +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/index.rst +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/documentation/source/modelplayground.rst +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/exceptions.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/generatemodelapi.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/iam/codebuild_policy.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/iam/codebuild_trust_relationship.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/iam/lambda_policy.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/iam/lambda_trust_relationship.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/json_templates/__init__.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/json_templates/api_json.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/json_templates/auth/policy.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/json_templates/auth/role.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/json_templates/eval/policy.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/json_templates/eval/role.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/json_templates/function/policy.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/json_templates/function/role.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/json_templates/integration_response.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/json_templates/lambda_policy_1.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/json_templates/lambda_policy_2.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/json_templates/lambda_role_1.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/json_templates/lambda_role_2.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/leaderboard.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/1.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/1B.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/2.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/3.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/4.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/5.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/6.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/7.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/8.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/__init__.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/authorization.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/eval_classification.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/eval_regression.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/lambda_function.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/main/nst.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/model.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/modeluser.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/placeholders/model.onnx +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/placeholders/preprocessor.zip +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/postprocessormodules.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/preprocessormodules.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/1.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/1B.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/2.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/3.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/4.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/5.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/6.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/7.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/8.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/__init__.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/authorization.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/eval_classification.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/eval_lambda.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/eval_regression.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/lambda_function.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/pyspark/nst.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/python/my_preprocessor.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/readme.md +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/reproducibility.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/sam/Dockerfile.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/sam/Dockerfile_PySpark.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/sam/__init__.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/sam/buildspec.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/sam/codebuild_policies.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/sam/codebuild_trust_relationship.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/sam/codepipeline_policies.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/sam/codepipeline_trust_relationship.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/sam/spark-class.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/sam/template.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/tools.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare/utils.py +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare.egg-info/SOURCES.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare.egg-info/dependency_links.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/aimodelshare.egg-info/top_level.txt +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/setup.cfg +0 -0
- {aimodelshare-0.1.3 → aimodelshare-0.1.5}/tests/__init__.py +0 -0
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: aimodelshare
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: Deploy locally saved machine learning models to a live rest API and web-dashboard. Share it with the world via modelshare.org
|
|
5
5
|
Home-page: https://www.modelshare.org
|
|
6
6
|
Author: Michael Parrott
|
|
7
7
|
Author-email: mikedparrott@modelshare.org
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Platform: UNKNOWN
|
|
10
8
|
Classifier: Programming Language :: Python :: 3
|
|
11
9
|
Classifier: License :: Other/Proprietary License
|
|
12
10
|
Classifier: Operating System :: OS Independent
|
|
@@ -3,25 +3,36 @@ import pandas as pd
|
|
|
3
3
|
import numpy as np
|
|
4
4
|
|
|
5
5
|
# ml frameworks
|
|
6
|
-
|
|
7
6
|
try:
|
|
8
7
|
import sklearn
|
|
9
8
|
from sklearn.model_selection import GridSearchCV, RandomizedSearchCV
|
|
10
9
|
except:
|
|
11
|
-
|
|
10
|
+
print("Warning: Please install sklearn to enable sklearn features")
|
|
11
|
+
|
|
12
12
|
try:
|
|
13
13
|
import torch
|
|
14
14
|
except:
|
|
15
|
-
|
|
15
|
+
print("Warning: Please install pytorch to enable pytorch features")
|
|
16
|
+
|
|
16
17
|
try:
|
|
17
18
|
import xgboost
|
|
18
19
|
except:
|
|
19
|
-
|
|
20
|
+
print("Warning: Please install xgboost to enable xgboost features")
|
|
21
|
+
|
|
20
22
|
try:
|
|
21
23
|
import tensorflow as tf
|
|
22
24
|
import keras
|
|
23
25
|
except:
|
|
24
|
-
|
|
26
|
+
print("Warning: Please install tensorflow/keras to enable tensorflow/keras features")
|
|
27
|
+
|
|
28
|
+
try:
|
|
29
|
+
import pyspark
|
|
30
|
+
from pyspark.sql import SparkSession
|
|
31
|
+
from pyspark.ml import PipelineModel, Model
|
|
32
|
+
from pyspark.ml.tuning import CrossValidatorModel, TrainValidationSplitModel
|
|
33
|
+
from onnxmltools import convert_sparkml
|
|
34
|
+
except:
|
|
35
|
+
print("Warning: Please install pyspark to enable pyspark features")
|
|
25
36
|
|
|
26
37
|
|
|
27
38
|
# onnx modules
|
|
@@ -1184,7 +1195,6 @@ def onnx_to_image(model):
|
|
|
1184
1195
|
return pydot_graph
|
|
1185
1196
|
|
|
1186
1197
|
|
|
1187
|
-
|
|
1188
1198
|
def inspect_model(apiurl, version=None, naming_convention = None, submission_type="competition"):
|
|
1189
1199
|
if all(["username" in os.environ,
|
|
1190
1200
|
"password" in os.environ]):
|
|
@@ -1582,9 +1592,9 @@ def model_from_string(model_type):
|
|
|
1582
1592
|
def _get_pyspark_modules():
|
|
1583
1593
|
try:
|
|
1584
1594
|
if pyspark is None:
|
|
1585
|
-
raise("Error: Please install pyspark to enable pyspark features")
|
|
1595
|
+
raise Exception("Error: Please install pyspark to enable pyspark features")
|
|
1586
1596
|
except:
|
|
1587
|
-
raise("Error: Please install pyspark to enable pyspark features")
|
|
1597
|
+
raise Exception("Error: Please install pyspark to enable pyspark features")
|
|
1588
1598
|
|
|
1589
1599
|
pyspark_modules = ['ml', 'ml.feature', 'ml.classification', 'ml.clustering', 'ml.regression']
|
|
1590
1600
|
|
|
@@ -1603,9 +1613,9 @@ def _get_pyspark_modules():
|
|
|
1603
1613
|
def pyspark_model_from_string(model_type):
|
|
1604
1614
|
try:
|
|
1605
1615
|
if pyspark is None:
|
|
1606
|
-
raise("Error: Please install pyspark to enable pyspark features")
|
|
1616
|
+
raise Exception("Error: Please install pyspark to enable pyspark features")
|
|
1607
1617
|
except:
|
|
1608
|
-
raise("Error: Please install pyspark to enable pyspark features")
|
|
1618
|
+
raise Exception("Error: Please install pyspark to enable pyspark features")
|
|
1609
1619
|
|
|
1610
1620
|
models_modules_dict = _get_pyspark_modules()
|
|
1611
1621
|
module = models_modules_dict[model_type]
|
|
@@ -211,7 +211,8 @@ class create_prediction_api_class():
|
|
|
211
211
|
###
|
|
212
212
|
api_key = str(shortuuid.uuid())
|
|
213
213
|
|
|
214
|
-
t = Template(pkg_resources.read_text(main, 'eval_lambda.txt').replace("$apikey",api_key))
|
|
214
|
+
t = Template(pkg_resources.read_text(main, 'eval_lambda.txt').replace("$apikey",api_key).replace("$task_type",self.task_type))
|
|
215
|
+
|
|
215
216
|
data = t.substitute(bucket_name = self.bucket_name, unique_model_id = self.unique_model_id, task_type = self.task_type)
|
|
216
217
|
with open(os.path.join(self.temp_dir, 'main.py'), 'w') as file:
|
|
217
218
|
file.write(data)
|
|
@@ -33,6 +33,20 @@ def handler(event, context):
|
|
|
33
33
|
if value == "None":
|
|
34
34
|
body[key]=None
|
|
35
35
|
|
|
36
|
+
|
|
37
|
+
if body.get("return_task_type","ALL") == "True" or body.get("return_task_type", "ALL") == "TRUE":
|
|
38
|
+
task_type="$task_type"
|
|
39
|
+
task_type_dict = {"statusCode": 200,
|
|
40
|
+
"headers": {
|
|
41
|
+
"Access-Control-Allow-Origin" : "*",
|
|
42
|
+
"Access-Control-Allow-Credentials": True,
|
|
43
|
+
"Allow" : "GET, OPTIONS, POST",
|
|
44
|
+
"Access-Control-Allow-Methods" : "GET, OPTIONS, POST",
|
|
45
|
+
"Access-Control-Allow-Headers" : "*"},
|
|
46
|
+
"body": json.dumps({"task_type":task_type})
|
|
47
|
+
}
|
|
48
|
+
return task_type_dict
|
|
49
|
+
|
|
36
50
|
if body.get("exampledata", "ALL") == "True" or body.get("exampledata", "ALL") == "TRUE":
|
|
37
51
|
|
|
38
52
|
exampledata=get_exampledata(example_data_filename = "exampledata.json")
|
|
@@ -50,6 +50,13 @@ class ModelPlayground:
|
|
|
50
50
|
|
|
51
51
|
self.model_type = input_type
|
|
52
52
|
|
|
53
|
+
if task_type == None:
|
|
54
|
+
post_dict = {"return_task_type": "TRUE"}
|
|
55
|
+
headers = { 'Content-Type':'application/json', 'authorizationToken': os.environ.get("AWS_TOKEN"),}
|
|
56
|
+
playground_url_eval=playground_url[:-1]+"eval"
|
|
57
|
+
response = requests.post(playground_url_eval,headers=headers,data=json.dumps(post_dict))
|
|
58
|
+
task_type = json.loads(response.text)['task_type']
|
|
59
|
+
|
|
53
60
|
if task_type == "classification":
|
|
54
61
|
self.categorical = True
|
|
55
62
|
elif task_type == "regression":
|
|
@@ -786,7 +793,7 @@ class ModelPlayground:
|
|
|
786
793
|
eval_metric_filepath=eval_metric_filepath,
|
|
787
794
|
email_list=email_list,
|
|
788
795
|
public=public,
|
|
789
|
-
public_private_split=
|
|
796
|
+
public_private_split=0, #set to 0 because its an experiment
|
|
790
797
|
input_dict=exp_input_dict,
|
|
791
798
|
print_output=False)
|
|
792
799
|
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: aimodelshare
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: Deploy locally saved machine learning models to a live rest API and web-dashboard. Share it with the world via modelshare.org
|
|
5
5
|
Home-page: https://www.modelshare.org
|
|
6
6
|
Author: Michael Parrott
|
|
7
7
|
Author-email: mikedparrott@modelshare.org
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Platform: UNKNOWN
|
|
10
8
|
Classifier: Programming Language :: Python :: 3
|
|
11
9
|
Classifier: License :: Other/Proprietary License
|
|
12
10
|
Classifier: Operating System :: OS Independent
|
|
@@ -6,7 +6,7 @@ with open("README.md", "r") as fh:
|
|
|
6
6
|
|
|
7
7
|
setuptools.setup(
|
|
8
8
|
name='aimodelshare', #TODO:update
|
|
9
|
-
version='0.1.
|
|
9
|
+
version='0.1.5', #TODO:update
|
|
10
10
|
author="Michael Parrott",
|
|
11
11
|
author_email="mikedparrott@modelshare.org",
|
|
12
12
|
description="Deploy locally saved machine learning models to a live rest API and web-dashboard. Share it with the world via modelshare.org",
|
|
@@ -14,7 +14,7 @@ setuptools.setup(
|
|
|
14
14
|
long_description_content_type="text/markdown",
|
|
15
15
|
url="https://www.modelshare.org",
|
|
16
16
|
packages=setuptools.find_packages(),
|
|
17
|
-
install_requires=["boto3==1.26.69", "botocore==1.29.82","scikit-learn==1.2.2","onnx
|
|
17
|
+
install_requires=["boto3==1.26.69", "botocore==1.29.82","scikit-learn==1.2.2","onnx==1.13.1","onnxconverter-common>=1.7.0", "regex",
|
|
18
18
|
"keras2onnx>=1.7.0","tensorflow>=2.12","tf2onnx","skl2onnx>=1.14.0","onnxruntime>=1.7.0","torch>=1.8.1","pydot==1.3.0","importlib-resources==5.10.0",
|
|
19
19
|
"onnxmltools>=1.6.1","Pympler==0.9","docker==5.0.0","wget==3.2","PyJWT>=2.4.0","seaborn>=0.11.2","astunparse==1.6.3","shortuuid>=1.0.8","psutil>=5.9.1","pathlib>=1.0.1",
|
|
20
20
|
"protobuf>=3.20.1", "dill"],
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
from aimodelshare.aimsonnx import _get_layer_names
|
|
2
|
+
from aimodelshare.aimsonnx import _get_layer_names_pytorch
|
|
3
|
+
from aimodelshare.aimsonnx import _get_sklearn_modules
|
|
4
|
+
from aimodelshare.aimsonnx import model_from_string
|
|
5
|
+
from aimodelshare.aimsonnx import _get_pyspark_modules
|
|
6
|
+
from aimodelshare.aimsonnx import pyspark_model_from_string
|
|
7
|
+
from aimodelshare.aimsonnx import layer_mapping
|
|
8
|
+
from aimodelshare.aimsonnx import _sklearn_to_onnx
|
|
9
|
+
from aimodelshare.aimsonnx import _pyspark_to_onnx
|
|
10
|
+
from aimodelshare.aimsonnx import _keras_to_onnx
|
|
11
|
+
from aimodelshare.aimsonnx import _pytorch_to_onnx
|
|
12
|
+
from aimodelshare.aimsonnx import _misc_to_onnx
|
|
13
|
+
from sklearn.linear_model import LogisticRegression
|
|
14
|
+
from sklearn.neural_network import MLPClassifier
|
|
15
|
+
import onnx
|
|
16
|
+
from xgboost import XGBClassifier
|
|
17
|
+
from pyspark.ml.classification import RandomForestClassifier, MultilayerPerceptronClassifier
|
|
18
|
+
from keras.models import Sequential
|
|
19
|
+
from torch import nn
|
|
20
|
+
import torch
|
|
21
|
+
from tensorflow.keras.layers import Dense
|
|
22
|
+
|
|
23
|
+
def test_sklearn_to_onnx():
|
|
24
|
+
|
|
25
|
+
from sklearn.datasets import load_iris
|
|
26
|
+
data = load_iris()
|
|
27
|
+
X = data.data
|
|
28
|
+
y = data.target
|
|
29
|
+
|
|
30
|
+
model = LogisticRegression(C=10, penalty='l1', solver='liblinear')
|
|
31
|
+
model.fit(X, y)
|
|
32
|
+
onnx_model = _sklearn_to_onnx(model)
|
|
33
|
+
assert isinstance(onnx_model, onnx.ModelProto)
|
|
34
|
+
|
|
35
|
+
# model = MLPClassifier()
|
|
36
|
+
# model.fit(X, y)
|
|
37
|
+
# onnx_model = _sklearn_to_onnx(model)
|
|
38
|
+
# assert isinstance(onnx_model, onnx.ModelProto)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# def test_misc_to_onnx():
|
|
42
|
+
#
|
|
43
|
+
# model = XGBClassifier()
|
|
44
|
+
# onnx_model = _misc_to_onnx(model)
|
|
45
|
+
# assert isinstance(onnx_model, onnx.ModelProto)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# def test_pyspark_to_onnx():
|
|
49
|
+
#
|
|
50
|
+
# model =RandomForestClassifier(labelCol="indexedLabel", featuresCol="indexedFeatures", numTrees=10)
|
|
51
|
+
# onnx_model = _pyspark_to_onnx(model)
|
|
52
|
+
# assert isinstance(onnx_model, onnx.ModelProto)
|
|
53
|
+
#
|
|
54
|
+
# model = MultilayerPerceptronClassifier()
|
|
55
|
+
# onnx_model = _pyspark_to_onnx(model)
|
|
56
|
+
# assert isinstance(onnx_model, onnx.ModelProto)
|
|
57
|
+
|
|
58
|
+
def test_keras_to_onnx():
|
|
59
|
+
|
|
60
|
+
model = Sequential()
|
|
61
|
+
model.add(Dense(12, input_shape=(8,), activation='relu'))
|
|
62
|
+
model.add(Dense(8, activation='relu'))
|
|
63
|
+
model.add(Dense(1, activation='sigmoid'))
|
|
64
|
+
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
|
|
65
|
+
|
|
66
|
+
onnx_model = _keras_to_onnx(model)
|
|
67
|
+
assert isinstance(onnx_model, onnx.ModelProto)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def test_pytorch_to_onnx():
|
|
71
|
+
|
|
72
|
+
model = nn.Sequential(nn.Linear(3, 3),
|
|
73
|
+
nn.ReLU(),
|
|
74
|
+
nn.Linear(3, 1),
|
|
75
|
+
nn.Sigmoid())
|
|
76
|
+
|
|
77
|
+
onnx_model = _pytorch_to_onnx(model, torch.randn(1, 3))
|
|
78
|
+
assert isinstance(onnx_model, onnx.ModelProto)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def test_get_layer_names():
|
|
82
|
+
|
|
83
|
+
layers = _get_layer_names()
|
|
84
|
+
|
|
85
|
+
assert isinstance(layers, tuple)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def test_get_layer_names_pytorch():
|
|
89
|
+
|
|
90
|
+
layers = _get_layer_names_pytorch()
|
|
91
|
+
|
|
92
|
+
assert isinstance(layers, tuple)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def test_get_sklearn_modules():
|
|
96
|
+
|
|
97
|
+
modules = _get_sklearn_modules()
|
|
98
|
+
|
|
99
|
+
assert isinstance(modules, dict)
|
|
100
|
+
|
|
101
|
+
def test_model_from_string():
|
|
102
|
+
|
|
103
|
+
model_class = model_from_string("RandomForestClassifier")
|
|
104
|
+
|
|
105
|
+
assert model_class.__name__ == "RandomForestClassifier"
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def test_get_pyspark_modules():
|
|
109
|
+
|
|
110
|
+
modules = _get_pyspark_modules()
|
|
111
|
+
|
|
112
|
+
assert isinstance(modules, dict)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def test_pyspark_model_from_string():
|
|
116
|
+
|
|
117
|
+
model_class = pyspark_model_from_string("RandomForestClassifier")
|
|
118
|
+
|
|
119
|
+
assert model_class.__name__ == "RandomForestClassifier"
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def test_layer_mapping():
|
|
123
|
+
|
|
124
|
+
layer_map = layer_mapping(direction="torch_to_keras")
|
|
125
|
+
assert isinstance(layer_map, dict)
|
|
126
|
+
|
|
127
|
+
layer_map = layer_mapping(direction="keras_to_torch")
|
|
128
|
+
assert isinstance(layer_map, dict)
|
|
129
|
+
|
|
130
|
+
layer_map = layer_mapping(direction="torch_to_keras", activation=True)
|
|
131
|
+
assert isinstance(layer_map, dict)
|
|
132
|
+
|
|
133
|
+
layer_map = layer_mapping(direction="keras_to_torch", activation=True)
|
|
134
|
+
assert isinstance(layer_map, dict)
|
|
135
|
+
|