Package: pymilo
Table of contentsOverviewInstallationUsageIssues & Bug ReportsTodoContributionAuthorsLicenseShow Your SupportChangelogCode of ConductOverviewPyMilo is an open source Python package that provides a simple, efficient, and safe way for users to export pre-trained machine learning models in a transparent way. By this, the exported model can be used in other environments, transferred across different platforms, and shared with others. PyMilo allows the users to export the models that are trained using popular Python libraries like scikit-learn, and then use them in deployment environments, or share them without exposing the underlying code or dependencies. The transparency of the exported models ensures reliability and safety for the end users, as it eliminates the risks of binary or pickle formats.PyPI CounterGithub StarsBranchmaindevCICode QualityInstallationPyPICheckPython Packaging User GuideRunpip install pymilo==0.5Source codeDownloadVersion 0.5orLatest SourceRunpip install .UsageSimple Linear Model Preparation>>>fromsklearnimportdatasets>>>frompymiloimportExport,Import>>>fromsklearn.linear_modelimportLinearRegression>>>importos>>>X,Y=datasets.load_diabetes(return_X_y=True)>>>threshold=20>>>X_train,X_test=X[:-threshold],X[-threshold:]>>>Y_train,Y_test=Y[:-threshold],Y[-threshold:]>>>model=LinearRegression()>>>#### Train the model using the training sets>>>model.fit(X_train,Y_train)Save Model>>>#### Export the fitted model to a transparent json file>>>exported_model=Export(model)>>>PATH_TO_JSON_FILE=os.path.join(os.getcwd(),"test.json")>>>exported_model.save(PATH_TO_JSON_FILE)Load Model>>>#### Import the pymilo-exported model and get a real scikit model>>>imported_model=Import(PATH_TO_JSON_FILE)Get the associated Scikit model>>>imported_sklearn_model=imported_model.to_model()Note:imported_sklearn_modelhas theexact samefunctionality as themodelobject earlier.Supported ML Modelsscikit-learnPyTorchLinear Models ✅-Neural networks ✅-Trees ✅-Clustering ✅-Naïve Bayes ✅-Support vector machines (SVMs) ❌-Nearest Neighbors ❌-Ensemble Models ❌-Details are available inSupported Models.Issues & bug reportsJust fill an issue and describe it. We'll check it ASAP! or send an email toinfo@openscilab.com.Please complete the issue templateYou can also join our discord serverShow Your SupportStar this repoGive a ⭐️ if this project helped you!Donate to our projectIf you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-) .ChangelogAll notable changes to this project will be documented in this file.The format is based onKeep a Changelogand this project adheres toSemantic Versioning.UnreleasedAddedChanged0.5- 2024-01-31Addedresetfunction in theTransportinterfaceresetfunction implementation inAbstractTransporterGaussian Naive Bayesdeclared asGaussianNBmodelMultinomial Naive Bayesmodel declared asMultinomialNBmodelComplement Naive Bayesmodel declared asComplementNBmodelBernoulli Naive Bayesmodel declared asBernoulliNBmodelCategorical Naive Bayesmodel declared asCategoricalNBmodelNaive Bayes models test runnerNaive Bayes chainChangedTransportfunction ofAbstractTransporterupdatedfix the order ofCFNodefields serialization inCFNodeTransporterGeneralDataStructureTransportersupport list of ndarray with different shapesTests config modifiedNaive Bayes params initialized inpymilo_paramNaive Bayes support added topymilo_func.pySUPPORTED_MODELS.mdupdatedREADME.mdupdated0.4- 2024-01-22Addedhas_named_parametermethod inutil.pyCFSubclusterTransporter(insideCFNodeTransporter)CFNodeTransporterBirchmodelSpectralBiclusteringmodelSpectralCoclusteringmodelMiniBatchKMeansmodelfeature_request.ymltemplateconfig.ymlfor issue templateBayesianGaussianMixturemodelserialize_tuplemethod inGeneralDataStructureTransporterimport_functionmethod inutil.pyFunctionTransporterFeatureAgglomerationmodelHDBSCANmodelGaussianMixturemodelOPTICSmodelDBSCANmodelAgglomerativeClusteringmodelSpectralClusteringmodelMeanShiftmodelAffinityPropagationmodelKmeansmodelClustering models test runnerClustering chainChangedLossFunctionTransporterenhanced to handle scikit 1.4.0_loss_function_fieldCodacy Static Code Analyzer's suggestions appliedSpectral Clustering test folder refactoredBug report template modifiedGeneralDataStructureTransporterupdatedTests config modifiedClustering data set preparation added todata_exporter.pyClustering params initialized inpymilo_paramClustering support added topymilo_func.pyPython 3.12added totest.ymldev-requirements.txtupdatedCode quality badges added toREADME.mdSUPPORTED_MODELS.mdupdatedREADME.mdupdated0.3- 2023-09-27Addedscikit-learn decision tree modelsExtraTreeClassifiermodelExtraTreeRegressormodelDecisionTreeClassifiermodelDecisionTreeRegressormodelTreeTransporterDecision Tree chainChangedTests config modifiedDecisionTree params initialized inpymilo_paramDecision Tree support added topymilo_func.py0.2- 2023-08-02Addedscikit-learn neural network modelsMLP RegressormodelMLP ClassifiermodelBernoulliRBNmodelSGDOptimizertransporterRandomState(MT19937)transporterAdamoptimizertransporterNeural Network chainNeural Network exceptionsndarray_to_listmethod inGeneralDataStructureTransporterlist_to_ndarraymethod inGeneralDataStructureTransporterneural_network_chain.pychainChangedGeneralDataStructureTransporter updatedLabelBinerizerTransporter updatedlinear modelchain updatedGeneralDataStructure transporter enhancedLabelBinerizer transporter updatedtransporters' chain router added topymilo funcNeuralNetwork params initialized inpymilo_parampymilo_testupdated to support multiple modelslinear_model_chainrefactored0.1- 2023-06-29Addedscikit-learn linear models supportExportclassImportclass