Module: data_table

Summary

TableBase(input_ndarray[, id_column_name, ...])
Parameters:

Module API

class DatasetClassification[source]

Bases: asterism.core.machine_learning.data_sets.data_table.TableBase

Attributes

data The numpy recarray storing the data

Methods

add_column(values_array, column_name[, dtype]) Adds a column to the data, using numpy recfunctions
filter_data(mask)
from_ascii_file()
from_fits_file(input_file[, id_column_name, ...])
set_data(data[, target_col_num, ...])
Parameters:
class DatasetRegression[source]

Bases: asterism.core.machine_learning.data_sets.data_table.TableBase

Attributes

data The numpy recarray storing the data

Methods

add_column(values_array, column_name[, dtype]) Adds a column to the data, using numpy recfunctions
filter_data(mask)
from_ascii_file()
from_fits_file(input_file[, id_column_name, ...])
set_data(data[, target_col_num, ...])
Parameters:
class TableBase(input_ndarray, id_column_name=None, id_column_num=None)[source]

Bases: object

Parameters:

input_ndarray : {array-like}, shape=[_data_N_rows,_data_N_cols]

id_column_name : str

name of the column storing positional/ordinal information

id_column_num : int

id of the column storing positional/ordinal information

Attributes

data The numpy recarray storing the data
_data_dtype (int)
_data_array (int)
_data_names (list)
_data_N_cols (int)
_data_N_rows (int)
_data_original_entry_ID (int)

Methods

add_column(values_array, column_name[, dtype]) Adds a column to the data, using numpy recfunctions
filter_data(mask)
from_ascii_file()
from_fits_file(input_file[, id_column_name, ...])
set_data(data[, target_col_num, ...])
Parameters:
add_column(values_array, column_name, dtype=None)[source]

Adds a column to the data, using numpy recfunctions

Parameters:

values_array : {array-like}, shape =[self._data_N_rows]

column_name : str

dtype :

data

The numpy recarray storing the data

filter_data(mask)[source]
classmethod from_ascii_file()[source]
classmethod from_fits_file(input_file, id_column_name=None, id_column_num=None, fits_ext=0)[source]
set_data(data, target_col_num=None, target_col_name=None, id_column_name=None, id_column_num=None)[source]
Parameters:

data :

target_col_name : str

name of the column storing the target information

Warning

this has been dismissed

target_col_num : int

id of the column storing the target information

Warning

this has been dismissed

id_column_name : str

name of the column storing positional/ordinal information

id_column_num : int

id of the column storing positional/ordinal information

sets the following attributes:

  • _data_dtype
  • _data_array (dtype np.object)
  • _data_names (list)
  • _data_N_cols (int)
  • _data_N_rows (int)
  • _data_original_entry_ID 1d np.array np.int

Columns storing ID positional/ordinal information, or target (i.e. class labels for

classification, or target variables for regression are removed)

  • Removes the column storing ID positional information (id_column_name/id_column_num if given)
  • Removes the column storing target information (target_col_name/target_col_num if given)

Warning

this has been removed

The input data can be either a 2dim numpy array or, a numpy recarray.

In the former case, columns names are set to col_ plus the ordinal ID of the column, starting from zero