Previous changeset 19:4570575d060c (2018-08-17) Next changeset 21:9ce3e347506c (2018-09-29) |
Commit message:
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 8cf3d813ec755166ee0bd517b4ecbbd4f84d4df1 |
modified:
ensemble.xml main_macros.xml test-data/gbc_model01 test-data/gbr_model01 test-data/nn_model01.txt test-data/nn_model02.txt test-data/nn_model03.txt test-data/pipeline01 test-data/pipeline04 test-data/rfc_model01 test-data/rfr_model01 test-data/searchCV01 test-data/svc_model01.txt test-data/svc_model02.txt test-data/svc_model03.txt test-data/svc_prediction_result03.tabular utils.py |
added:
sk_whitelist.py |
b |
diff -r 4570575d060c -r 038cecaa9e7c ensemble.xml --- a/ensemble.xml Fri Aug 17 12:28:21 2018 -0400 +++ b/ensemble.xml Thu Aug 23 16:16:12 2018 -0400 |
[ |
@@ -20,10 +20,10 @@ import numpy as np import sklearn.ensemble import pandas -import pickle from scipy.io import mmread -execfile("$__tool_directory__/utils.py") +execfile("$__tool_directory__/sk_whitelist.py") +execfile("$__tool_directory__/utils.py", globals()) # Get inputs, outputs. input_json_path = sys.argv[1] @@ -75,7 +75,7 @@ else: with open(infile_model, 'rb') as model_handler: - classifier_object = pickle.load(model_handler) + classifier_object = SafePickler.load(model_handler) header = 'infer' if params["selected_tasks"]["header"] else None data = pandas.read_csv(infile_data, sep='\t', header=header, index_col=None, parse_dates=True, encoding=None, tupleize_cols=False) prediction = classifier_object.predict(data) |
b |
diff -r 4570575d060c -r 038cecaa9e7c main_macros.xml --- a/main_macros.xml Fri Aug 17 12:28:21 2018 -0400 +++ b/main_macros.xml Thu Aug 23 16:16:12 2018 -0400 |
b |
@@ -1424,19 +1424,19 @@ <xml name="sklearn_citation"> <citations> <citation type="bibtex"> - @article{scikit-learn, - title={Scikit-learn: Machine Learning in {P}ython}, - author={Pedregosa, F. and Varoquaux, G. and Gramfort, A. and Michel, V. - and Thirion, B. and Grisel, O. and Blondel, M. and Prettenhofer, P. - and Weiss, R. and Dubourg, V. and Vanderplas, J. and Passos, A. and - Cournapeau, D. and Brucher, M. and Perrot, M. and Duchesnay, E.}, - journal={Journal of Machine Learning Research}, - volume={12}, - pages={2825--2830}, - year={2011} - url = {https://github.com/scikit-learn/scikit-learn} - } + @article{scikit-learn, + title={Scikit-learn: Machine Learning in {P}ython}, + author={Pedregosa, F. and Varoquaux, G. and Gramfort, A. and Michel, V. + and Thirion, B. and Grisel, O. and Blondel, M. and Prettenhofer, P. + and Weiss, R. and Dubourg, V. and Vanderplas, J. and Passos, A. and + Cournapeau, D. and Brucher, M. and Perrot, M. and Duchesnay, E.}, + journal={Journal of Machine Learning Research}, + volume={12}, + pages={2825--2830}, + year={2011} + } </citation> + <yield/> </citations> </xml> @@ -1454,4 +1454,48 @@ </citations> </xml> + <xml name="skrebate_citation"> + <citation type="bibtex"> + @article{DBLP:journals/corr/abs-1711-08477, + author = {Ryan J. Urbanowicz and + Randal S. Olson and + Peter Schmitt and + Melissa Meeker and + Jason H. Moore}, + title = {Benchmarking Relief-Based Feature Selection Methods}, + journal = {CoRR}, + volume = {abs/1711.08477}, + year = {2017}, + url = {http://arxiv.org/abs/1711.08477}, + archivePrefix = {arXiv}, + eprint = {1711.08477}, + timestamp = {Mon, 13 Aug 2018 16:46:04 +0200}, + biburl = {https://dblp.org/rec/bib/journals/corr/abs-1711-08477}, + bibsource = {dblp computer science bibliography, https://dblp.org} + } + </citation> + </xml> + + <xml name="xgboost_citation"> + <citation type="bibtex"> + @inproceedings{Chen:2016:XST:2939672.2939785, + author = {Chen, Tianqi and Guestrin, Carlos}, + title = {{XGBoost}: A Scalable Tree Boosting System}, + booktitle = {Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining}, + series = {KDD '16}, + year = {2016}, + isbn = {978-1-4503-4232-2}, + location = {San Francisco, California, USA}, + pages = {785--794}, + numpages = {10}, + url = {http://doi.acm.org/10.1145/2939672.2939785}, + doi = {10.1145/2939672.2939785}, + acmid = {2939785}, + publisher = {ACM}, + address = {New York, NY, USA}, + keywords = {large-scale machine learning}, + } + </citation> + </xml> + </macros> |
b |
diff -r 4570575d060c -r 038cecaa9e7c sk_whitelist.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sk_whitelist.py Thu Aug 23 16:16:12 2018 -0400 |
b |
b"@@ -0,0 +1,757 @@\n+# class or function names from scikit-learn\n+SK_NAMES = (\n+ 'sklearn._ASSUME_FINITE', 'sklearn._isotonic._inplace_contiguous_isotonic_regression',\n+ 'sklearn._isotonic._make_unique', 'sklearn.base.BaseEstimator',\n+ 'sklearn.base.BiclusterMixin', 'sklearn.base.ClassifierMixin',\n+ 'sklearn.base.ClusterMixin', 'sklearn.base.DensityMixin',\n+ 'sklearn.base.MetaEstimatorMixin', 'sklearn.base.RegressorMixin',\n+ 'sklearn.base.TransformerMixin', 'sklearn.base._first_and_last_element',\n+ 'sklearn.base._pprint', 'sklearn.base.clone',\n+ 'sklearn.base.is_classifier', 'sklearn.base.is_regressor',\n+ 'sklearn.clone', 'sklearn.cluster.AffinityPropagation',\n+ 'sklearn.cluster.AgglomerativeClustering', 'sklearn.cluster.Birch',\n+ 'sklearn.cluster.DBSCAN', 'sklearn.cluster.FeatureAgglomeration',\n+ 'sklearn.cluster.KMeans', 'sklearn.cluster.MeanShift',\n+ 'sklearn.cluster.MiniBatchKMeans', 'sklearn.cluster.SpectralBiclustering',\n+ 'sklearn.cluster.SpectralClustering', 'sklearn.cluster.SpectralCoclustering',\n+ 'sklearn.cluster._dbscan_inner.dbscan_inner', 'sklearn.cluster._feature_agglomeration.AgglomerationTransform',\n+ 'sklearn.cluster._hierarchical.WeightedEdge', 'sklearn.cluster._hierarchical._get_parents',\n+ 'sklearn.cluster._hierarchical._hc_get_descendent', 'sklearn.cluster._hierarchical.average_merge',\n+ 'sklearn.cluster._hierarchical.compute_ward_dist', 'sklearn.cluster._hierarchical.hc_get_heads',\n+ 'sklearn.cluster._hierarchical.max_merge', 'sklearn.cluster._k_means._assign_labels_array',\n+ 'sklearn.cluster._k_means._assign_labels_csr', 'sklearn.cluster._k_means._centers_dense',\n+ 'sklearn.cluster._k_means._centers_sparse', 'sklearn.cluster._k_means._mini_batch_update_csr',\n+ 'sklearn.cluster._k_means_elkan.k_means_elkan', 'sklearn.cluster.affinity_propagation',\n+ 'sklearn.cluster.affinity_propagation_.AffinityPropagation', 'sklearn.cluster.affinity_propagation_.affinity_propagation',\n+ 'sklearn.cluster.bicluster.BaseSpectral', 'sklearn.cluster.bicluster.SpectralBiclustering',\n+ 'sklearn.cluster.bicluster.SpectralCoclustering', 'sklearn.cluster.bicluster._bistochastic_normalize',\n+ 'sklearn.cluster.bicluster._log_normalize', 'sklearn.cluster.bicluster._scale_normalize',\n+ 'sklearn.cluster.birch.Birch', 'sklearn.cluster.birch._CFNode',\n+ 'sklearn.cluster.birch._CFSubcluster', 'sklearn.cluster.birch._iterate_sparse_X',\n+ 'sklearn.cluster.birch._split_node', 'sklearn.cluster.dbscan',\n+ 'sklearn.cluster.dbscan_.DBSCAN', 'sklearn.cluster.dbscan_.dbscan',\n+ 'sklearn.cluster.estimate_bandwidth', 'sklearn.cluster.get_bin_seeds',\n+ 'sklearn.cluster.hierarchical.AgglomerativeClustering', 'sklearn.cluster.hierarchical.FeatureAgglomeration',\n+ 'sklearn.cluster.hierarchical._TREE_BUILDERS', 'sklearn.cluster.hierarchical._average_linkage',\n+ 'sklearn.cluster.hierarchical._complete_linkage', 'sklearn.cluster.hierarchical._fix_connectivity',\n+ 'sklearn.cluster.hierarchical._hc_cut', 'sklearn.cluster.hierarchical.linkage_tree',\n+ 'sklearn.cluster.hierarchical.ward_tree', 'sklearn.cluster.k_means',\n+ 'sklearn.cluster.k_means_.FLOAT_DTYPES', 'sklearn.cluster.k_means_.KMeans',\n+ 'sklearn.cluster.k_means_.MiniBatchKMeans', 'sklearn.cluster.k_means_._init_centroids',\n+ 'sklearn.cluster.k_means_._k_init', 'sklearn.cluster.k_means_._kmeans_single_elkan',\n+ 'sklearn.cluster.k_means_._kmeans_single_lloyd', 'sklearn.cluster.k_means_._labels_inertia',\n+ 'sklearn.cluster.k_means_._labels_inertia_precompute_dense', 'sklearn.cluster.k_means_._mini_batch_convergence',\n+ 'sklearn.cluster.k_means_._mini_batch_step', 'sklearn.cluster.k_means_._tolerance',\n+ 'sklearn.cluster.k_means_._validate_center_shape', 'sklearn.cluster.k_means_.k_means',\n+ 'sklearn.cluster.k_means_.string_types', 'sklearn.cluster.linkage_tree',\n+ 'sklearn.cluster.mean_shift', 'sklearn.cluster.mean_shift_.MeanShift',\n+ 'sklearn.cluster.mean_shift_."..b"n.utils.validation.check_array', 'sklearn.utils.validation.check_consistent_length',\n+ 'sklearn.utils.validation.check_is_fitted', 'sklearn.utils.validation.check_memory',\n+ 'sklearn.utils.validation.check_non_negative', 'sklearn.utils.validation.check_random_state',\n+ 'sklearn.utils.validation.check_symmetric', 'sklearn.utils.validation.column_or_1d',\n+ 'sklearn.utils.validation.has_fit_parameter', 'sklearn.utils.validation.indexable',\n+ 'sklearn.utils.weight_vector.WeightVector'\n+)\n+\n+\n+# class or function names from skrebate\n+SKR_NAMES = (\n+ 'skrebate.MultiSURF', 'skrebate.MultiSURFstar',\n+ 'skrebate.ReliefF', 'skrebate.SURF',\n+ 'skrebate.SURFstar', 'skrebate.TuRF',\n+ 'skrebate.multisurf.MultiSURF', 'skrebate.multisurfstar.MultiSURFstar',\n+ 'skrebate.relieff.ReliefF', 'skrebate.scoring_utils.MultiSURF_compute_scores',\n+ 'skrebate.scoring_utils.MultiSURFstar_compute_scores', 'skrebate.scoring_utils.ReliefF_compute_scores',\n+ 'skrebate.scoring_utils.SURF_compute_scores', 'skrebate.scoring_utils.SURFstar_compute_scores',\n+ 'skrebate.scoring_utils.compute_score', 'skrebate.scoring_utils.get_row_missing',\n+ 'skrebate.scoring_utils.ramp_function', 'skrebate.surf.SURF',\n+ 'skrebate.surfstar.SURFstar', 'skrebate.turf.TuRF'\n+)\n+\n+\n+# class or function names from xgboost\n+XGB_NAMES = (\n+ 'xgboost.Booster', 'xgboost.DMatrix',\n+ 'xgboost.VERSION_FILE', 'xgboost.XGBClassifier',\n+ 'xgboost.XGBModel', 'xgboost.XGBRegressor',\n+ 'xgboost.callback._fmt_metric', 'xgboost.callback._get_callback_context',\n+ 'xgboost.callback.early_stop', 'xgboost.callback.print_evaluation',\n+ 'xgboost.callback.record_evaluation', 'xgboost.callback.reset_learning_rate',\n+ 'xgboost.compat.PANDAS_INSTALLED', 'xgboost.compat.PY3',\n+ 'xgboost.compat.SKLEARN_INSTALLED', 'xgboost.compat.STRING_TYPES',\n+ 'xgboost.compat.py_str', 'xgboost.core.Booster',\n+ 'xgboost.core.CallbackEnv', 'xgboost.core.DMatrix',\n+ 'xgboost.core.EarlyStopException', 'xgboost.core.PANDAS_DTYPE_MAPPER',\n+ 'xgboost.core.PANDAS_INSTALLED', 'xgboost.core.PY3',\n+ 'xgboost.core.STRING_TYPES', 'xgboost.core.XGBoostError',\n+ 'xgboost.core._check_call', 'xgboost.core._load_lib',\n+ 'xgboost.core._maybe_pandas_data', 'xgboost.core._maybe_pandas_label',\n+ 'xgboost.core.c_array', 'xgboost.core.c_str',\n+ 'xgboost.core.ctypes2buffer', 'xgboost.core.ctypes2numpy',\n+ 'xgboost.core.from_cstr_to_pystr', 'xgboost.core.from_pystr_to_cstr',\n+ 'xgboost.cv', 'xgboost.f',\n+ 'xgboost.libpath.XGBoostLibraryNotFound', 'xgboost.libpath.find_lib_path',\n+ 'xgboost.plot_importance', 'xgboost.plot_tree',\n+ 'xgboost.plotting._EDGEPAT', 'xgboost.plotting._EDGEPAT2',\n+ 'xgboost.plotting._LEAFPAT', 'xgboost.plotting._NODEPAT',\n+ 'xgboost.plotting._parse_edge', 'xgboost.plotting._parse_node',\n+ 'xgboost.plotting.plot_importance', 'xgboost.plotting.plot_tree',\n+ 'xgboost.plotting.to_graphviz', 'xgboost.rabit.DTYPE_ENUM__',\n+ 'xgboost.rabit.STRING_TYPES', 'xgboost.rabit._init_rabit',\n+ 'xgboost.rabit.allreduce', 'xgboost.rabit.broadcast',\n+ 'xgboost.rabit.finalize', 'xgboost.rabit.get_processor_name',\n+ 'xgboost.rabit.get_rank', 'xgboost.rabit.get_world_size',\n+ 'xgboost.rabit.init', 'xgboost.rabit.tracker_print',\n+ 'xgboost.rabit.version_number', 'xgboost.sklearn.SKLEARN_INSTALLED',\n+ 'xgboost.sklearn.XGBClassifier', 'xgboost.sklearn.XGBModel',\n+ 'xgboost.sklearn.XGBRegressor', 'xgboost.sklearn._objective_decorator',\n+ 'xgboost.to_graphviz', 'xgboost.train',\n+ 'xgboost.training.CVPack', 'xgboost.training.SKLEARN_INSTALLED',\n+ 'xgboost.training.STRING_TYPES', 'xgboost.training._train_internal',\n+ 'xgboost.training.aggcv', 'xgboost.training.cv',\n+ 'xgboost.training.mknfold', 'xgboost.training.train'\n+)\n+\n+\n+NUMPY_NAMES = (\n+ 'numpy.core.multiarray._reconstruct', 'numpy.ndarray',\n+ 'numpy.dtype', 'numpy.core.multiarray.scalar',\n+ 'numpy.random.__RandomState_ctor'\n+)\n" |
b |
diff -r 4570575d060c -r 038cecaa9e7c test-data/gbc_model01 |
b |
Binary file test-data/gbc_model01 has changed |
b |
diff -r 4570575d060c -r 038cecaa9e7c test-data/gbr_model01 |
b |
Binary file test-data/gbr_model01 has changed |
b |
diff -r 4570575d060c -r 038cecaa9e7c test-data/nn_model01.txt --- a/test-data/nn_model01.txt Fri Aug 17 12:28:21 2018 -0400 +++ b/test-data/nn_model01.txt Thu Aug 23 16:16:12 2018 -0400 |
[ |
b"@@ -1,14 +1,13 @@\n ccopy_reg\n _reconstructor\n-p0\n+p1\n (csklearn.neighbors.classification\n KNeighborsClassifier\n-p1\n+p2\n c__builtin__\n object\n-p2\n-Ntp3\n-Rp4\n+p3\n+NtRp4\n (dp5\n S'n_neighbors'\n p6\n@@ -25,108 +24,87 @@\n ndarray\n p10\n (I0\n-tp11\n-S'b'\n-p12\n-tp13\n-Rp14\n+tS'b'\n+tRp11\n (I1\n (I48\n-tp15\n-cnumpy\n+tcnumpy\n dtype\n-p16\n+p12\n (S'i8'\n-p17\n I0\n I1\n-tp18\n-Rp19\n+tRp13\n (I3\n S'<'\n-p20\n NNNI-1\n I-1\n I0\n-tp21\n-bI00\n+tbI00\n S'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\n-p22\n-tp23\n-bsS'algorithm'\n-p24\n+tbsS'algorithm'\n+p14\n Vbrute\n-p25\n+p15\n sS'_sklearn_version'\n-p26\n+p16\n S'0.19.1'\n-p27\n+p17\n sS'metric'\n-p28\n+p18\n S'minkowski'\n-p29\n+p19\n sS'classes_'\n-p30\n+p20\n g9\n (g10\n (I0\n-tp31\n-g12\n-tp32\n-Rp33\n+tS'b'\n+tRp21\n (I1\n (I4\n-tp34\n-g19\n+tg13\n I00\n S'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\n-p35\n-tp36\n-bsS'metric_params'\n-p37\n+tbsS'metric_params'\n+p22\n NsS'p'\n-p38\n I2\n sS'effective_metric_params_'\n-p39\n-(dp40\n+p23\n+(dp24\n sS'radius'\n-p41\n+p25\n NsS'leaf_size'\n-p42\n+p26\n I30\n sS'_fit_method'\n-p43\n-g25\n+p27\n+g15\n sS'weights'\n-p44\n+p28\n Vuniform\n-p45\n+p29\n sS'_tree'\n-p46\n+p30\n NsS'effective_metric_'\n-p47\n+p31\n S'euclidean'\n-p48\n+p32\n sS'outputs_2d_'\n-p49\n+p33\n I00\n sS'_fit_X'\n-p50\n+p34\n g9\n (g10\n (I0\n-tp51\n-g12\n-tp52\n-Rp53\n+tS'b'\n+tRp35\n (I1\n (I48\n I4\n-tp54\n-g19\n+tg13\n I01\n S'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00"..b'd\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xc8\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xc3\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xad\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xce\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xbd\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xce\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xc3\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x93\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa2\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xab\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa6\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xc1\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xb1\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x9d\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xaf\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x94\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa4\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa8\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa8\\xff\\xff\\xff\\xff\\xff\\xff\\xff6\\x00\\x00\\x00\\x00\\x00\\x00\\x00*\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\'\\x00\\x00\\x00\\x00\\x00\\x00\\x000\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x1f\\x00\\x00\\x00\\x00\\x00\\x00\\x00!\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x17\\x00\\x00\\x00\\x00\\x00\\x00\\x00&\\x00\\x00\\x00\\x00\\x00\\x00\\x00"\\x00\\x00\\x00\\x00\\x00\\x00\\x00#\\x00\\x00\\x00\\x00\\x00\\x00\\x00@\\x00\\x00\\x00\\x00\\x00\\x00\\x000\\x00\\x00\\x00\\x00\\x00\\x00\\x00A\\x00\\x00\\x00\\x00\\x00\\x00\\x00=\\x00\\x00\\x00\\x00\\x00\\x00\\x00+\\x00\\x00\\x00\\x00\\x00\\x00\\x00<\\x00\\x00\\x00\\x00\\x00\\x00\\x007\\x00\\x00\\x00\\x00\\x00\\x00\\x005\\x00\\x00\\x00\\x00\\x00\\x00\\x00,\\x00\\x00\\x00\\x00\\x00\\x00\\x00A\\x00\\x00\\x00\\x00\\x00\\x00\\x004\\x00\\x00\\x00\\x00\\x00\\x00\\x008\\x00\\x00\\x00\\x00\\x00\\x00\\x00V\\x00\\x00\\x00\\x00\\x00\\x00\\x00]\\x00\\x00\\x00\\x00\\x00\\x00\\x00^\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\\\\x00\\x00\\x00\\x00\\x00\\x00\\x00[\\x00\\x00\\x00\\x00\\x00\\x00\\x00W\\x00\\x00\\x00\\x00\\x00\\x00\\x00[\\x00\\x00\\x00\\x00\\x00\\x00\\x00Q\\x00\\x00\\x00\\x00\\x00\\x00\\x00N\\x00\\x00\\x00\\x00\\x00\\x00\\x00W\\x00\\x00\\x00\\x00\\x00\\x00\\x00I\\x00\\x00\\x00\\x00\\x00\\x00\\x00a\\x00\\x00\\x00\\x00\\x00\\x00\\x00o\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x17\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x1a\\x00\\x00\\x00\\x00\\x00\\x00\\x00!\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\t\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\t\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x1a\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x13\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x15\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x1b\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x0f\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xb6\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa4\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x9d\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x8d\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa0\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x93\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa0\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x9a\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa6\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x95\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xb2\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xb4\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xb7\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xcf\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xcf\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xb1\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x9e\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xc5\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xc8\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xc3\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xac\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xb5\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xba\\xff\\xff\\xff\\xff\\xff\\xff\\xff+\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x0f\\x00\\x00\\x00\\x00\\x00\\x00\\x00$\\x00\\x00\\x00\\x00\\x00\\x00\\x00>\\x00\\x00\\x00\\x00\\x00\\x00\\x00F\\x00\\x00\\x00\\x00\\x00\\x00\\x00/\\x00\\x00\\x00\\x00\\x00\\x00\\x004\\x00\\x00\\x00\\x00\\x00\\x00\\x00.\\x00\\x00\\x00\\x00\\x00\\x00\\x00"\\x00\\x00\\x00\\x00\\x00\\x00\\x00-\\x00\\x00\\x00\\x00\\x00\\x00\\x002\\x00\\x00\\x00\\x00\\x00\\x00\\x00-\\x00\\x00\\x00\\x00\\x00\\x00\\x00-\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xa4\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa0\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa8\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x8e\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x96\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa3\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x94\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x92\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x94\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x96\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x96\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x99\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x04\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x1f\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xf9\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfb\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\t\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xf8\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x04\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x15\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x12\\x00\\x00\\x00\\x00\\x00\\x00\\x00\'\n-p55\n-tp56\n-bsb.\n\\ No newline at end of file\n+tbsb.\n\\ No newline at end of file\n' |
b |
diff -r 4570575d060c -r 038cecaa9e7c test-data/nn_model02.txt --- a/test-data/nn_model02.txt Fri Aug 17 12:28:21 2018 -0400 +++ b/test-data/nn_model02.txt Thu Aug 23 16:16:12 2018 -0400 |
[ |
b"@@ -1,14 +1,13 @@\n ccopy_reg\n _reconstructor\n-p0\n+p1\n (csklearn.neighbors.classification\n RadiusNeighborsClassifier\n-p1\n+p2\n c__builtin__\n object\n-p2\n-Ntp3\n-Rp4\n+p3\n+NtRp4\n (dp5\n S'n_neighbors'\n p6\n@@ -24,213 +23,168 @@\n ndarray\n p10\n (I0\n-tp11\n-S'b'\n-p12\n-tp13\n-Rp14\n+tS'b'\n+tRp11\n (I1\n (I48\n-tp15\n-cnumpy\n+tcnumpy\n dtype\n-p16\n+p12\n (S'i8'\n-p17\n I0\n I1\n-tp18\n-Rp19\n+tRp13\n (I3\n S'<'\n-p20\n NNNI-1\n I-1\n I0\n-tp21\n-bI00\n+tbI00\n S'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\n-p22\n-tp23\n-bsS'algorithm'\n-p24\n+tbsS'algorithm'\n+p14\n Vauto\n-p25\n+p15\n sS'_sklearn_version'\n-p26\n+p16\n S'0.19.1'\n-p27\n+p17\n sS'metric'\n-p28\n+p18\n S'minkowski'\n-p29\n+p19\n sS'classes_'\n-p30\n+p20\n g9\n (g10\n (I0\n-tp31\n-g12\n-tp32\n-Rp33\n+tS'b'\n+tRp21\n (I1\n (I4\n-tp34\n-g19\n+tg13\n I00\n S'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\n-p35\n-tp36\n-bsS'outputs_2d_'\n-p37\n+tbsS'outputs_2d_'\n+p22\n I00\n sS'metric_params'\n-p38\n+p23\n NsS'p'\n-p39\n I2\n sS'effective_metric_params_'\n-p40\n-(dp41\n+p24\n+(dp25\n sS'radius'\n-p42\n-F1.0\n+p26\n+F1\n sS'leaf_size'\n-p43\n+p27\n I30\n sS'_fit_method'\n-p44\n+p28\n S'kd_tree'\n-p45\n+p29\n sS'weights'\n-p46\n+p30\n Vuniform\n-p47\n+p31\n sS'_tree'\n-p48\n+p32\n csklearn.neighbors.kd_tree\n newObj\n-p49\n+p33\n (csklearn.neighbors.kd_tree\n BinaryTree\n-p50\n-tp51\n-Rp52\n+p34\n+tRp35\n (g9\n (g10\n (I0\n-tp53\n-g12\n-tp54\n-Rp55\n+tS'b'\n+tRp36\n (I1\n (I48\n I4\n-tp56\n-g16\n+tg12\n (S'f8'\n-p57\n I0\n I1\n-tp58\n-Rp59\n+tRp37\n (I3\n S'<'\n-p60\n NNNI-1\n I-1\n I0\n-tp61\n-bI00\n+tbI00\n S'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00F@\\x00\\x00\\x00\\x00\\x00\\x00P@\\x00\\x00\\x00\\x00\\x00\\x00S\\xc0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x80I@\\x00\\x00\\x00\\x00\\x00\\x00H@\\x00\\x00\\x00\\x00\\x00@R\\xc0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00M@\\x00\\x00\\x00\\x00\\x00@P@\\x00\\x00\\x00\\x00\\x00\\x80H\\xc0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x80E@\\x00\\x00\\x00\\x00\\x00\\x80N@\\x00\\x00\\x00\\x00\\x00\\x80H\\xc0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x80F@\\x00\\x00\\x00\\x00\\x00\\x80E@\\x00\\x00\\x00\\x00\\x00\\xc0S\\xc0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00E@\\x00\\x00\\x00\\x00\\x00\\x00N@\\x00\\x00\\x00\\x00\\x00\\x80X\\xc0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00I@\\x00\\x00\\x00\\x00\\x00\\x80K@\\x00\\x00\\x00\\x00\\x00\\x80M\\xc0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x80J@\\x00\\x00\\x00\\x00\\x00\\x80J@\\x00\\x00\\x00\\x00\\x00\\x00L\\xc0\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x80F@\\x00\\x00\\x00\\x00\\x00\\x00F@\\x00\\x"..b'xff\\xff\\xff\\xff\\xff\\xff\\xff\\xc8\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xc3\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xad\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xce\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xbd\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xce\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xc3\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x93\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa2\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xab\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa6\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xc1\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xb1\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x9d\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xaf\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x94\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa4\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa8\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa8\\xff\\xff\\xff\\xff\\xff\\xff\\xff6\\x00\\x00\\x00\\x00\\x00\\x00\\x00*\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\'\\x00\\x00\\x00\\x00\\x00\\x00\\x000\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x1f\\x00\\x00\\x00\\x00\\x00\\x00\\x00!\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x17\\x00\\x00\\x00\\x00\\x00\\x00\\x00&\\x00\\x00\\x00\\x00\\x00\\x00\\x00"\\x00\\x00\\x00\\x00\\x00\\x00\\x00#\\x00\\x00\\x00\\x00\\x00\\x00\\x00@\\x00\\x00\\x00\\x00\\x00\\x00\\x000\\x00\\x00\\x00\\x00\\x00\\x00\\x00A\\x00\\x00\\x00\\x00\\x00\\x00\\x00=\\x00\\x00\\x00\\x00\\x00\\x00\\x00+\\x00\\x00\\x00\\x00\\x00\\x00\\x00<\\x00\\x00\\x00\\x00\\x00\\x00\\x007\\x00\\x00\\x00\\x00\\x00\\x00\\x005\\x00\\x00\\x00\\x00\\x00\\x00\\x00,\\x00\\x00\\x00\\x00\\x00\\x00\\x00A\\x00\\x00\\x00\\x00\\x00\\x00\\x004\\x00\\x00\\x00\\x00\\x00\\x00\\x008\\x00\\x00\\x00\\x00\\x00\\x00\\x00V\\x00\\x00\\x00\\x00\\x00\\x00\\x00]\\x00\\x00\\x00\\x00\\x00\\x00\\x00^\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\\\\x00\\x00\\x00\\x00\\x00\\x00\\x00[\\x00\\x00\\x00\\x00\\x00\\x00\\x00W\\x00\\x00\\x00\\x00\\x00\\x00\\x00[\\x00\\x00\\x00\\x00\\x00\\x00\\x00Q\\x00\\x00\\x00\\x00\\x00\\x00\\x00N\\x00\\x00\\x00\\x00\\x00\\x00\\x00W\\x00\\x00\\x00\\x00\\x00\\x00\\x00I\\x00\\x00\\x00\\x00\\x00\\x00\\x00a\\x00\\x00\\x00\\x00\\x00\\x00\\x00o\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x17\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x1a\\x00\\x00\\x00\\x00\\x00\\x00\\x00!\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\t\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\t\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x1a\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x13\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x15\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x1b\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x0f\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xb6\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa4\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x9d\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x8d\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa0\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x93\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa0\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x9a\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa6\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x95\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xb2\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xb4\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xb7\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xcf\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xcf\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xb1\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x9e\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xc5\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xc8\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xc3\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xac\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xb5\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xba\\xff\\xff\\xff\\xff\\xff\\xff\\xff+\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x0f\\x00\\x00\\x00\\x00\\x00\\x00\\x00$\\x00\\x00\\x00\\x00\\x00\\x00\\x00>\\x00\\x00\\x00\\x00\\x00\\x00\\x00F\\x00\\x00\\x00\\x00\\x00\\x00\\x00/\\x00\\x00\\x00\\x00\\x00\\x00\\x004\\x00\\x00\\x00\\x00\\x00\\x00\\x00.\\x00\\x00\\x00\\x00\\x00\\x00\\x00"\\x00\\x00\\x00\\x00\\x00\\x00\\x00-\\x00\\x00\\x00\\x00\\x00\\x00\\x002\\x00\\x00\\x00\\x00\\x00\\x00\\x00-\\x00\\x00\\x00\\x00\\x00\\x00\\x00-\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xa4\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa0\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa8\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x8e\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x96\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xa3\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x94\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x92\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x94\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x96\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x96\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x99\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x04\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x1f\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xf9\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfb\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\t\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xf8\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x04\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x15\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x12\\x00\\x00\\x00\\x00\\x00\\x00\\x00\'\n-p122\n-tp123\n-bsb.\n\\ No newline at end of file\n+tbsb.\n\\ No newline at end of file\n' |
b |
diff -r 4570575d060c -r 038cecaa9e7c test-data/nn_model03.txt --- a/test-data/nn_model03.txt Fri Aug 17 12:28:21 2018 -0400 +++ b/test-data/nn_model03.txt Thu Aug 23 16:16:12 2018 -0400 |
b |
@@ -1,14 +1,13 @@ ccopy_reg _reconstructor -p0 +p1 (csklearn.neighbors.nearest_centroid NearestCentroid -p1 +p2 c__builtin__ object -p2 -Ntp3 -Rp4 +p3 +NtRp4 (dp5 S'centroids_' p6 @@ -19,73 +18,54 @@ ndarray p8 (I0 -tp9 -S'b' -p10 -tp11 -Rp12 +tS'b' +tRp9 (I1 (I4 I4 -tp13 -cnumpy +tcnumpy dtype -p14 +p10 (S'f8' -p15 I0 I1 -tp16 -Rp17 +tRp11 (I3 S'<' -p18 NNNI-1 I-1 I0 -tp19 -bI00 +tbI00 S'\x00\x00\x00\x00\x00\x00\x00\x00\xab\xaa\xaa\xaa\xaa\x8aG@\x00\x00\x00\x00\x00\xc0K@UUUUUEQ\xc0\x00\x00\x00\x00\x00\x00\x00@\xab\xaa\xaa\xaa\xaajV\xc0\xab\xaa\xaa\xaa\xaa*3@\x00\x00\x00\x00\x00\xa0Y\xc0\x00\x00\x00\x00\x00\x00\xf0?\xc5N\xec\xc4N\xecM\xc0;\xb1\x13;\xb1SV@\x14;\xb1\x13;\xb1F@\x00\x00\x00\x00\x00\x00\x08@\xe9\xa2\x8b.\xba\xe8B@\x8c.\xba\xe8\xa2\x0bX\xc0t\xd1E\x17]t\x19@' -p20 -tp21 -bsS'metric' -p22 +tbsS'metric' +p12 Veuclidean -p23 +p13 sS'classes_' -p24 +p14 g7 (g8 (I0 -tp25 -g10 -tp26 -Rp27 +tS'b' +tRp15 (I1 (I4 -tp28 -g14 +tg10 (S'i8' -p29 I0 I1 -tp30 -Rp31 +tRp16 (I3 S'<' -p32 NNNI-1 I-1 I0 -tp33 -bI00 +tbI00 S'\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00' -p34 -tp35 -bsS'_sklearn_version' -p36 +tbsS'_sklearn_version' +p17 S'0.19.1' -p37 +p18 sS'shrink_threshold' -p38 +p19 Nsb. \ No newline at end of file |
b |
diff -r 4570575d060c -r 038cecaa9e7c test-data/pipeline01 |
b |
Binary file test-data/pipeline01 has changed |
b |
diff -r 4570575d060c -r 038cecaa9e7c test-data/pipeline04 |
b |
Binary file test-data/pipeline04 has changed |
b |
diff -r 4570575d060c -r 038cecaa9e7c test-data/rfc_model01 |
b |
Binary file test-data/rfc_model01 has changed |
b |
diff -r 4570575d060c -r 038cecaa9e7c test-data/rfr_model01 |
b |
Binary file test-data/rfr_model01 has changed |
b |
diff -r 4570575d060c -r 038cecaa9e7c test-data/searchCV01 |
b |
Binary file test-data/searchCV01 has changed |
b |
diff -r 4570575d060c -r 038cecaa9e7c test-data/svc_model01.txt |
b |
Binary file test-data/svc_model01.txt has changed |
b |
diff -r 4570575d060c -r 038cecaa9e7c test-data/svc_model02.txt |
b |
Binary file test-data/svc_model02.txt has changed |
b |
diff -r 4570575d060c -r 038cecaa9e7c test-data/svc_model03.txt |
b |
Binary file test-data/svc_model03.txt has changed |
b |
diff -r 4570575d060c -r 038cecaa9e7c test-data/svc_prediction_result03.tabular --- a/test-data/svc_prediction_result03.tabular Fri Aug 17 12:28:21 2018 -0400 +++ b/test-data/svc_prediction_result03.tabular Thu Aug 23 16:16:12 2018 -0400 |
b |
@@ -25,7 +25,7 @@ 1 -50 97 45 2 1 -61 111 45 2 2 -109 23 -92 2 -2 -94 20 -96 3 +2 -94 20 -96 1 2 -85 26 -88 2 2 -90 33 -114 0 2 -63 9 -106 0 @@ -33,7 +33,7 @@ 2 -99 26 -108 1 2 -81 19 -110 0 2 -108 21 -108 1 -2 -92 27 -106 0 +2 -92 27 -106 1 2 -88 2 -106 3 2 -88 15 -103 3 3 54 -74 4 3 |
b |
diff -r 4570575d060c -r 038cecaa9e7c utils.py --- a/utils.py Fri Aug 17 12:28:21 2018 -0400 +++ b/utils.py Thu Aug 23 16:16:12 2018 -0400 |
[ |
@@ -2,7 +2,7 @@ import os import pandas import re -import pickle +import cPickle as pickle import warnings import numpy as np import xgboost @@ -10,10 +10,62 @@ import sklearn import ast from asteval import Interpreter, make_symbol_table -from sklearn import metrics, model_selection, ensemble, svm, linear_model, naive_bayes, tree, neighbors +from sklearn import (cluster, decomposition, ensemble, feature_extraction, feature_selection, + gaussian_process, kernel_approximation, linear_model, metrics, + model_selection, naive_bayes, neighbors, pipeline, preprocessing, + svm, linear_model, tree, discriminant_analysis) N_JOBS = int( os.environ.get('GALAXY_SLOTS', 1) ) +class SafePickler(object): + """ + Used to safely deserialize scikit-learn model objects serialized by cPickle.dump + Usage: + eg.: SafePickler.load(pickled_file_object) + """ + @classmethod + def find_class(self, module, name): + + bad_names = ('and', 'as', 'assert', 'break', 'class', 'continue', + 'def', 'del', 'elif', 'else', 'except', 'exec', + 'finally', 'for', 'from', 'global', 'if', 'import', + 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', + 'raise', 'return', 'try', 'system', 'while', 'with', + 'True', 'False', 'None', 'eval', 'execfile', '__import__', + '__package__', '__subclasses__', '__bases__', '__globals__', + '__code__', '__closure__', '__func__', '__self__', '__module__', + '__dict__', '__class__', '__call__', '__get__', + '__getattribute__', '__subclasshook__', '__new__', + '__init__', 'func_globals', 'func_code', 'func_closure', + 'im_class', 'im_func', 'im_self', 'gi_code', 'gi_frame', + '__asteval__', 'f_locals', '__mro__') + good_names = ('copy_reg._reconstructor', '__builtin__.object') + + if re.match(r'^[a-zA-Z_][a-zA-Z0-9_]*$', name): + fullname = module + '.' + name + if (fullname in good_names)\ + or ( ( module.startswith('sklearn.') + or module.startswith('xgboost.') + or module.startswith('skrebate.') + or module.startswith('numpy.') + or module == 'numpy' + ) + and (name not in bad_names) + ) : + # TODO: replace with a whitelist checker + if fullname not in SK_NAMES + SKR_NAMES + XGB_NAMES + NUMPY_NAMES + good_names: + print("Warning: global %s is not in pickler whitelist yet and will loss support soon. Contact tool author or leave a message at github.com" % fullname) + mod = sys.modules[module] + return getattr(mod, name) + + raise pickle.UnpicklingError("global '%s' is forbidden" % fullname) + + @classmethod + def load(self, file): + obj = pickle.Unpickler(file) + obj.find_global = self.find_class + return obj.load() + def read_columns(f, c=None, c_option='by_index_number', return_df=False, **args): data = pandas.read_csv(f, **args) if c_option == 'by_index_number': @@ -48,7 +100,7 @@ if inputs['model_inputter']['input_mode'] == 'prefitted': model_file = inputs['model_inputter']['fitted_estimator'] with open(model_file, 'rb') as model_handler: - fitted_estimator = pickle.load(model_handler) + fitted_estimator = SafePickler.load(model_handler) new_selector = selector(fitted_estimator, prefit=True, **options) else: estimator_json = inputs['model_inputter']["estimator_selector"] @@ -132,9 +184,9 @@ if load_scipy: scipy_distributions = scipy.stats.distributions.__dict__ - for key in scipy_distributions.keys(): - if isinstance(scipy_distributions[key], (scipy.stats.rv_continuous, scipy.stats.rv_discrete)): - syms['scipy_stats_' + key] = scipy_distributions[key] + for k, v in scipy_distributions.items(): + if isinstance(v, (scipy.stats.rv_continuous, scipy.stats.rv_discrete)): + syms['scipy_stats_' + k] = v if load_numpy: from_numpy_random = ['beta', 'binomial', 'bytes', 'chisquare', 'choice', 'dirichlet', 'division', |