aqmlator.data_acquisition module
This module contains the functionalities required for receiving the data from the user and parsing them into a format that is used throughout the rest of the library.
Copyright 2023 ACK Cyfronet AGH. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This work was supported by the EuroHPC PL project funded at the Smart Growth Operational Programme 2014-2020, Measure 4.2 under the grant agreement no. POIR.04.02.00-00-D014/20-00.
- class aqmlator.data_acquisition.CSVDataReceiver(data_separator: str = ',', target_index: None | int = None)[source]
Bases:
DataReceiverInterfaceThis class is meant to receive the data given in a CSV format.
A constructor for the CSVDataReceiver.
- Parameters:
data_separator – A symbol in the file used to separate the data.
target_index – Index of the target value for supervised learning tasks. If set to None, then the Receiver assumes unsupervised learning.
- receive_data(data_file_path: str) List[LearningDatum][source]
The main method of the data receiver. It takes the path to the file containing the data and returns a list of LearningDatum objects representing the data in the CSV file.
- Parameters:
data_file_path – The path to the file containing the data.
- Raises:
FileNotFoundError – If the file does not exist.
- Returns:
A list of LearningDatum objects representing the data in the CSV file.
- class aqmlator.data_acquisition.DataReceiverInterface[source]
Bases:
ABCAn interface class for all the data receivers.
- abstractmethod receive_data(data_file_path: str) List[LearningDatum][source]
The main method of the data receivers. It handles the initial data
- Parameters:
data_file_path – The path to the file containing the data.
- class aqmlator.data_acquisition.LearningDatum(datum_attributes: Tuple[float | str, ...])[source]
Bases:
objectA general class for holding the user-passed learning data.
- datum_attributes: Tuple[float | str, ...]
- class aqmlator.data_acquisition.SupervisedLearningDatum(datum_attributes: Tuple[float | str, ...], datum_target: float | str | int)[source]
Bases:
LearningDatumA class for holding user-passed data for supervised learning. It holds additional information about the class / value of the target function.
- datum_target: float | str | int