Package: ntient
NTIENT allows you to deploy and integrate AI models in minutes. This package interfaces with the API to manage models, deployments, and APIs.Version: 0.2.0Test Status:Install with pip:pip install ntientSupport Model TypesScikit-Learnsklearn ExtraTreeClassifiersklearn DecisionTreeClassifiersklearn OneClassSVMsklearn MLPClassifiersklearn RadiusNeighborsClassifiersklearn KNeighborsClassifiersklearn ClassifierChainsklearn MultiOutputClassifiersklearn OutputCodeClassifiersklearn OneVsOneClassifiersklearn OneVsRestClassifiersklearn SGDClassifiersklearn RidgeClassifierCVsklearn RidgeClassifiersklearn PassiveAggressiveClassifiersklearn GaussianProcessClassifiersklearn VotingClassifiersklearn AdaBoostClassifiersklearn GradientBoostingClassifiersklearn BaggingClassifiersklearn ExtraTreesClassifiersklearn RandomForestClassifiersklearn BernoulliNBsklearn CalibratedClassifierCVsklearn GaussianNBsklearn LabelPropagationsklearn LabelSpreadingsklearn LinearDiscriminantAnalysissklearn LinearSVCsklearn LogisticRegressionsklearn LogisticRegressionCVsklearn MultinomialNBsklearn NearestCentroidsklearn NuSVCsklearn Perceptronsklearn QuadraticDiscriminantAnalysissklearn SVCsklearn DPGMMsklearn GMMsklearn GaussianMixturesklearn VBGMMDeep LearningkeraspytorchComputer VisionyoloV5UsageTo use the package, you'll need to set a couple of environment variables.NTIENT_HOSTNTIENT_TOKENBoth of these can be gathered from theapp. Using the package in a Jupyter Notebook will give you the chance to enter both of these, but if you plan to use the package headless, you'll need to set these in your environment beforehand.ExamplesCreate a ModelCreating models is a foundational piece of the platform. This is the first step in deploying a model. There are two ways you can push a model: Jupyter, and*.pyfile. Both require you to have the trained model object available. You'll need your organization_id, which can be retrieved from theappas well.Jupyter:Using the package in Jupyter is the simplest setup. The package will prompt you to create the API specs as a part of the.push()command.import ntient
...
# train model
...
model = ntient.Model(
    model={trained_model},
    organization={organization_id},
    name={model_name},
    model_type="sklearn DecisionTreeClassifier"
)
model.push()ScriptUsing ntient in a script requires you to create the input and output mappings as dicts beforehand. Currently introspection is not supported in the package, so you have to know the input and output formats of your model.import ntient
...
# train model
# Define input/output dicts
...
model = ntient.Model(
    model={trained_model},
    organization={organization_id},
    name={model_name},
    model_type="sklearn DecisionTreeClassifier",
    input_mapping_json=input_mapping_dict,
    output_mapping_json=output_mapping_dict
)
model.push()Deploy a Modelmodel.deploy(environment={environment_name})Methodsntient.Modelorgainzation: strname: strmodel: dumped_model (currently supported: sklearn, pytorch, keras)input_mapping_json: dictoutput_mapping_json: dictexisting_model: bool (use if you're updating an existing model).deploydeployment_name: strenvironment: strv_cores: int (default = 1)instances: int (default = 1)