DEV Community

amal org
amal org

Posted on

Data Analyst Guide: Mastering Why Gen Z Job Applications Get Rejected (Real Talk)

Data Analyst Guide: Mastering Why Gen Z Job Applications Get Rejected (Real Talk)

Business Problem Statement

In today's competitive job market, many Gen Z job applicants are facing rejection. As a data analyst, it's essential to identify the key factors contributing to these rejections and provide actionable insights to improve the hiring process. In this tutorial, we'll explore a real-world scenario where a company is struggling to hire Gen Z talent, and we'll develop a data-driven solution to address this issue.

The company, "TechCorp," is a leading technology firm that receives thousands of job applications every month. However, they're experiencing a high rejection rate among Gen Z applicants, resulting in a significant loss of potential talent and revenue. The estimated ROI impact of this issue is a 20% decrease in potential revenue, which translates to $1 million in lost sales per quarter.

Step-by-Step Technical Solution

Step 1: Data Preparation (pandas/SQL)

To analyze the job application data, we'll use a combination of pandas and SQL. We'll start by loading the necessary libraries and creating a sample dataset.

import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score, classification_report

# Sample dataset
data = {
    'Application ID': [1, 2, 3, 4, 5],
    'Name': ['John', 'Jane', 'Bob', 'Alice', 'Mike'],
    'Age': [22, 25, 28, 22, 26],
    'Education': ['Bachelor', 'Master', 'Bachelor', 'Bachelor', 'Master'],
    'Experience': [1, 2, 3, 1, 2],
    'Skills': ['Python, Java', 'Python, C++', 'Java, C++', 'Python, JavaScript', 'Python, Java'],
    'Rejection Reason': ['Lack of experience', 'Insufficient skills', 'No reason', 'No reason', 'Lack of experience']
}

df = pd.DataFrame(data)
Enter fullscreen mode Exit fullscreen mode

Next, we'll create a SQL database to store the job application data and perform queries to extract relevant information.

CREATE TABLE Job_Applications (
    Application_ID INT PRIMARY KEY,
    Name VARCHAR(255),
    Age INT,
    Education VARCHAR(255),
    Experience INT,
    Skills VARCHAR(255),
    Rejection_Reason VARCHAR(255)
);

INSERT INTO Job_Applications (Application_ID, Name, Age, Education, Experience, Skills, Rejection_Reason)
VALUES
(1, 'John', 22, 'Bachelor', 1, 'Python, Java', 'Lack of experience'),
(2, 'Jane', 25, 'Master', 2, 'Python, C++', 'Insufficient skills'),
(3, 'Bob', 28, 'Bachelor', 3, 'Java, C++', 'No reason'),
(4, 'Alice', 22, 'Bachelor', 1, 'Python, JavaScript', 'No reason'),
(5, 'Mike', 26, 'Master', 2, 'Python, Java', 'Lack of experience');
Enter fullscreen mode Exit fullscreen mode

Step 2: Analysis Pipeline

To identify the key factors contributing to the rejection of Gen Z job applications, we'll perform the following analysis:

  • Descriptive statistics: Calculate the mean, median, and standard deviation of the age and experience variables.
  • Correlation analysis: Examine the correlation between the age, experience, and rejection reason variables.
  • Text analysis: Analyze the skills and rejection reason text data to identify common patterns and themes.
# Descriptive statistics
age_mean = df['Age'].mean()
age_median = df['Age'].median()
age_std = df['Age'].std()

experience_mean = df['Experience'].mean()
experience_median = df['Experience'].median()
experience_std = df['Experience'].std()

print("Age Mean:", age_mean)
print("Age Median:", age_median)
print("Age Standard Deviation:", age_std)

print("Experience Mean:", experience_mean)
print("Experience Median:", experience_median)
print("Experience Standard Deviation:", experience_std)

# Correlation analysis
correlation_matrix = df[['Age', 'Experience', 'Rejection Reason']].corr()
print(correlation_matrix)

# Text analysis
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
import nltk
nltk.download('punkt')
nltk.download('stopwords')

def text_analysis(text):
    tokens = word_tokenize(text)
    tokens = [token for token in tokens if token.isalpha()]
    stop_words = set(stopwords.words('english'))
    tokens = [token for token in tokens if token not in stop_words]
    return tokens

skills_tokens = df['Skills'].apply(text_analysis)
rejection_reason_tokens = df['Rejection Reason'].apply(text_analysis)

print(skills_tokens)
print(rejection_reason_tokens)
Enter fullscreen mode Exit fullscreen mode

Step 3: Model/Visualization Code

To visualize the insights gained from the analysis, we'll create a dashboard using matplotlib and seaborn.

import matplotlib.pyplot as plt
import seaborn as sns

# Age distribution
plt.hist(df['Age'], bins=10)
plt.title('Age Distribution')
plt.xlabel('Age')
plt.ylabel('Frequency')
plt.show()

# Experience distribution
plt.hist(df['Experience'], bins=10)
plt.title('Experience Distribution')
plt.xlabel('Experience')
plt.ylabel('Frequency')
plt.show()

# Rejection reason distribution
plt.bar(df['Rejection Reason'].value_counts().index, df['Rejection Reason'].value_counts())
plt.title('Rejection Reason Distribution')
plt.xlabel('Rejection Reason')
plt.ylabel('Frequency')
plt.show()

# Correlation heatmap
plt.figure(figsize=(10, 8))
sns.heatmap(correlation_matrix, annot=True, cmap='coolwarm')
plt.title('Correlation Heatmap')
plt.show()
Enter fullscreen mode Exit fullscreen mode

We'll also train a random forest classifier to predict the rejection reason based on the age, experience, and skills variables.

# Split data into training and testing sets
X = df[['Age', 'Experience']]
y = df['Rejection Reason']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Train random forest classifier
rfc = RandomForestClassifier(n_estimators=100, random_state=42)
rfc.fit(X_train, y_train)

# Make predictions
y_pred = rfc.predict(X_test)

# Evaluate model performance
accuracy = accuracy_score(y_test, y_pred)
print("Model Accuracy:", accuracy)

# Classification report
print(classification_report(y_test, y_pred))
Enter fullscreen mode Exit fullscreen mode

Step 4: Performance Evaluation

To evaluate the performance of the model, we'll use metrics such as accuracy, precision, recall, and F1-score.

from sklearn.metrics import precision_score, recall_score, f1_score

# Evaluate model performance
accuracy = accuracy_score(y_test, y_pred)
precision = precision_score(y_test, y_pred, average='weighted')
recall = recall_score(y_test, y_pred, average='weighted')
f1 = f1_score(y_test, y_pred, average='weighted')

print("Model Accuracy:", accuracy)
print("Model Precision:", precision)
print("Model Recall:", recall)
print("Model F1-Score:", f1)
Enter fullscreen mode Exit fullscreen mode

Step 5: Production Deployment

To deploy the model in production, we'll use a cloud-based platform such as AWS or Google Cloud. We'll create a RESTful API using Flask or Django to expose the model's predictions.

from flask import Flask, request, jsonify
from sklearn.externals import joblib

app = Flask(__name__)

# Load trained model
model = joblib.load('random_forest_model.pkl')

@app.route('/predict', methods=['POST'])
def predict():
    data = request.get_json()
    age = data['age']
    experience = data['experience']
    skills = data['skills']

    # Make predictions
    prediction = model.predict([[age, experience]])

    # Return prediction
    return jsonify({'prediction': prediction[0]})

if __name__ == '__main__':
    app.run(debug=True)
Enter fullscreen mode Exit fullscreen mode

Metrics/ROI Calculations

To calculate the ROI of the model, we'll use the following metrics:

  • Cost savings: The model helps reduce the cost of hiring and training new employees by predicting the rejection reason and providing insights to improve the hiring process.
  • Revenue increase: The model helps increase revenue by improving the quality of hires and reducing the time-to-hire.
  • Return on investment (ROI): The ROI of the model is calculated by dividing the net benefit (cost savings + revenue increase) by the total investment (development cost + maintenance cost).
# Calculate ROI
cost_savings = 100000  # Cost savings per year
revenue_increase = 200000  # Revenue increase per year
total_investment = 50000  # Total investment (development cost + maintenance cost)

net_benefit = cost_savings + revenue_increase
roi = (net_benefit / total_investment) * 100

print("ROI:", roi)
Enter fullscreen mode Exit fullscreen mode

Edge Cases

To handle edge cases, we'll use the following strategies:

  • Data preprocessing: We'll preprocess the data to handle missing values, outliers, and categorical variables.
  • Model selection: We'll select a model that can handle non-linear relationships and interactions between variables.
  • Hyperparameter tuning: We'll tune the hyperparameters of the model to optimize its performance.
# Handle edge cases
from sklearn.preprocessing import StandardScaler
from sklearn.impute import SimpleImputer

# Preprocess data
scaler = StandardScaler()
imputer = SimpleImputer()

X_scaled = scaler.fit_transform(X)
X_imputed = imputer.fit_transform(X_scaled)

# Select model
from sklearn.ensemble import GradientBoostingClassifier

# Tune hyperparameters
from sklearn.model_selection import GridSearchCV

param_grid = {
    'n_estimators': [10, 50, 100],
    'learning_rate': [0.1, 0.5, 1],
    'max_depth': [3, 5, 10]
}

grid_search = GridSearchCV(GradientBoostingClassifier(), param_grid, cv=5)
grid_search.fit(X_imputed, y)

print("Best Parameters:", grid_search.best_params_)
print("Best Score:", grid_search.best_score_)
Enter fullscreen mode Exit fullscreen mode

Scaling Tips

To scale the model, we'll use the following strategies:

  • Distributed computing: We'll use distributed computing frameworks such as Apache Spark or Hadoop to process large datasets.
  • Cloud computing: We'll use cloud computing platforms such as AWS or Google Cloud to deploy the model and handle large volumes of traffic.
  • Model parallelism: We'll use model parallelism techniques such as data parallelism or model parallelism to train the model on large datasets.
# Scale model
from sklearn.externals import joblib
from sklearn.model_selection import train_test_split

# Split data into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Train model
model = GradientBoostingClassifier()
model.fit(X_train, y_train)

# Save model
joblib.dump(model, 'gradient_boosting_model.pkl')

# Load model
model = joblib.load('gradient_boosting_model.pkl')

# Make predictions
y_pred = model.predict(X_test)

# Evaluate model performance
accuracy = accuracy_score(y_test, y_pred)
print("Model Accuracy:", accuracy)
Enter fullscreen mode Exit fullscreen mode

By following these steps and using the provided code, you can develop a data-driven solution to identify the key factors contributing to the rejection of Gen Z job applications and provide actionable insights to improve the hiring process.

Top comments (0)