Electron microscopy
 
Categorical Features Preprocessing Layers
- Python for Integrated Circuits -
- An Online Book -
Python for Integrated Circuits                                                                                   http://www.globalsino.com/ICs/        


Chapter/Index: Introduction | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | Appendix

=================================================================================

Machine learning methods such as logistic regression, SVM with a linear kernel, and so on, will often require that categorical variables be converted into dummy variables. For example, a single feature Vehicle would be converted into three features, Cars, Trucks, and Pickups, one for each category in the categorical feature. The common ways to preprocess categorical features are:
        i) pandas,
        ii) scikit-learn.

Categorical features preprocessing layers includes:
        i) CategoryEncoding layer.
                tf.keras.layers.CategoryEncoding(num_tokens=None, output_mode='multi_hot', sparse=False, **kwargs)
        ii) Hashing layer.
                tf.keras.layers.Hashing(num_bins, mask_value=None, salt=None, output_mode="int", sparse=False, **kwargs)
        iii) StringLookup layer.
                tf.keras.layers.StringLookup(
                max_tokens=None,
                num_oov_indices=1,
                mask_token=None,
                oov_token="[UNK]",
                vocabulary=None,
                idf_weights=None,
                encoding=None,
                invert=False,
                output_mode="int",
                sparse=False,
                pad_to_max_tokens=False,
                **kwargs
                )
        iv) IntegerLookup layer.
                tf.keras.layers.IntegerLookup(
                max_tokens=None,
                num_oov_indices=1,
                mask_token=None,
                oov_token=-1,
                vocabulary=None,
                vocabulary_dtype="int64",
                idf_weights=None,
                invert=False,
                output_mode="int",
                sparse=False,
                pad_to_max_tokens=False,
                **kwargs
                )

============================================

Preprocessing categorical features. code:          
          API (Application Programming Interface) to extract weather of a city
Output:         
         API (Application Programming Interface) to extract weather of a city

 

         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         

 

 

 

 

 



















































 

 

 

 

 

=================================================================================