Preprocessor

[source]

ImageAugmentation class

autokeras.ImageAugmentation(
    percentage=0.25,
    rotation_range=180,
    random_crop=True,
    brightness_range=0.5,
    saturation_range=0.5,
    contrast_range=0.5,
    translation=True,
    horizontal_flip=True,
    vertical_flip=True,
    gaussian_noise=True,
    **kwargs
)

Collection of various image augmentation methods.

Arguments

  • percentage: Float. The percentage of data to augment.
  • rotation_range: Int. The value can only be 0, 90, or 180. Degree range for random rotations. Default to 180.
  • random_crop: Boolean. Whether to crop the image randomly. Default to True.
  • brightness_range: Positive float. Serve as 'max_delta' in tf.image.random_brightness. Default to 0.5. Equivalent to adjust brightness using a 'delta' randomly picked in the interval [-max_delta, max_delta).
  • saturation_range: Positive float or Tuple. If given a positive float, _get_min_and_max() will automated generate a tuple for saturation range. If given a tuple directly, it will serve as a range for picking a saturation shift value from. Default to 0.5.
  • contrast_range: Positive float or Tuple. If given a positive float, _get_min_and_max() will automated generate a tuple for contrast range. If given a tuple directly, it will serve as a range for picking a contrast shift value from. Default to 0.5.
  • translation: Boolean. Whether to translate the image.
  • horizontal_flip: Boolean. Whether to flip the image horizontally.
  • vertical_flip: Boolean. Whether to flip the image vertically.
  • gaussian_noise: Boolean. Whether to add gaussian noise to the image.

[source]

Normalization class

autokeras.Normalization(axis: int = -1, **kwargs)

Perform basic image transformation and augmentation.

Arguments

  • axis: Integer or tuple of integers, the axis or axes that should be normalized (typically the features axis). We will normalize each element in the specified axis. The default is '-1' (the innermost axis); 0 (the batch axis) is not allowed.

[source]

TextToIntSequence class

autokeras.TextToIntSequence(output_sequence_length=None, max_tokens=20000, **kwargs)

Convert raw texts to sequences of word indices.

Arguments

  • output_sequence_length: Int. The maximum length of a sentence. If unspecified, it would be tuned automatically.
  • max_tokens: Int. The maximum size of the vocabulary. Defaults to 20000.

[source]

TextToNgramVector class

autokeras.TextToNgramVector(max_tokens=20000, **kwargs)

Convert raw texts to n-gram vectors.

Arguments

  • max_tokens: Int. The maximum size of the vocabulary. Defaults to 20000.

[source]

CategoricalToNumerical class

autokeras.CategoricalToNumerical(**kwargs)

Encode the categorical features to numerical features.