Skip to content

VicHZR/Analisis_Datos_Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📊 Data Science, Advanced Analytics & Predictive Engineering Suite (Python)


🚀 Overview

An advanced Data Science and Machine Learning repository compiling mathematical modeling, algorithmic data manipulation, and predictive engineering pipelines.

This suite implements full execution cycles—ranging from NoSQL dynamic unstructured data parsing and complex aggregations on national labor demographics (ENAHO) to training predictive Machine Learning models (Linear and Logistic Regressions) for structural market behavioral analytics.

🎯 Focus: Predictive analytics, automated data engineering pipelines, structural parsing, and machine learning evaluation metrics.


🏗️ Project Architecture Layout

The repository segregates development workflows into three clear analytical layers:

Analisis_Datos_Python/
│
├── Basico/          # Control flows, nested NoSQL dictionary extractions, and data masking logic
├── Intermedio/      # Advanced Pandas aggregations, multi-level pivot tables, and multi-sheet Excel exports
└── Avanzado/        # Scikit-Learn predictive modeling pipelines, feature scaling, and diagnostics

🎯 Core Technical Breakdown

1. Advanced Data Engineering & Core Logic (Basico/)

  • NoSQL Unstructured Data Mining: Dynamic key extraction algorithms capable of mapping nested object layers without causing execution index errors.
  • Security Data Masking: String mutation utilities engineered to mask sensitive personal identifiers (PII) such as Names, Emails, and Phones dynamically.
  • Multicriteria Profile Evaluation: Algorithmic logical decision structures executing matrix pattern matching and automated user input validations.
# Headless Extraction Logic on Unstructured Records
def extract_nosql_fields(database, field_count):
    requested_fields = [input(f"Enter target field {i + 1}: ") for i in range(field_count)]
    extracted_records = []
    for document in database:
        record = {field: document.get(field, '-') for field in requested_fields}
        if any(value != '-' for value in record.values()):
            extracted_records.append(record)
    return extracted_records

2. Labor Market Statistical Analytics (Intermedio/)

  • Target Source Material: Encuesta Nacional de Hogares (ENAHO) – Employment Module.
  • Demographic Performance Ratios: Granular multi-level grouping arrays determining conditional unemployment rates stratified by chronological timeline frames and gender vectors.
  • Custom Aggregate Formulations: Dynamic custom aggregations defining statistical ranges ((Max - Min)) coupled with pivot tables execution.
  • Automated Reporting Channels: Multi-sheet binary outputs written cleanly through pd.ExcelWriter layers.
# Statistical Concurrency Array: Unemployment Rate Tracking
data['unemployed'] = (data['ocupado'] == 0).astype(int)
grouped_metrics = data.groupby(['año', 'p207']).agg({'unemployed': ['sum', 'count']})
grouped_metrics['unemployment_rate'] = (grouped_metrics['unemployed']['sum'] / grouped_metrics['unemployed']['count']) * 100

3. Predictive Machine Learning Pipelines (Avanzado/)

  • Target Source Material: MROZ Dataset (Wooldridge) – 753 Observations, 22 Econometric Variables.
  • Continuous Estimation Model (Linear Regression): Engineered to forecast continuous market salary metrics (wage). Incorporates data cleansing with SimpleImputer, vector normalization through StandardScaler, and validation array partitioning.
  • Binary Categorization Model (Logistic Regression): Implemented to predict female labor-force participation probabilities (inlf) using threshold boundaries.
# End-to-End Predictive Model Infrastructure Setup
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
imputer = SimpleImputer(strategy='mean')
scaler = StandardScaler()

X_train_scaled = scaler.fit_transform(imputer.fit_transform(X_train))
X_test_scaled = scaler.transform(imputer.transform(X_test))

model = LogisticRegression()
model.fit(X_train_scaled, y_train)

📊 Machine Learning Model Benchmarks

📈 Continuous Estimation: Linear Regression (wage)

Metric Operational Benchmark
Mean Squared Error (MSE) 2.31
R-squared ($R^2$) 0.588

Diagnostic Output: Residual variance histograms and predicted-vs-actual scatter trajectories tracking baseline deviations.

🎯 Binary Classification: Logistic Regression (inlf)

Evaluation Metric Production Target
Global Model Accuracy 71.5%
Precision (Class 1 - Active) 0.73
Recall (Class 1 - Active) 0.79
F1-Score (Class 1 - Active) 0.76

Diagnostic Output: Visual Heatmap Confusion Matrices, ROC Curves (AUC tracking), and Precision-Recall density charts.


📊 Impact (CV-Level Highlights)

  • 🚀 Automated Predictive Insights: Deployed production-ready classification pipelines achieving 71.5% accuracy using Scikit-Learn algorithms.
  • 🛡️ Fintech-Grade Data Isolation: Engineered data protection algorithms to partially mask high-risk personal identifiers (PII), securing transmission payloads.
  • 🔄 Production-Grade Data Pipelines: Replaced brittle manual parsing with dynamic extraction loops capable of mining deeply nested NoSQL record layers.
  • 📉 Optimized Reporting Cycles: Programmed automated multi-sheet Excel compilation scripts via Pandas ExcelWriter, saving operational analytics overhead.

⚙️ Environment Installation & Run Guide

1. Technical Manifest Requirements

pandas>=1.5.3
numpy>=1.23.5
matplotlib>=3.7.1
seaborn>=0.12.2
scikit-learn>=1.2.2
wooldridge>=0.4.4

2. Execution Setup

git clone https://github.com
cd Analisis_Datos_Python
pip install -r requirements.txt  # Or manual setup using libraries listed above
jupyter notebook

🔐 Engineering Best Practices Applied

  • Deterministic Pipeline Splitting: Random seed sequences locked (random_state=42) to assure strict execution and diagnostic test repeatability.
  • Prevented Data Leakage: Normalization parameters (StandardScaler) calculate features strictly over training vectors to keep verification sets fully independent.
  • Dynamic Missing Data Strategy: Replaced vulnerable null rows deletion routines with target mean distributions (SimpleImputer), protecting dataset consistency.

👨‍💻 Author

Victor Guzmán
Computational Scientist | Backend Engineer | Software Quality & Test Automation Specialist

About

📊 Suite avanzada de Ciencia de Datos y Machine Learning utilizando Pandas, NumPy y Scikit-Learn para análisis laboral de ENAHO y modelado econométrico predictivo.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages