Close Menu
    Trending
    • What comes next for AI copyright lawsuits?
    • Why PDF Extraction Still Feels LikeHack
    • GenAI Will Fuel People’s Jobs, Not Replace Them. Here’s Why
    • Millions of websites to get ‘game-changing’ AI bot blocker
    • I Worked Through Labor, My Wedding and Burnout — For What?
    • Cloudflare will now block AI bots from crawling its clients’ websites by default
    • 🚗 Predicting Car Purchase Amounts with Neural Networks in Keras (with Code & Dataset) | by Smruti Ranjan Nayak | Jul, 2025
    • Futurwise: Unlock 25% Off Futurwise Today
    AIBS News
    • Home
    • Artificial Intelligence
    • Machine Learning
    • AI Technology
    • Data Science
    • More
      • Technology
      • Business
    AIBS News
    Home»Machine Learning»Neural Networks: A Hands-On Guide | by Kamalmeet Singh | Apr, 2025
    Machine Learning

    Neural Networks: A Hands-On Guide | by Kamalmeet Singh | Apr, 2025

    Team_AIBS NewsBy Team_AIBS NewsApril 26, 2025No Comments4 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    Neural networks have revolutionized the sector of synthetic intelligence, particularly with the rise of Generative AI lately. Whereas the idea of neural networks is usually seen as advanced, on this submit, I intention to interrupt it down right into a easy, step-by-step information which you can simply perceive — and even check out domestically or utilizing a web-based platform like Google Colab.

    I assume that you have already got a primary theoretical understanding of neural networks. If not, we suggest reviewing this post earlier than persevering with.

    We’re beginning with a sensible downside: given a set of leads, how can we predict which leads usually tend to convert, permitting the gross sales staff to prioritize their efforts successfully?

    It is a real-world problem that companies face day by day. You may be questioning whether or not conventional classification algorithms may very well be a greater match for this job, and you’d be proper.

    Nevertheless, on this tutorial, we’re utilizing this downside primarily as a approach to discover and perceive the ideas of Neural Networks. By preserving our studying in a real-world situation, we intention to make the underlying rules extra significant and simpler to understand.

    Since we do not need entry to real-world knowledge for this train, we’ll generate random take a look at knowledge, creating 1,000 data with pattern columns corresponding to wage, age_group, marital_status, and others.

    Whereas producing this pattern knowledge, we may even assign a label indicating whether or not a lead was transformed or not. To maintain it easy, we’ll use a primary rule: if sure parameters — corresponding to wage being above a threshold, revenue group, and schooling degree — meet particular situations, the lead shall be marked as transformed.

    In fact, real-world knowledge could be way more advanced, however this simplified setup is ample to assist us get began and deal with understanding the important thing ideas.

    # Step 1: Import Libraries
    import numpy as np
    import pandas as pd
    from sklearn.model_selection import train_test_split
    from sklearn.preprocessing import StandardScaler
    import tensorflow as tf
    from tensorflow.keras.fashions import Sequential
    from tensorflow.keras.layers import Dense, Dropout
    import matplotlib.pyplot as plt

    # Step 2: Set random seed for reproducibility
    np.random.seed(42)
    tf.random.set_seed(42)

    # Step 3: Generate artificial knowledge
    knowledge = {
    'wage': np.random.regular(50000, 15000, 1000), # Common wage = 50k, SD=15k
    'age_group': np.random.selection([1, 2, 3], 1000), # 1: 18-25, 2: 26-35, 3: 36-50
    'marital_status': np.random.selection([0, 1], 1000), # 0: Single, 1: Married
    'children': np.random.randint(0, 4, 1000), # 0 to three children
    'education_level': np.random.selection([1, 2, 3], 1000), # 1: Excessive Faculty, 2: Bachelor, 3: Masters
    'occupation_type': np.random.selection([0, 1], 1000), # 0: Salaried, 1: Enterprise
    'lead_source': np.random.selection([0, 1, 2], 1000), # 0: Web site, 1: Referral, 2: Commercial
    'income_group': np.random.selection([0, 1, 2], 1000), # 0: Low, 1: Center, 2: Excessive
    }

    # Step 4: Generate labels (whether or not the lead transformed or not)
    labels = (
    (knowledge['salary'] > 55000).astype(int) +
    (np.array(knowledge['income_group']) >= 1).astype(int) +
    (np.array(knowledge['education_level']) >= 2).astype(int)
    ) >= 2
    labels = labels.astype(int)

    # Step 5: Create a DataFrame
    df = pd.DataFrame(knowledge)
    df['converted'] = labels

    # Step 6: View the primary few rows
    df.head()

    Separating knowledge right into a coaching dataset and a take a look at dataset.

    # Step 7: Separate options (X) and label (y)
    X = df.drop('transformed', axis=1)
    y = df['converted']

    # Step 8: Normalize the function values
    scaler = StandardScaler()
    X_scaled = scaler.fit_transform(X)

    # Step 9: Prepare-Check Break up (80% coaching, 20% validation)
    X_train, X_val, y_train, y_val = train_test_split(X_scaled, y, test_size=0.2, random_state=42)

    As soon as we’ve got the enter knowledge prepared (leads with options like wage, age group, and many others.), the subsequent step is to construct the neural community mannequin that can study from this knowledge and predict whether or not a lead will convert.

    # Step 10: Construct the mannequin
    mannequin = Sequential([
    Dense(32, activation='relu', input_shape=(8,)),
    Dropout(0.2),
    Dense(16, activation='relu'),
    Dense(1, activation='sigmoid') # For binary classification
    ])
    • The primary layer should specify input_shape=(8,) as a result of we’ve got 8 options.
    • ReLU or Rectified Linear Unit helps the community study nonlinear relationships. It’s a in style activation operate in deep studying that outputs the enter instantly if it’s constructive, and 0 in any other case.
    • Sigmoid makes the ultimate output a likelihood between 0 and 1.



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleTop Patenting Powerhouses of 2024
    Next Article Roommates’ Side Hustle Makes $1M a Month: ‘No Regrets’
    Team_AIBS News
    • Website

    Related Posts

    Machine Learning

    Why PDF Extraction Still Feels LikeHack

    July 1, 2025
    Machine Learning

    🚗 Predicting Car Purchase Amounts with Neural Networks in Keras (with Code & Dataset) | by Smruti Ranjan Nayak | Jul, 2025

    July 1, 2025
    Machine Learning

    Reinforcement Learning in the Age of Modern AI | by @pramodchandrayan | Jul, 2025

    July 1, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    What comes next for AI copyright lawsuits?

    July 1, 2025

    I Tried Buying a Car Through Amazon: Here Are the Pros, Cons

    December 10, 2024

    Amazon and eBay to pay ‘fair share’ for e-waste recycling

    December 10, 2024

    Artificial Intelligence Concerns & Predictions For 2025

    December 10, 2024

    Barbara Corcoran: Entrepreneurs Must ‘Embrace Change’

    December 10, 2024
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    Most Popular

    Why DeepSeek may fail the AI Race | by Mehul Gupta | Data Science in your pocket | Jan, 2025

    January 23, 2025

    Helix Synth: The AI-Powered Future of Protein Structure Prediction | by Allanatrix | Apr, 2025

    April 17, 2025

    How Altcoins Are Driving Innovation in Blockchain Technology: Key Insights

    March 6, 2025
    Our Picks

    What comes next for AI copyright lawsuits?

    July 1, 2025

    Why PDF Extraction Still Feels LikeHack

    July 1, 2025

    GenAI Will Fuel People’s Jobs, Not Replace Them. Here’s Why

    July 1, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2024 Aibsnews.comAll Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.