Data

module for handling and generating data

class mapyl.data.GenData[source]
generate_data(deg4=0, deg3=0, deg2=0, ang=1.5, yint=2, noise=1, xrange=10, floor=- 5, numins=200)[source]

Generates noisy polynomial data for testing

Parameters:

deg5 to deg2 (float): The coefficients for the various degrees from 2 to 5, zero to ignore this degree

ang (float): The angular coefficient (the same as deg in the previous parameter)

yint (float): The Y-intercept of the polynomial

noise (float): The amount of noise to be present, keep in mind this does not scale with the y value

xrange (float): The range for x to be calculated (low values are recommended for perfomarnce)

floor (float): The minimum value for x to be computed

numins (int): The amount of x samples to be calculated

Returns:

x (array): The x values used (after scale)

y (array): The y values produced

class mapyl.data.SplitData[source]
split(y, test_percent)[source]

Splits a dataset into a test and train percentile along the vertical dimension

Parameters:

X (ndarray): The X values

y (ndarray): The y values

test_percent (float): The percentage of the dataset that is for testing

Returns:

ndarray: the splitted ndarrays of the X and y inputs