sciope.models package

Submodules

sciope.models.ann_regressor module

Artificial Neural Network (ANN) Regression Surrogate Model

class sciope.models.ann_regressor.ANNModel(use_logger=False)[source]

Bases: sciope.models.model_base.ModelBase

We use the sklearn MLP Regressor implementation here.

predict(xt)[source]

Predict unseen data using the trained model

xtnd-array

unseen data to be predicted

vector

predictions

train(inputs, targets)[source]

Train the ANN model given the data

inputsnd-array

independent variables

targetsvector

dependent variable

sciope.models.gp_regressor module

Gaussian Process Regression Surrogate Model using sklearn

class sciope.models.gp_regressor.GPRModel(use_logger=False)[source]

Bases: sciope.models.model_base.ModelBase

We use the sklearn GP Regressor implementation here.

predict(xt)[source]

Predict unseen data using the trained model. GP returns the mean and variance of prediction, so handle it accordingly while using predict.

xtnd-array

unseen data to be predicted

tuple of vectors

predictions, prediction variance

train(inputs, targets)[source]

Train the GP model given the data

inputsnd-array

independent variables

targetsvector

dependent variable

sciope.models.label_propagation module

Semi-supervised Label Propagation Surrogate Model

class sciope.models.label_propagation.Bounds(xmax, xmin)[source]

Bases: object

class sciope.models.label_propagation.LPModel(kernel='rbf', alpha=0.7, gamma=0.1, learning_rate=1.0, use_logger=False)[source]

Bases: sciope.models.model_base.ModelBase

We use the sklearn Label Spreading implementation here.

objective(x)[source]

Objective function for hyper-parameter selection/evaluation

x : hyper-parameter under test - gamma

float

a measure directly proportional to entropy

optimize(min_, max_, niter=10, stepsize=0.1)[source]

hyper-parameter optimization using basinhopping

min_ : lower bound for parameter search max_ : upper bound for parameter search niter : number of allowed optimization iterations stepsize : displacement step size

vector

optimized hyper-parameters

predict(xp)[source]

Predict unseen data using the trained model

xpnd-array

unseen data to be predicted

vector

predictions

train(inputs, targets, min_=0.01, max_=30, niter=10, stepsize=0.1)[source]

Train the LP model given the data

inputsnd-array

independent variables

targetsvector

dependent variable

minfloat

[]

maxfloat

[]

niterint

number of training iterations

stepsizefloat

[]

class sciope.models.label_propagation.RandomDisplacementBounds(xmax, xmin, stepsize=0.5)[source]

Bases: object

random displacement with bounds

sciope.models.label_propagation.get_average_label_entropy(label_distribution)[source]
sciope.models.label_propagation.get_label_entropies(label_distribution)[source]

sciope.models.model_base module

Surrogate Model Base Class

class sciope.models.model_base.ModelBase(name, use_logger=False)[source]

Bases: object

Base class for surrogate models. Must not be used directly! Each model type must implement the methods described herein:

  • ModelBase.train(x,y)

  • ModelBase.predict(xt)

The following variables are available to derived classes:

  • self.x (training inputs)

  • self.y (training targets)

  • self.my (mean for scaling)

  • self.sy (std dev for scaling)

  • self.n (num training points)

abstract predict(test_input)[source]

Sub-classable method for predicting test data. Each derived class must implement.

scale_training_data(x, y)[source]

pre-process training data

xnd-array

inputs or independent variables

ynd-array

output or dependent variable

abstract train(inputs, targets)[source]

Sub-classable method for training a given surrogate. Each derived class must implement.

sciope.models.svm_regressor module

Support Vector Machine Regression Surrogate Model

class sciope.models.svm_regressor.SVRModel(use_logger=False)[source]

Bases: sciope.models.model_base.ModelBase

We use the sklearn SVM implementation here.

predict(xt)[source]

Predict unseen data using the trained model

xtnd-array

unseen data to be predicted

vector

predictions

train(inputs, targets)[source]

Train the SVR model given the data

inputsnd-array

independent variables

targetsvector

dependent variable

tune_parameters(x, y, nfolds)[source]

Tune hyper-parameters of the model

x : inputs or independent variables y : output or dependent variable nfolds : number of cross-validation folds

vector

pseudo-optimal parameters

Module contents