Skip to main content

This library contains different functions to facilitate data preprocessing.

Project description

G5 Library

This library contains different functions to facilitate data preprocessing.

How to Install the Library

Installing the library is very simple. In the terminal, run:

pip install libreria-G5==0.1.3

to make sure you install de last version

** Note:**
To use this library, keep in mind that the following libraries need to be installed: pandas, numpy, sklearn, matplotlib, seaborn

How to Use the Library

The first step is to import the library:

from libreria_G5 import *

to import all functions, or

from libreria_G5 import Structure

to import only the model.

To use the functions, we need to call the model, and we can assign it any name we want:

modelo = Structure()

** Note:**
If no additional parameters are specified, the model will use its default values.

Library Variables

Structure( valor_limite = 65, metodo_object = 'moda', metodo_number = 'mean', quantile_min = 0.15, quantile_max = 0.75, mantener_columna = 'no')

  • limit_value: Defines the maximum percentage of missing values a column can have. If it exceeds this limit, the column will be removed. It can range between 0 and 100.
  • method_object: The method used for imputing missing values in object-type variables. It can be mode, forward fill (previous value), or backward fill (next value).
  • method_number: The method used for imputing missing values in numerical variables. Options include mode, mean, median, maximum, minimum, previous value, or next value.
  • quantile_min: Defines the minimum quantile, i.e., the lower limit for data considered too low. It can range between 0 and 1.
  • quantile_max: Defines the maximum quantile, i.e., the upper limit for data considered too high. It can range between 0 and 1.
  • keep_column: Determines whether, when using the encoder, the original column should be kept and a new one created or if the existing column should be replaced. It can be "yes" or "no".

Functions in the Library

Once the model is set up, we can use its functions. The model includes various functions:

  • .processing(df): This function takes a dataset as input and returns a cleaned dataset. It removes columns with a higher percentage of missing values than the defined limit and uses the selected imputation methods to fill in missing values in the remaining columns.
  • .remove_outliers(df, columns): This function removes outliers. The limits are set based on quantile variables, and values outside these limits are eliminated.
  • .normalize(df): This function normalizes the data using a MinMaxScaler.
  • .string_to_number(df): Uses a LabelEncoder to convert object-type data into numerical data. If mantener_columna is set to "yes," a new column will be created with the original column name + '_encoded'. If set to "no," the existing column will be replaced.
  • .visual_analysis_of_numerical_variables(df): Generates a graph showing the distribution of each numerical column and a heatmap displaying the relationships between columns.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libreria_G5-0.1.3.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libreria_G5-0.1.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file libreria_G5-0.1.3.tar.gz.

File metadata

  • Download URL: libreria_G5-0.1.3.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for libreria_G5-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5141f779d1b90fbc7ff9a70167f8521b4c6b046bb2913d99eeef91eccd5553f6
MD5 ae744bdd91a492baa3486cf40104344c
BLAKE2b-256 9f4db2504da87519df2e9d72bacc3ec93a1b0d7101fedc6174886740fa970a37

See more details on using hashes here.

File details

Details for the file libreria_G5-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: libreria_G5-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for libreria_G5-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d066c7df35f5691c678803873add95759dfc3dc5609af84c70f53b9ecf063b2f
MD5 d9cd38d406de6af0cd2eed3670cef173
BLAKE2b-256 7066885520de50e2bb2cfb1afb2333b9bbd1642d1debd1d30311afe57b09b69c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page