The Employee Analysis package analyzes employee performance data, applies various transformations, and categorizes employees based on their performance ratings. This package uses design patterns like Strategy, Factory, and Facade to ensure modularity and maintainability.
To install the package, navigate to the root directory (where setup.py is located) and run: pip install .
To use the Employee Analysis package in your project, you can use the EmployeeAnalysisFacade class to run the complete workflow:
from employee_analysis import EmployeeAnalysisFacade
csv_file = "path/to/your/dataset.csv" facade = EmployeeAnalysisFacade(csv_file) facade.run()
This project addresses the need for a robust tool for employee performance analysis by leveraging advanced data transformation techniques and design patterns. The resulting software package is a valuable asset for organizations aiming to improve their performance evaluation processes, providing a foundation for data -driven decision- making.
Employee Analysis Facade The EmployeeAnalysisFacade class provides a simplified interface to run the entire employee analysis process.
- init(self, csv_file): Initializes the facade with the specified CSV file.
- load_data(self): Loads the data from the CSV file.
- clean_data(self): Cleans the data by handling missing values and outliers.
- calculate_ratings(self): Calculates performance ratings for employees.
- apply_transformations(self, ratings): Applies various transformations to the ratings.
- find_best_p_value(self, transformations): Finds the best p-value for the Shapiro-Wilk test.
- categorize_employees(self, ratings): Categorizes employees based on their ratings.
- plot_normal_distribution(self, mean, std, thresholds): Plots the normal distribution of employee performance.
- save_categorized_employees(self, categories): Saves the categorized employees to a CSV file.
- run(self): Executes the complete workflow.
The transformations module contains classes implementing different transformation strategies using the Strategy design pattern.
- TransformationStrategy: Abstract base class for transformations.
- apply(self, data): Abstract method to apply the transformation.
- name(self): Abstract method to return the name of the transformation.
- test_normality(self, data): Tests the normality of the data using the Shapiro-Wilk test.
- OriginalTransformation: Applies no transformation.
- LogTransformation: Applies a logarithmic transformation.
- SqrtTransformation: Applies a square root transformation.
- BoxCoxTransformation: Applies a Box-Cox transformation.
- InverseTransformation: Applies an inverse transformation.
- TransformationFactory: Provides a method to get all transformation strategies.
- get_transformations(): Returns a list of all available transformation strategies.
The utils module contains utility functions used by the package.
- load_data(csv_file): Loads data from the specified CSV file.
- Unit tests are provided in the tests module. To run the tests, use a test runner like unittest:
python -m unittest discover tests