Data Generators¶
Here is a list of classes in the package.
Overview:
- class neural_network.AbstractDataGenerator(function: Callable[[float], Any] | Callable[[float, float], Any] | Callable[[float, float, float], Any] | Callable[[float, float, float, float], Any], num_datapoints: int)[source]¶
Class to randomly generate datapoints and categorise them according to a given rule or provide an output value if we are regressing.
- __call__() DataFrame[source]¶
Writes to self._df with the generated data and classes.
- Returns:
self._df with newly generated data
- Return type:
pd.DataFrame
- __init__(function: Callable[[float], Any] | Callable[[float, float], Any] | Callable[[float, float, float], Any] | Callable[[float, float, float, float], Any], num_datapoints: int)[source]¶
Constructor method
- Parameters:
function (custom_type) – A rule which takes a certain number of coordinates and returns a value representing the class or function output of the datapoint
num_datapoints (int) – The number of datapoints to be generated
- plot_datapoints(title: str = '', regression: bool = False)[source]¶
Uses the Plotter class to generate a scatter plot of the datapoints with their true classes/values represented.
- titlestr [Optional, Default=’’]
The optional title of the .png file
- regressionbool
Whether this is a regression or classification problem
- class neural_network.NormalDataGenerator(function: Callable[[float], Any] | Callable[[float, float], Any] | Callable[[float, float, float], Any] | Callable[[float, float, float, float], Any], num_datapoints: int, means: List[float], std_devs: List[float])[source]¶
Class to randomly generate datapoints and categorise them according to a given rule, or provide an output value if we are regressing, with data being generated via a normal distribution.
- __init__(function: Callable[[float], Any] | Callable[[float, float], Any] | Callable[[float, float, float], Any] | Callable[[float, float, float, float], Any], num_datapoints: int, means: List[float], std_devs: List[float])[source]¶
Constructor method
- Parameters:
function (custom_type) – A rule which takes a certain number of coordinates and returns a value representing the class or function value of the datapoint
num_datapoints (int) – The number of datapoints to be generated
means (List[float]) – A list of means for each coordinate
std_devs (List[float]) – A list of standard deviations for each coordinate
- class neural_network.UniformDataGenerator(function: Callable[[float], Any] | Callable[[float, float], Any] | Callable[[float, float, float], Any] | Callable[[float, float, float, float], Any], num_datapoints: int, lower_bounds: List[float], upper_bounds: List[float])[source]¶
Class to randomly generate datapoints and categorise them according to a given rule, or provide an output value if we are regressing, with data being generated via a uniform distribution.
- __init__(function: Callable[[float], Any] | Callable[[float, float], Any] | Callable[[float, float, float], Any] | Callable[[float, float, float, float], Any], num_datapoints: int, lower_bounds: List[float], upper_bounds: List[float])[source]¶
Constructor method
- Parameters:
function (custom_type) – A rule which takes a certain number of coordinates and returns a value representing the class or function output of the datapoint
num_datapoints (int) – The number of datapoints to be generated
lower_bounds (List[float]) – A list of lower bounds for each coordinate
upper_bounds (List[float]) – A list of upper bounds for each coordinate