Class WeightedFeature.Builder

  • All Implemented Interfaces:
    com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable, WeightedFeatureOrBuilder
    Enclosing class:
    WeightedFeature

    public static final class WeightedFeature.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<WeightedFeature.Builder>
    implements WeightedFeatureOrBuilder
     Represents a weighted feature that is encoded as a combination of raw base
     features. The `weight_feature` should be a float feature with identical
     shape as the `feature`. This is useful for representing weights associated
     with categorical tokens (e.g. a TFIDF weight associated with each token).
     TODO(b/142122960): Handle WeightedCategorical end to end in TFX (validation,
     TFX Unit Testing, etc)
     
    Protobuf type tensorflow.metadata.v0.WeightedFeature
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<WeightedFeature.Builder>
      • clear

        public WeightedFeature.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<WeightedFeature.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<WeightedFeature.Builder>
      • getDefaultInstanceForType

        public WeightedFeature getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public WeightedFeature build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public WeightedFeature buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public WeightedFeature.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<WeightedFeature.Builder>
      • setField

        public WeightedFeature.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<WeightedFeature.Builder>
      • clearField

        public WeightedFeature.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<WeightedFeature.Builder>
      • clearOneof

        public WeightedFeature.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<WeightedFeature.Builder>
      • setRepeatedField

        public WeightedFeature.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                        int index,
                                                        Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<WeightedFeature.Builder>
      • addRepeatedField

        public WeightedFeature.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                        Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<WeightedFeature.Builder>
      • mergeFrom

        public WeightedFeature.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<WeightedFeature.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<WeightedFeature.Builder>
      • mergeFrom

        public WeightedFeature.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                          throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<WeightedFeature.Builder>
        Throws:
        IOException
      • hasName

        public boolean hasName()
         Name for the weighted feature. This should not clash with other features in
         the same schema.
         
        optional string name = 1;
        Specified by:
        hasName in interface WeightedFeatureOrBuilder
        Returns:
        Whether the name field is set.
      • getName

        public String getName()
         Name for the weighted feature. This should not clash with other features in
         the same schema.
         
        optional string name = 1;
        Specified by:
        getName in interface WeightedFeatureOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.ByteString getNameBytes()
         Name for the weighted feature. This should not clash with other features in
         the same schema.
         
        optional string name = 1;
        Specified by:
        getNameBytes in interface WeightedFeatureOrBuilder
        Returns:
        The bytes for name.
      • setName

        public WeightedFeature.Builder setName​(String value)
         Name for the weighted feature. This should not clash with other features in
         the same schema.
         
        optional string name = 1;
        Parameters:
        value - The name to set.
        Returns:
        This builder for chaining.
      • clearName

        public WeightedFeature.Builder clearName()
         Name for the weighted feature. This should not clash with other features in
         the same schema.
         
        optional string name = 1;
        Returns:
        This builder for chaining.
      • setNameBytes

        public WeightedFeature.Builder setNameBytes​(com.google.protobuf.ByteString value)
         Name for the weighted feature. This should not clash with other features in
         the same schema.
         
        optional string name = 1;
        Parameters:
        value - The bytes for name to set.
        Returns:
        This builder for chaining.
      • hasFeature

        public boolean hasFeature()
         Path of a base feature to be weighted. Required.
         
        optional .tensorflow.metadata.v0.Path feature = 2;
        Specified by:
        hasFeature in interface WeightedFeatureOrBuilder
        Returns:
        Whether the feature field is set.
      • getFeature

        public Path getFeature()
         Path of a base feature to be weighted. Required.
         
        optional .tensorflow.metadata.v0.Path feature = 2;
        Specified by:
        getFeature in interface WeightedFeatureOrBuilder
        Returns:
        The feature.
      • setFeature

        public WeightedFeature.Builder setFeature​(Path value)
         Path of a base feature to be weighted. Required.
         
        optional .tensorflow.metadata.v0.Path feature = 2;
      • setFeature

        public WeightedFeature.Builder setFeature​(Path.Builder builderForValue)
         Path of a base feature to be weighted. Required.
         
        optional .tensorflow.metadata.v0.Path feature = 2;
      • mergeFeature

        public WeightedFeature.Builder mergeFeature​(Path value)
         Path of a base feature to be weighted. Required.
         
        optional .tensorflow.metadata.v0.Path feature = 2;
      • clearFeature

        public WeightedFeature.Builder clearFeature()
         Path of a base feature to be weighted. Required.
         
        optional .tensorflow.metadata.v0.Path feature = 2;
      • getFeatureBuilder

        public Path.Builder getFeatureBuilder()
         Path of a base feature to be weighted. Required.
         
        optional .tensorflow.metadata.v0.Path feature = 2;
      • hasWeightFeature

        public boolean hasWeightFeature()
         Path of weight feature to associate with the base feature. Must be same
         shape as feature. Required.
         
        optional .tensorflow.metadata.v0.Path weight_feature = 3;
        Specified by:
        hasWeightFeature in interface WeightedFeatureOrBuilder
        Returns:
        Whether the weightFeature field is set.
      • getWeightFeature

        public Path getWeightFeature()
         Path of weight feature to associate with the base feature. Must be same
         shape as feature. Required.
         
        optional .tensorflow.metadata.v0.Path weight_feature = 3;
        Specified by:
        getWeightFeature in interface WeightedFeatureOrBuilder
        Returns:
        The weightFeature.
      • setWeightFeature

        public WeightedFeature.Builder setWeightFeature​(Path value)
         Path of weight feature to associate with the base feature. Must be same
         shape as feature. Required.
         
        optional .tensorflow.metadata.v0.Path weight_feature = 3;
      • setWeightFeature

        public WeightedFeature.Builder setWeightFeature​(Path.Builder builderForValue)
         Path of weight feature to associate with the base feature. Must be same
         shape as feature. Required.
         
        optional .tensorflow.metadata.v0.Path weight_feature = 3;
      • mergeWeightFeature

        public WeightedFeature.Builder mergeWeightFeature​(Path value)
         Path of weight feature to associate with the base feature. Must be same
         shape as feature. Required.
         
        optional .tensorflow.metadata.v0.Path weight_feature = 3;
      • clearWeightFeature

        public WeightedFeature.Builder clearWeightFeature()
         Path of weight feature to associate with the base feature. Must be same
         shape as feature. Required.
         
        optional .tensorflow.metadata.v0.Path weight_feature = 3;
      • getWeightFeatureBuilder

        public Path.Builder getWeightFeatureBuilder()
         Path of weight feature to associate with the base feature. Must be same
         shape as feature. Required.
         
        optional .tensorflow.metadata.v0.Path weight_feature = 3;
      • getWeightFeatureOrBuilder

        public PathOrBuilder getWeightFeatureOrBuilder()
         Path of weight feature to associate with the base feature. Must be same
         shape as feature. Required.
         
        optional .tensorflow.metadata.v0.Path weight_feature = 3;
        Specified by:
        getWeightFeatureOrBuilder in interface WeightedFeatureOrBuilder
      • hasLifecycleStage

        public boolean hasLifecycleStage()
         The lifecycle_stage determines where a feature is expected to be used,
         and therefore how important issues with it are.
         
        optional .tensorflow.metadata.v0.LifecycleStage lifecycle_stage = 4;
        Specified by:
        hasLifecycleStage in interface WeightedFeatureOrBuilder
        Returns:
        Whether the lifecycleStage field is set.
      • getLifecycleStage

        public LifecycleStage getLifecycleStage()
         The lifecycle_stage determines where a feature is expected to be used,
         and therefore how important issues with it are.
         
        optional .tensorflow.metadata.v0.LifecycleStage lifecycle_stage = 4;
        Specified by:
        getLifecycleStage in interface WeightedFeatureOrBuilder
        Returns:
        The lifecycleStage.
      • setLifecycleStage

        public WeightedFeature.Builder setLifecycleStage​(LifecycleStage value)
         The lifecycle_stage determines where a feature is expected to be used,
         and therefore how important issues with it are.
         
        optional .tensorflow.metadata.v0.LifecycleStage lifecycle_stage = 4;
        Parameters:
        value - The lifecycleStage to set.
        Returns:
        This builder for chaining.
      • clearLifecycleStage

        public WeightedFeature.Builder clearLifecycleStage()
         The lifecycle_stage determines where a feature is expected to be used,
         and therefore how important issues with it are.
         
        optional .tensorflow.metadata.v0.LifecycleStage lifecycle_stage = 4;
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final WeightedFeature.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<WeightedFeature.Builder>
      • mergeUnknownFields

        public final WeightedFeature.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<WeightedFeature.Builder>