spacekit.analyzer.explore

Inheritance diagram of spacekit.analyzer.explore

class spacekit.analyzer.explore.ImagePreviews(X, labels, name='ImagePreviews', **log_kws)[source]

Bases: object

Base parent class for rendering and displaying images as plots

class spacekit.analyzer.explore.SVMPreviews(X, labels=None, names=None, ndims=3, channels=3, w=128, h=128, figsize=(10, 10), **log_kws)[source]

Bases: ImagePreviews

ImagePreviews subclass for previewing SVM images. Primarily can be used to compare original with augmented versions.

Parameters:

ImagePlots (class) – spacekit.analyzer.explore.ImagePreviews parent class

Instantiates an SVMPreviews class object.

Parameters:
  • X (ndarray) – ndimensional array of image pixel values

  • labels (ndarray, optional) – target class labels for each image

  • ndims (int, optional) – number of dimensions (frames) per image, by default 3

  • channels (int, optional) – channels per image frame (rgb color is 3, gray/bw is 1), by default 3

  • w (int, optional) – width of images, by default 128

  • h (int, optional) – height of images, by default 128

check_dimensions(Xi)[source]
get_synthetic_image(img_name, show=False, dim=3, aug=False)[source]
preview_image(Xi, dim=3, aug=False, show=False)[source]
preview_image_mpl(Xi, dim=3, aug=False, show=False)[source]
preview_og_aug_pair(i=None, dim=3)[source]

Plot frames of both original and augmented versions of n-dimensional images

Parameters:
  • i (int, optional) – index of image selected from array X, by default None

  • dim (int, optional) – dimensions (number of frames per image), by default 3

preview_og_syn_pair(img_name)[source]
select_image_from_array(i=None)[source]
class spacekit.analyzer.explore.DataPlots(df, width=1300, height=700, show=False, save_html=None, name='DataPlots', **log_kws)[source]

Bases: object

Parent class for drawing exploratory data analysis plots from a dataframe.

bar_plots(X, Y, feature, y_err=[None, None], width=700, height=500, cmap=['dodgerblue', 'fuchsia'])[source]
box_plots(cols=None, outliers=True)[source]
feature_stats_by_target(feature)[source]

Calculates statistical info (mean and standard deviation) for a feature within each target class.

Parameters:

feature (str) – dataframe column to get statistical calculations on

Returns:

list of means and list of standard deviations for a feature, subdivided for each target class.

Return type:

nested lists

feature_subset()[source]

Create a set of groups from a categorical feature (dataframe column). Used for plotting multiple traces on a figure

Returns:

self.categories attribute containing key-value pairs: groups of observations (values) for each category (keys)

Return type:

dictionary

group_keys()[source]
grouped_barplot(target='label', cmap=None, save=False)[source]
kde_plots(cols, norm=False, targets=False, hist=True, curve=True, binsize=0.2, width=700, height=500, cmap=['#F66095', '#2BCDC1'])[source]
make_scatter_figs(xaxis_name, yaxis_name, marker_size=15, cmap=['cyan', 'fuchsia'], categories=None, target=None)[source]
make_subplots(figtype, xtitle, ytitle, data1, data2, name1, name2)[source]
make_target_scatter(target=None)[source]
map_data()[source]

Instantiates grouped dataframes for each detector

Returns:

data_map dictionary of grouped data frames and color map

Return type:

dict

remove_outliers(y_data)[source]
scatter3d(x, y, z, mask=None, target=None)[source]
class spacekit.analyzer.explore.HstSvmPlots(df, group='det', width=1300, height=700, show=False, save_html=None, **log_kws)[source]

Bases: DataPlots

Instantiates an HstSvmPlots class

Parameters:

DataPlots (class) – spacekit.analyzer.explore.DataPlots parent class

alignment_bars()[source]
alignment_kde()[source]
alignment_scatters()[source]
df_by_detector()[source]

Instantiates grouped dataframes for each detector

Return type:

self

draw_plots()[source]
class spacekit.analyzer.explore.HstCalPlots(df, group='instr', **log_kws)[source]

Bases: DataPlots

df_by_instr()[source]
draw_plots()[source]
make_box_figs(vars)[source]
make_cal_scatter3d()[source]
make_cal_scatterplots()[source]
make_scatter_figs(xaxis_name, yaxis_name)[source]