nn_base.py

Define the NNBase class.

class openmdao.surrogate_models.nn_interpolators.nn_base.NNBase(training_points, training_values, num_leaves=2)[source]

Bases: object

Base class for common functionality between nearest neighbor interpolants.

__init__(training_points, training_values, num_leaves=2)[source]

Initialize nearest neighbor interpolant by scaling input to the unit hypercube.

Parameters:

training_points : ndarray

ndarray of shape (num_points x independent dims) containing training input locations.

training_values : ndarray

ndarray of shape (num_points x dependent dims) containing training output values.

num_leaves : int

How many leaves the tree should have.