diff --git a/MANIFEST.in b/MANIFEST.in index 469520f5..afa9820c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,6 +3,7 @@ include CONTRIBUTING.rst include HISTORY.md include LICENSE include README.md +include mlprimitives/jsons/*.json recursive-include tests * recursive-exclude * __pycache__ diff --git a/README.md b/README.md index bf818456..29df2732 100644 --- a/README.md +++ b/README.md @@ -30,16 +30,6 @@ either combine third party tools or implement new functionalities from scratch. The project is divided in three parts: -### The `mlblocks_primitives` folder - -The `mlblocks_primitives` folder contains the JSON annotations for the MLBlocks primitives. - -This folder has a flat structure, without subfolders, and all the primitive JSONs are named -after the Fully Qualified Name of the annotated primitive (function or class). - -As a result of this, sorting the JSON files alphabetically shows them grouped by library, which -makes browsing them and seeing what tools are implemented easy. - ### The `mlprimitives` package The mlprimitives folder is where all the Python code can be found. @@ -48,6 +38,16 @@ Several sub-modules exist inside it, for the different types of primitives imple the `mlprimitives.adapters` module, which has a special role in the integration of third party tools that do not directly fit the MLBlocks requirements. +### The `mlprimitives/jsons` folder + +The `mlprimitives/jsons` folder contains the JSON annotations for the primitives. + +This folder has a flat structure, without subfolders, and all the primitive JSONs are named +after the Fully Qualified Name of the annotated primitive (function or class). + +As a result of this, sorting the JSON files alphabetically shows them grouped by library, which +makes browsing them and seeing what tools are implemented easy. + ### The `tests` folder Here are the unit tests for the Python code, as well as some validation tests for the JSON diff --git a/mlprimitives/__init__.py b/mlprimitives/__init__.py index d876a54a..cc68678c 100644 --- a/mlprimitives/__init__.py +++ b/mlprimitives/__init__.py @@ -15,6 +15,7 @@ from mlprimitives.evaluation import score_pipeline +MLPRIMITIVES_JSONS_PATH = os.path.join(os.path.dirname(__file__), 'jsons') LOGGER = logging.getLogger(__name__) diff --git a/mlblocks_primitives/community.CommunityBestPartition.json b/mlprimitives/jsons/community.CommunityBestPartition.json similarity index 100% rename from mlblocks_primitives/community.CommunityBestPartition.json rename to mlprimitives/jsons/community.CommunityBestPartition.json diff --git a/mlblocks_primitives/cv2.GaussianBlur.json b/mlprimitives/jsons/cv2.GaussianBlur.json similarity index 100% rename from mlblocks_primitives/cv2.GaussianBlur.json rename to mlprimitives/jsons/cv2.GaussianBlur.json diff --git a/mlblocks_primitives/featuretools.dfs.json b/mlprimitives/jsons/featuretools.dfs.json similarity index 100% rename from mlblocks_primitives/featuretools.dfs.json rename to mlprimitives/jsons/featuretools.dfs.json diff --git a/mlblocks_primitives/keras.Sequential.LSTMTextClassifier.json b/mlprimitives/jsons/keras.Sequential.LSTMTextClassifier.json similarity index 100% rename from mlblocks_primitives/keras.Sequential.LSTMTextClassifier.json rename to mlprimitives/jsons/keras.Sequential.LSTMTextClassifier.json diff --git a/mlblocks_primitives/keras.Sequential.LSTMTextRegressor.json b/mlprimitives/jsons/keras.Sequential.LSTMTextRegressor.json similarity index 100% rename from mlblocks_primitives/keras.Sequential.LSTMTextRegressor.json rename to mlprimitives/jsons/keras.Sequential.LSTMTextRegressor.json diff --git a/mlblocks_primitives/keras.Sequential.LSTMTimeSeriesRegressor.json b/mlprimitives/jsons/keras.Sequential.LSTMTimeSeriesRegressor.json similarity index 100% rename from mlblocks_primitives/keras.Sequential.LSTMTimeSeriesRegressor.json rename to mlprimitives/jsons/keras.Sequential.LSTMTimeSeriesRegressor.json diff --git a/mlblocks_primitives/keras.Sequential.SingleLayerCNNImageClassifier.json b/mlprimitives/jsons/keras.Sequential.SingleLayerCNNImageClassifier.json similarity index 100% rename from mlblocks_primitives/keras.Sequential.SingleLayerCNNImageClassifier.json rename to mlprimitives/jsons/keras.Sequential.SingleLayerCNNImageClassifier.json diff --git a/mlblocks_primitives/keras.Sequential.SingleLayerCNNImageRegressor.json b/mlprimitives/jsons/keras.Sequential.SingleLayerCNNImageRegressor.json similarity index 100% rename from mlblocks_primitives/keras.Sequential.SingleLayerCNNImageRegressor.json rename to mlprimitives/jsons/keras.Sequential.SingleLayerCNNImageRegressor.json diff --git a/mlblocks_primitives/keras.applications.densenet.DenseNet121.json b/mlprimitives/jsons/keras.applications.densenet.DenseNet121.json similarity index 100% rename from mlblocks_primitives/keras.applications.densenet.DenseNet121.json rename to mlprimitives/jsons/keras.applications.densenet.DenseNet121.json diff --git a/mlblocks_primitives/keras.applications.densenet.DenseNet169.json b/mlprimitives/jsons/keras.applications.densenet.DenseNet169.json similarity index 100% rename from mlblocks_primitives/keras.applications.densenet.DenseNet169.json rename to mlprimitives/jsons/keras.applications.densenet.DenseNet169.json diff --git a/mlblocks_primitives/keras.applications.densenet.DenseNet201.json b/mlprimitives/jsons/keras.applications.densenet.DenseNet201.json similarity index 100% rename from mlblocks_primitives/keras.applications.densenet.DenseNet201.json rename to mlprimitives/jsons/keras.applications.densenet.DenseNet201.json diff --git a/mlblocks_primitives/keras.applications.densenet.preprocess_input.json b/mlprimitives/jsons/keras.applications.densenet.preprocess_input.json similarity index 100% rename from mlblocks_primitives/keras.applications.densenet.preprocess_input.json rename to mlprimitives/jsons/keras.applications.densenet.preprocess_input.json diff --git a/mlblocks_primitives/keras.applications.inception_v3.InceptionV3.json b/mlprimitives/jsons/keras.applications.inception_v3.InceptionV3.json similarity index 100% rename from mlblocks_primitives/keras.applications.inception_v3.InceptionV3.json rename to mlprimitives/jsons/keras.applications.inception_v3.InceptionV3.json diff --git a/mlblocks_primitives/keras.applications.inception_v3.preprocess_input.json b/mlprimitives/jsons/keras.applications.inception_v3.preprocess_input.json similarity index 100% rename from mlblocks_primitives/keras.applications.inception_v3.preprocess_input.json rename to mlprimitives/jsons/keras.applications.inception_v3.preprocess_input.json diff --git a/mlblocks_primitives/keras.applications.mobilenet.MobileNet.json b/mlprimitives/jsons/keras.applications.mobilenet.MobileNet.json similarity index 100% rename from mlblocks_primitives/keras.applications.mobilenet.MobileNet.json rename to mlprimitives/jsons/keras.applications.mobilenet.MobileNet.json diff --git a/mlblocks_primitives/keras.applications.mobilenet.preprocess_input.json b/mlprimitives/jsons/keras.applications.mobilenet.preprocess_input.json similarity index 100% rename from mlblocks_primitives/keras.applications.mobilenet.preprocess_input.json rename to mlprimitives/jsons/keras.applications.mobilenet.preprocess_input.json diff --git a/mlblocks_primitives/keras.applications.resnet50.ResNet50.json b/mlprimitives/jsons/keras.applications.resnet50.ResNet50.json similarity index 100% rename from mlblocks_primitives/keras.applications.resnet50.ResNet50.json rename to mlprimitives/jsons/keras.applications.resnet50.ResNet50.json diff --git a/mlblocks_primitives/keras.applications.resnet50.preprocess_input.json b/mlprimitives/jsons/keras.applications.resnet50.preprocess_input.json similarity index 100% rename from mlblocks_primitives/keras.applications.resnet50.preprocess_input.json rename to mlprimitives/jsons/keras.applications.resnet50.preprocess_input.json diff --git a/mlblocks_primitives/keras.applications.xception.Xception.json b/mlprimitives/jsons/keras.applications.xception.Xception.json similarity index 100% rename from mlblocks_primitives/keras.applications.xception.Xception.json rename to mlprimitives/jsons/keras.applications.xception.Xception.json diff --git a/mlblocks_primitives/keras.applications.xception.preprocess_input.json b/mlprimitives/jsons/keras.applications.xception.preprocess_input.json similarity index 100% rename from mlblocks_primitives/keras.applications.xception.preprocess_input.json rename to mlprimitives/jsons/keras.applications.xception.preprocess_input.json diff --git a/mlblocks_primitives/keras.preprocessing.sequence.pad_sequences.json b/mlprimitives/jsons/keras.preprocessing.sequence.pad_sequences.json similarity index 100% rename from mlblocks_primitives/keras.preprocessing.sequence.pad_sequences.json rename to mlprimitives/jsons/keras.preprocessing.sequence.pad_sequences.json diff --git a/mlblocks_primitives/keras.preprocessing.text.Tokenizer.json b/mlprimitives/jsons/keras.preprocessing.text.Tokenizer.json similarity index 100% rename from mlblocks_primitives/keras.preprocessing.text.Tokenizer.json rename to mlprimitives/jsons/keras.preprocessing.text.Tokenizer.json diff --git a/mlblocks_primitives/lightfm.LightFM.json b/mlprimitives/jsons/lightfm.LightFM.json similarity index 100% rename from mlblocks_primitives/lightfm.LightFM.json rename to mlprimitives/jsons/lightfm.LightFM.json diff --git a/mlblocks_primitives/mlprimitives.audio_featurization.featurize_audio.json b/mlprimitives/jsons/mlprimitives.audio_featurization.featurize_audio.json similarity index 100% rename from mlblocks_primitives/mlprimitives.audio_featurization.featurize_audio.json rename to mlprimitives/jsons/mlprimitives.audio_featurization.featurize_audio.json diff --git a/mlblocks_primitives/mlprimitives.audio_padding.AudioPadder.json b/mlprimitives/jsons/mlprimitives.audio_padding.AudioPadder.json similarity index 100% rename from mlblocks_primitives/mlprimitives.audio_padding.AudioPadder.json rename to mlprimitives/jsons/mlprimitives.audio_padding.AudioPadder.json diff --git a/mlblocks_primitives/mlprimitives.counters.UniqueCounter.json b/mlprimitives/jsons/mlprimitives.counters.UniqueCounter.json similarity index 100% rename from mlblocks_primitives/mlprimitives.counters.UniqueCounter.json rename to mlprimitives/jsons/mlprimitives.counters.UniqueCounter.json diff --git a/mlblocks_primitives/mlprimitives.counters.VocabularyCounter.json b/mlprimitives/jsons/mlprimitives.counters.VocabularyCounter.json similarity index 100% rename from mlblocks_primitives/mlprimitives.counters.VocabularyCounter.json rename to mlprimitives/jsons/mlprimitives.counters.VocabularyCounter.json diff --git a/mlblocks_primitives/mlprimitives.feature_extraction.CategoricalEncoder.json b/mlprimitives/jsons/mlprimitives.feature_extraction.CategoricalEncoder.json similarity index 100% rename from mlblocks_primitives/mlprimitives.feature_extraction.CategoricalEncoder.json rename to mlprimitives/jsons/mlprimitives.feature_extraction.CategoricalEncoder.json diff --git a/mlblocks_primitives/mlprimitives.feature_extraction.DatetimeFeaturizer.json b/mlprimitives/jsons/mlprimitives.feature_extraction.DatetimeFeaturizer.json similarity index 100% rename from mlblocks_primitives/mlprimitives.feature_extraction.DatetimeFeaturizer.json rename to mlprimitives/jsons/mlprimitives.feature_extraction.DatetimeFeaturizer.json diff --git a/mlblocks_primitives/mlprimitives.feature_extraction.StringVectorizer.json b/mlprimitives/jsons/mlprimitives.feature_extraction.StringVectorizer.json similarity index 100% rename from mlblocks_primitives/mlprimitives.feature_extraction.StringVectorizer.json rename to mlprimitives/jsons/mlprimitives.feature_extraction.StringVectorizer.json diff --git a/mlblocks_primitives/mlprimitives.feature_selection.ExtraTreesClassifierFeatureSelector.json b/mlprimitives/jsons/mlprimitives.feature_selection.ExtraTreesClassifierFeatureSelector.json similarity index 100% rename from mlblocks_primitives/mlprimitives.feature_selection.ExtraTreesClassifierFeatureSelector.json rename to mlprimitives/jsons/mlprimitives.feature_selection.ExtraTreesClassifierFeatureSelector.json diff --git a/mlblocks_primitives/mlprimitives.feature_selection.ExtraTreesRegressorFeatureSelector.json b/mlprimitives/jsons/mlprimitives.feature_selection.ExtraTreesRegressorFeatureSelector.json similarity index 100% rename from mlblocks_primitives/mlprimitives.feature_selection.ExtraTreesRegressorFeatureSelector.json rename to mlprimitives/jsons/mlprimitives.feature_selection.ExtraTreesRegressorFeatureSelector.json diff --git a/mlblocks_primitives/mlprimitives.preprocessing.ClassDecoder.json b/mlprimitives/jsons/mlprimitives.preprocessing.ClassDecoder.json similarity index 100% rename from mlblocks_primitives/mlprimitives.preprocessing.ClassDecoder.json rename to mlprimitives/jsons/mlprimitives.preprocessing.ClassDecoder.json diff --git a/mlblocks_primitives/mlprimitives.preprocessing.ClassEncoder.json b/mlprimitives/jsons/mlprimitives.preprocessing.ClassEncoder.json similarity index 100% rename from mlblocks_primitives/mlprimitives.preprocessing.ClassEncoder.json rename to mlprimitives/jsons/mlprimitives.preprocessing.ClassEncoder.json diff --git a/mlblocks_primitives/mlprimitives.text.TextCleaner.json b/mlprimitives/jsons/mlprimitives.text.TextCleaner.json similarity index 100% rename from mlblocks_primitives/mlprimitives.text.TextCleaner.json rename to mlprimitives/jsons/mlprimitives.text.TextCleaner.json diff --git a/mlblocks_primitives/mlprimitives.timeseries.rolling_window_sequences.json b/mlprimitives/jsons/mlprimitives.timeseries.rolling_window_sequences.json similarity index 100% rename from mlblocks_primitives/mlprimitives.timeseries.rolling_window_sequences.json rename to mlprimitives/jsons/mlprimitives.timeseries.rolling_window_sequences.json diff --git a/mlblocks_primitives/mlprimitives.timeseries.time_segments_average.json b/mlprimitives/jsons/mlprimitives.timeseries.time_segments_average.json similarity index 100% rename from mlblocks_primitives/mlprimitives.timeseries.time_segments_average.json rename to mlprimitives/jsons/mlprimitives.timeseries.time_segments_average.json diff --git a/mlblocks_primitives/mlprimitives.timeseries_errors.extract_anomalies.json b/mlprimitives/jsons/mlprimitives.timeseries_errors.extract_anomalies.json similarity index 100% rename from mlblocks_primitives/mlprimitives.timeseries_errors.extract_anomalies.json rename to mlprimitives/jsons/mlprimitives.timeseries_errors.extract_anomalies.json diff --git a/mlblocks_primitives/mlprimitives.timeseries_errors.get_forecast_errors.json b/mlprimitives/jsons/mlprimitives.timeseries_errors.get_forecast_errors.json similarity index 100% rename from mlblocks_primitives/mlprimitives.timeseries_errors.get_forecast_errors.json rename to mlprimitives/jsons/mlprimitives.timeseries_errors.get_forecast_errors.json diff --git a/mlblocks_primitives/mlprimitives.trivial.TrivialPredictor.json b/mlprimitives/jsons/mlprimitives.trivial.TrivialPredictor.json similarity index 100% rename from mlblocks_primitives/mlprimitives.trivial.TrivialPredictor.json rename to mlprimitives/jsons/mlprimitives.trivial.TrivialPredictor.json diff --git a/mlblocks_primitives/networkx.graph_feature_extraction.json b/mlprimitives/jsons/networkx.graph_feature_extraction.json similarity index 100% rename from mlblocks_primitives/networkx.graph_feature_extraction.json rename to mlprimitives/jsons/networkx.graph_feature_extraction.json diff --git a/mlblocks_primitives/networkx.link_prediction_feature_extraction.json b/mlprimitives/jsons/networkx.link_prediction_feature_extraction.json similarity index 100% rename from mlblocks_primitives/networkx.link_prediction_feature_extraction.json rename to mlprimitives/jsons/networkx.link_prediction_feature_extraction.json diff --git a/mlblocks_primitives/numpy.argmax.json b/mlprimitives/jsons/numpy.argmax.json similarity index 100% rename from mlblocks_primitives/numpy.argmax.json rename to mlprimitives/jsons/numpy.argmax.json diff --git a/mlblocks_primitives/skimage.feature.hog.json b/mlprimitives/jsons/skimage.feature.hog.json similarity index 100% rename from mlblocks_primitives/skimage.feature.hog.json rename to mlprimitives/jsons/skimage.feature.hog.json diff --git a/mlblocks_primitives/sklearn.decomposition.DictionaryLearning.json b/mlprimitives/jsons/sklearn.decomposition.DictionaryLearning.json similarity index 100% rename from mlblocks_primitives/sklearn.decomposition.DictionaryLearning.json rename to mlprimitives/jsons/sklearn.decomposition.DictionaryLearning.json diff --git a/mlblocks_primitives/sklearn.decomposition.FactorAnalysis.json b/mlprimitives/jsons/sklearn.decomposition.FactorAnalysis.json similarity index 100% rename from mlblocks_primitives/sklearn.decomposition.FactorAnalysis.json rename to mlprimitives/jsons/sklearn.decomposition.FactorAnalysis.json diff --git a/mlblocks_primitives/sklearn.decomposition.FastICA.json b/mlprimitives/jsons/sklearn.decomposition.FastICA.json similarity index 100% rename from mlblocks_primitives/sklearn.decomposition.FastICA.json rename to mlprimitives/jsons/sklearn.decomposition.FastICA.json diff --git a/mlblocks_primitives/sklearn.decomposition.KernelPCA.json b/mlprimitives/jsons/sklearn.decomposition.KernelPCA.json similarity index 100% rename from mlblocks_primitives/sklearn.decomposition.KernelPCA.json rename to mlprimitives/jsons/sklearn.decomposition.KernelPCA.json diff --git a/mlblocks_primitives/sklearn.decomposition.PCA.json b/mlprimitives/jsons/sklearn.decomposition.PCA.json similarity index 100% rename from mlblocks_primitives/sklearn.decomposition.PCA.json rename to mlprimitives/jsons/sklearn.decomposition.PCA.json diff --git a/mlblocks_primitives/sklearn.decomposition.TruncatedSVD.json b/mlprimitives/jsons/sklearn.decomposition.TruncatedSVD.json similarity index 100% rename from mlblocks_primitives/sklearn.decomposition.TruncatedSVD.json rename to mlprimitives/jsons/sklearn.decomposition.TruncatedSVD.json diff --git a/mlblocks_primitives/sklearn.ensemble.AdaBoostClassifier.json b/mlprimitives/jsons/sklearn.ensemble.AdaBoostClassifier.json similarity index 100% rename from mlblocks_primitives/sklearn.ensemble.AdaBoostClassifier.json rename to mlprimitives/jsons/sklearn.ensemble.AdaBoostClassifier.json diff --git a/mlblocks_primitives/sklearn.ensemble.AdaBoostRegressor.json b/mlprimitives/jsons/sklearn.ensemble.AdaBoostRegressor.json similarity index 100% rename from mlblocks_primitives/sklearn.ensemble.AdaBoostRegressor.json rename to mlprimitives/jsons/sklearn.ensemble.AdaBoostRegressor.json diff --git a/mlblocks_primitives/sklearn.ensemble.BaggingClassifier.json b/mlprimitives/jsons/sklearn.ensemble.BaggingClassifier.json similarity index 100% rename from mlblocks_primitives/sklearn.ensemble.BaggingClassifier.json rename to mlprimitives/jsons/sklearn.ensemble.BaggingClassifier.json diff --git a/mlblocks_primitives/sklearn.ensemble.BaggingRegressor.json b/mlprimitives/jsons/sklearn.ensemble.BaggingRegressor.json similarity index 100% rename from mlblocks_primitives/sklearn.ensemble.BaggingRegressor.json rename to mlprimitives/jsons/sklearn.ensemble.BaggingRegressor.json diff --git a/mlblocks_primitives/sklearn.ensemble.ExtraTreesClassifier.json b/mlprimitives/jsons/sklearn.ensemble.ExtraTreesClassifier.json similarity index 100% rename from mlblocks_primitives/sklearn.ensemble.ExtraTreesClassifier.json rename to mlprimitives/jsons/sklearn.ensemble.ExtraTreesClassifier.json diff --git a/mlblocks_primitives/sklearn.ensemble.ExtraTreesRegressor.json b/mlprimitives/jsons/sklearn.ensemble.ExtraTreesRegressor.json similarity index 100% rename from mlblocks_primitives/sklearn.ensemble.ExtraTreesRegressor.json rename to mlprimitives/jsons/sklearn.ensemble.ExtraTreesRegressor.json diff --git a/mlblocks_primitives/sklearn.ensemble.GradientBoostingClassifier.json b/mlprimitives/jsons/sklearn.ensemble.GradientBoostingClassifier.json similarity index 100% rename from mlblocks_primitives/sklearn.ensemble.GradientBoostingClassifier.json rename to mlprimitives/jsons/sklearn.ensemble.GradientBoostingClassifier.json diff --git a/mlblocks_primitives/sklearn.ensemble.GradientBoostingRegressor.json b/mlprimitives/jsons/sklearn.ensemble.GradientBoostingRegressor.json similarity index 100% rename from mlblocks_primitives/sklearn.ensemble.GradientBoostingRegressor.json rename to mlprimitives/jsons/sklearn.ensemble.GradientBoostingRegressor.json diff --git a/mlblocks_primitives/sklearn.ensemble.IsolationForest.json b/mlprimitives/jsons/sklearn.ensemble.IsolationForest.json similarity index 100% rename from mlblocks_primitives/sklearn.ensemble.IsolationForest.json rename to mlprimitives/jsons/sklearn.ensemble.IsolationForest.json diff --git a/mlblocks_primitives/sklearn.ensemble.RandomForestClassifier.json b/mlprimitives/jsons/sklearn.ensemble.RandomForestClassifier.json similarity index 100% rename from mlblocks_primitives/sklearn.ensemble.RandomForestClassifier.json rename to mlprimitives/jsons/sklearn.ensemble.RandomForestClassifier.json diff --git a/mlblocks_primitives/sklearn.ensemble.RandomForestClassifier_proba.json b/mlprimitives/jsons/sklearn.ensemble.RandomForestClassifier_proba.json similarity index 100% rename from mlblocks_primitives/sklearn.ensemble.RandomForestClassifier_proba.json rename to mlprimitives/jsons/sklearn.ensemble.RandomForestClassifier_proba.json diff --git a/mlblocks_primitives/sklearn.ensemble.RandomForestRegressor.json b/mlprimitives/jsons/sklearn.ensemble.RandomForestRegressor.json similarity index 100% rename from mlblocks_primitives/sklearn.ensemble.RandomForestRegressor.json rename to mlprimitives/jsons/sklearn.ensemble.RandomForestRegressor.json diff --git a/mlblocks_primitives/sklearn.ensemble.RandomTreesEmbedding.json b/mlprimitives/jsons/sklearn.ensemble.RandomTreesEmbedding.json similarity index 100% rename from mlblocks_primitives/sklearn.ensemble.RandomTreesEmbedding.json rename to mlprimitives/jsons/sklearn.ensemble.RandomTreesEmbedding.json diff --git a/mlblocks_primitives/sklearn.feature_extraction.text.CountVectorizer.json b/mlprimitives/jsons/sklearn.feature_extraction.text.CountVectorizer.json similarity index 100% rename from mlblocks_primitives/sklearn.feature_extraction.text.CountVectorizer.json rename to mlprimitives/jsons/sklearn.feature_extraction.text.CountVectorizer.json diff --git a/mlblocks_primitives/sklearn.feature_extraction.text.TfidfTransformer.json b/mlprimitives/jsons/sklearn.feature_extraction.text.TfidfTransformer.json similarity index 100% rename from mlblocks_primitives/sklearn.feature_extraction.text.TfidfTransformer.json rename to mlprimitives/jsons/sklearn.feature_extraction.text.TfidfTransformer.json diff --git a/mlblocks_primitives/sklearn.naive_bayes.MultinomialNB.json b/mlprimitives/jsons/sklearn.naive_bayes.MultinomialNB.json similarity index 100% rename from mlblocks_primitives/sklearn.naive_bayes.MultinomialNB.json rename to mlprimitives/jsons/sklearn.naive_bayes.MultinomialNB.json diff --git a/mlblocks_primitives/sklearn.neighbors.KNeighborsClassifier.json b/mlprimitives/jsons/sklearn.neighbors.KNeighborsClassifier.json similarity index 100% rename from mlblocks_primitives/sklearn.neighbors.KNeighborsClassifier.json rename to mlprimitives/jsons/sklearn.neighbors.KNeighborsClassifier.json diff --git a/mlblocks_primitives/sklearn.neighbors.KNeighborsClassifier_proba.json b/mlprimitives/jsons/sklearn.neighbors.KNeighborsClassifier_proba.json similarity index 100% rename from mlblocks_primitives/sklearn.neighbors.KNeighborsClassifier_proba.json rename to mlprimitives/jsons/sklearn.neighbors.KNeighborsClassifier_proba.json diff --git a/mlblocks_primitives/sklearn.neighbors.KNeighborsRegressor.json b/mlprimitives/jsons/sklearn.neighbors.KNeighborsRegressor.json similarity index 100% rename from mlblocks_primitives/sklearn.neighbors.KNeighborsRegressor.json rename to mlprimitives/jsons/sklearn.neighbors.KNeighborsRegressor.json diff --git a/mlblocks_primitives/sklearn.preprocessing.Imputer.json b/mlprimitives/jsons/sklearn.preprocessing.Imputer.json similarity index 100% rename from mlblocks_primitives/sklearn.preprocessing.Imputer.json rename to mlprimitives/jsons/sklearn.preprocessing.Imputer.json diff --git a/mlblocks_primitives/sklearn.preprocessing.OneHotEncoder.json b/mlprimitives/jsons/sklearn.preprocessing.OneHotEncoder.json similarity index 100% rename from mlblocks_primitives/sklearn.preprocessing.OneHotEncoder.json rename to mlprimitives/jsons/sklearn.preprocessing.OneHotEncoder.json diff --git a/mlblocks_primitives/sklearn.preprocessing.StandardScaler.json b/mlprimitives/jsons/sklearn.preprocessing.StandardScaler.json similarity index 100% rename from mlblocks_primitives/sklearn.preprocessing.StandardScaler.json rename to mlprimitives/jsons/sklearn.preprocessing.StandardScaler.json diff --git a/mlblocks_primitives/xgboost.XGBClassifier.json b/mlprimitives/jsons/xgboost.XGBClassifier.json similarity index 100% rename from mlblocks_primitives/xgboost.XGBClassifier.json rename to mlprimitives/jsons/xgboost.XGBClassifier.json diff --git a/mlblocks_primitives/xgboost.XGBRegressor.json b/mlprimitives/jsons/xgboost.XGBRegressor.json similarity index 100% rename from mlblocks_primitives/xgboost.XGBRegressor.json rename to mlprimitives/jsons/xgboost.XGBRegressor.json diff --git a/mlblocks_pipelines/graph.graph_matching.default.json b/pipelines/graph.graph_matching.default.json similarity index 100% rename from mlblocks_pipelines/graph.graph_matching.default.json rename to pipelines/graph.graph_matching.default.json diff --git a/mlblocks_pipelines/graph.link_prediction.default.json b/pipelines/graph.link_prediction.default.json similarity index 100% rename from mlblocks_pipelines/graph.link_prediction.default.json rename to pipelines/graph.link_prediction.default.json diff --git a/mlblocks_pipelines/keras.Sequential.SingleLayerCNNImagelClassifier.json b/pipelines/keras.Sequential.SingleLayerCNNImagelClassifier.json similarity index 100% rename from mlblocks_pipelines/keras.Sequential.SingleLayerCNNImagelClassifier.json rename to pipelines/keras.Sequential.SingleLayerCNNImagelClassifier.json diff --git a/mlblocks_pipelines/multi_table.classification.default.json b/pipelines/multi_table.classification.default.json similarity index 100% rename from mlblocks_pipelines/multi_table.classification.default.json rename to pipelines/multi_table.classification.default.json diff --git a/mlblocks_pipelines/single_table.classification.default.json b/pipelines/single_table.classification.default.json similarity index 100% rename from mlblocks_pipelines/single_table.classification.default.json rename to pipelines/single_table.classification.default.json diff --git a/mlblocks_pipelines/sklearn.decomposition.DictionaryLearning.json b/pipelines/sklearn.decomposition.DictionaryLearning.json similarity index 100% rename from mlblocks_pipelines/sklearn.decomposition.DictionaryLearning.json rename to pipelines/sklearn.decomposition.DictionaryLearning.json diff --git a/mlblocks_pipelines/sklearn.decomposition.FactorAnalysis.json b/pipelines/sklearn.decomposition.FactorAnalysis.json similarity index 100% rename from mlblocks_pipelines/sklearn.decomposition.FactorAnalysis.json rename to pipelines/sklearn.decomposition.FactorAnalysis.json diff --git a/mlblocks_pipelines/sklearn.decomposition.FastICA.json b/pipelines/sklearn.decomposition.FastICA.json similarity index 100% rename from mlblocks_pipelines/sklearn.decomposition.FastICA.json rename to pipelines/sklearn.decomposition.FastICA.json diff --git a/mlblocks_pipelines/sklearn.decomposition.KernelPCA.json b/pipelines/sklearn.decomposition.KernelPCA.json similarity index 100% rename from mlblocks_pipelines/sklearn.decomposition.KernelPCA.json rename to pipelines/sklearn.decomposition.KernelPCA.json diff --git a/mlblocks_pipelines/sklearn.decomposition.PCA.json b/pipelines/sklearn.decomposition.PCA.json similarity index 100% rename from mlblocks_pipelines/sklearn.decomposition.PCA.json rename to pipelines/sklearn.decomposition.PCA.json diff --git a/mlblocks_pipelines/sklearn.decomposition.TruncatedSVD.json b/pipelines/sklearn.decomposition.TruncatedSVD.json similarity index 100% rename from mlblocks_pipelines/sklearn.decomposition.TruncatedSVD.json rename to pipelines/sklearn.decomposition.TruncatedSVD.json diff --git a/mlblocks_pipelines/sklearn.ensemble.AdaBoostClassifier.json b/pipelines/sklearn.ensemble.AdaBoostClassifier.json similarity index 100% rename from mlblocks_pipelines/sklearn.ensemble.AdaBoostClassifier.json rename to pipelines/sklearn.ensemble.AdaBoostClassifier.json diff --git a/mlblocks_pipelines/sklearn.ensemble.AdaBoostRegressor.json b/pipelines/sklearn.ensemble.AdaBoostRegressor.json similarity index 100% rename from mlblocks_pipelines/sklearn.ensemble.AdaBoostRegressor.json rename to pipelines/sklearn.ensemble.AdaBoostRegressor.json diff --git a/mlblocks_pipelines/sklearn.ensemble.BaggingClassifier.json b/pipelines/sklearn.ensemble.BaggingClassifier.json similarity index 100% rename from mlblocks_pipelines/sklearn.ensemble.BaggingClassifier.json rename to pipelines/sklearn.ensemble.BaggingClassifier.json diff --git a/mlblocks_pipelines/sklearn.ensemble.BaggingRegressor.json b/pipelines/sklearn.ensemble.BaggingRegressor.json similarity index 100% rename from mlblocks_pipelines/sklearn.ensemble.BaggingRegressor.json rename to pipelines/sklearn.ensemble.BaggingRegressor.json diff --git a/mlblocks_pipelines/sklearn.ensemble.ExtraTreesClassifier.json b/pipelines/sklearn.ensemble.ExtraTreesClassifier.json similarity index 100% rename from mlblocks_pipelines/sklearn.ensemble.ExtraTreesClassifier.json rename to pipelines/sklearn.ensemble.ExtraTreesClassifier.json diff --git a/mlblocks_pipelines/sklearn.ensemble.ExtraTreesRegressor.json b/pipelines/sklearn.ensemble.ExtraTreesRegressor.json similarity index 100% rename from mlblocks_pipelines/sklearn.ensemble.ExtraTreesRegressor.json rename to pipelines/sklearn.ensemble.ExtraTreesRegressor.json diff --git a/mlblocks_pipelines/sklearn.ensemble.GradientBoostingClassifier.json b/pipelines/sklearn.ensemble.GradientBoostingClassifier.json similarity index 100% rename from mlblocks_pipelines/sklearn.ensemble.GradientBoostingClassifier.json rename to pipelines/sklearn.ensemble.GradientBoostingClassifier.json diff --git a/mlblocks_pipelines/sklearn.ensemble.GradientBoostingRegressor.json b/pipelines/sklearn.ensemble.GradientBoostingRegressor.json similarity index 100% rename from mlblocks_pipelines/sklearn.ensemble.GradientBoostingRegressor.json rename to pipelines/sklearn.ensemble.GradientBoostingRegressor.json diff --git a/mlblocks_pipelines/sklearn.ensemble.IsolationForest.json b/pipelines/sklearn.ensemble.IsolationForest.json similarity index 100% rename from mlblocks_pipelines/sklearn.ensemble.IsolationForest.json rename to pipelines/sklearn.ensemble.IsolationForest.json diff --git a/mlblocks_pipelines/sklearn.ensemble.RandomForestClassifier.json b/pipelines/sklearn.ensemble.RandomForestClassifier.json similarity index 100% rename from mlblocks_pipelines/sklearn.ensemble.RandomForestClassifier.json rename to pipelines/sklearn.ensemble.RandomForestClassifier.json diff --git a/mlblocks_pipelines/sklearn.ensemble.RandomForestRegressor.json b/pipelines/sklearn.ensemble.RandomForestRegressor.json similarity index 100% rename from mlblocks_pipelines/sklearn.ensemble.RandomForestRegressor.json rename to pipelines/sklearn.ensemble.RandomForestRegressor.json diff --git a/mlblocks_pipelines/sklearn.ensemble.RandomTreesEmbedding.json b/pipelines/sklearn.ensemble.RandomTreesEmbedding.json similarity index 100% rename from mlblocks_pipelines/sklearn.ensemble.RandomTreesEmbedding.json rename to pipelines/sklearn.ensemble.RandomTreesEmbedding.json diff --git a/mlblocks_pipelines/text.classification.default.json b/pipelines/text.classification.default.json similarity index 100% rename from mlblocks_pipelines/text.classification.default.json rename to pipelines/text.classification.default.json diff --git a/setup.py b/setup.py index 8f1d53c6..bb30f289 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ tests_require = [ - 'mlblocks>=0.2.4', + 'mlblocks>=0.3.0', 'pytest>=3.4.2', 'google-compute-engine==2.8.12', # required by travis ] @@ -84,15 +84,6 @@ } -json_primitives = glob.glob('mlblocks_primitives/**/*.json', recursive=True) -data_files = defaultdict(list) -for primitive_path in json_primitives: - parts = primitive_path.split('/') - dir_path = parts[1:-1] - install_path = os.path.join('mlblocks_primitives', *dir_path) - data_files[install_path].append(primitive_path) - - setup( author="MIT Data To AI Lab", author_email='dailabmit@gmail.com', @@ -105,12 +96,14 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', ], - data_files = list(data_files.items()), description="MLBlocks Primitives", entry_points = { 'console_scripts': [ 'mlprimitives=mlprimitives:_main' ], + 'mlprimitives': [ + 'jsons_path=mlprimitives:MLPRIMITIVES_JSONS_PATH' + ] }, extras_require=extras_require, install_requires=install_requires, diff --git a/tests/test_mlblocks_primitives.py b/tests/test_jsons.py similarity index 78% rename from tests/test_mlblocks_primitives.py rename to tests/test_jsons.py index 58af8712..dbd2bb91 100644 --- a/tests/test_mlblocks_primitives.py +++ b/tests/test_jsons.py @@ -2,18 +2,10 @@ import json import os -from unittest.mock import patch from mlblocks import MLPipeline -PRIMITIVES_PATH = os.path.normpath( - os.path.join( - os.path.dirname(__file__), - os.pardir, - 'mlblocks_primitives' - ) -) - +from mlprimitives import MLPRIMITIVES_JSONS_PATH HYPERPARAMETER_DEFAULTS = { 'int': 1, @@ -24,14 +16,13 @@ } -@patch('mlblocks.primitives._PRIMITIVES_PATHS', new=[PRIMITIVES_PATH]) def test_jsons(): """Validate MLBlocks primitive jsons""" - primitives = (f for f in os.listdir(PRIMITIVES_PATH) if f.endswith('.json')) + primitives = (f for f in os.listdir(MLPRIMITIVES_JSONS_PATH) if f.endswith('.json')) for primitive_filename in primitives: try: - primitive_path = os.path.join(PRIMITIVES_PATH, primitive_filename) + primitive_path = os.path.join(MLPRIMITIVES_JSONS_PATH, primitive_filename) with open(primitive_path, 'r') as f: primitive = json.load(f) diff --git a/tests/mlprimitives/test_utils.py b/tests/test_utils.py similarity index 100% rename from tests/mlprimitives/test_utils.py rename to tests/test_utils.py