tpot_classification module

class tpot_classification.TpotClassifier(data_path, gabor=False, reduction_method=None)[source]

Bases: object

Trains a machine learning model with tpot, which can then be used to predict attractiveness of pictures of humans.

Parameters:
  • data_path – Path to the folder that has the image folder and users.csv
  • make_data_set – Takes the images from the data folder, finds faces in them and transforms those into 64x64 grayscale images. Making the data set takes a long time.
  • gabor – This determines if gabor filter is used in training.
  • reduction_method – Which method to use for dimensionality reduction. Supported types are ‘pca’ and ‘lda’.
build_filters()[source]

returns a list of kernels in several orientations

static create_data(data_path)[source]

Makes a 64x64 grayscale image dataset of faces.

Parameters:data_path – Path to the folder that has the image folder and users.csv
load()[source]

Loads the fitted tpot models into usage

Returns:None
predict(image)[source]

Predicts the attractiveness of a picture with a human in it.

Parameters:image – The image with the human in it.
Returns:The prediction.
process(img, filters)[source]

Returns the img filtered by the filter list.

Parameters:
  • img – Image to be filtered.
  • filters – The gabor filters to be used.
train()[source]

Uses tpot to train a machine learning model to predict attractiveness of pictures of human faces.

Returns:Various accuracy measures.