Preprocessor

[source]

ImageAugmentation class

autokeras.ImageAugmentation(
    translation=True,
    horizontal_flip=True,
    vertical_flip=True,
    rotation_range=0.5,
    random_crop=True,
    zoom_range=0.5,
    contrast_range=0.5,
    **kwargs
)

Collection of various image augmentation methods.

Arguments

  • translation: Boolean. Whether to translate the image. Defaults to True.
  • horizontal_flip: Boolean. Whether to flip the image horizontally. Defaults to True.
  • vertical_flip: Boolean. Whether to flip the image vertically. Defaults to True.
  • rotation_range: A positive float represented as fraction of 2pi, or a tuple of size 2 representing lower and upper bound for rotating clockwise and counter-clockwise. When represented as a single float, lower = upper. Defaults to 0.5.
  • random_crop: Boolean. Whether to crop the image randomly. Default to True.
  • zoom_range: Boolean. A positive float represented as fraction value, or a tuple of 2 representing fraction for zooming horizontally and vertically. For instance, zoom_range=0.2 result in a random zoom range from 80% to 120%. Defaults to 0.5.
  • contrast_range: A positive float represented as fraction of value, or a tuple of size 2 representing lower and upper bound. When represented as a single float, lower = upper. The contrast factor will be randomly picked between [1.0 - lower, 1.0 + upper]. Defaults to 0.5.

[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: Optional[int] = None, max_tokens: int = 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: int = 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.