Code Monkey home page Code Monkey logo

ml-preprocessor's Introduction

RhinoRefine - Preprocessor Python Package

The Preprocessor Python package provides a simple and easy-to-use interface for data preprocessing in machine learning projects. It includes various methods for data cleaning, scaling, and encoding.

Installation

You can install the Preprocessor package using pip:

pip install rhinorefine

The Preprocessor class is the main class of this package. You can create an instance of this class by providing the filepath of the CSV file that you want to preprocess.

from rhinorefine import Preprocessor
preprocessor = Preprocessor('path/to/your/csv/file.csv')

The fillwithmean, fillwithmedian, and fillwithmode methods can be used to fill the missing values in a column with the mean, median, or mode value of that column, respectively.

preprocessor.fillwithmean('column_name')
preprocessor.fillwithmedian(['column_name_1', 'column_name_2'])
preprocessor.fillwithmode('column_name')

Removing Columns

The removeColumn method can be used to remove a column from the dataset. You can pass the column name as an argument.

preprocessor.removeColumn('column_name')

Checking for Null Values

The nullValues method returns a dictionary containing the number of null values in each column.

null_values = preprocessor.nullValues()
print(null_values)

Data Scaling

Standardization

The standardizeColumn and standardizeData methods can be used to standardize the data by subtracting the mean and dividing by the standard deviation. You can pass the column name as an argument.

preprocessor.standardizeColumn('column_name')
preprocessor.standardizeData()

Normalization

The normalizeColumn and normalizeData methods can be used to normalize the data by scaling the values between 0 and 1. You can pass the column name or a list of column names as an argument.

preprocessor.normalizeColumn('column_name')
preprocessor.normalizeData()

Data Encoding

Categorical Encoding

The categoricalEncoding method can be used to perform one-hot encoding on a categorical column. You can pass the column name or a list of column names as an argument.

preprocessor.categoricalEncoding('column_name')

Data Compression

Lossy Compression

The compressLossy method can be used to compress the data using the K-Means algorithm. You can pass the number of clusters as an argument.

preprocessor.compressLossy(10)

Non-Lossy Compression

The compressNonLossy method can be used to compress the data using Principal Component Analysis (PCA). You can pass the number of components as an argument.

preprocessor.compressNonLossy(5)

Saving Processed Data

The save method can be used to save the preprocessed data to a CSV file.

preprocessor.save()

Conclusion

The Preprocessor Python package provides a simple and effective way to preprocess data for machine learning projects. It includes various methods for data cleaning, scaling, encoding, and compression. It can save a lot of time and effort for data scientists as well as machine learning engineers.

ml-preprocessor's People

Contributors

abdullahranginwala avatar harsh-aakoliya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.