Demo Implementation System

Implementasi praktis algoritma AI & Machine Learning dengan penjelasan detail setiap langkah

7 Metode Step-by-Step Process Visual Analytics Mathematical Formulas
System Overview

15

Total Products

10

Customers

50

Transactions

4.02/5

Avg Rating

AI Methods Demo

Pilih metode dan lihat proses step-by-step

Parameters
Product IDs 1-15 available
Formula: y = mx + b
m (slope): (nΣxy - ΣxΣy) / (nΣx² - (Σx)²)
b (intercept): (Σy - mΣx) / n
R²: 1 - (SS_res / SS_tot)
About Linear Regression

Purpose: Predict future sales based on historical data

Input: Time series of sales data

Output: Trend line equation and future predictions

Business Use: Inventory planning, revenue forecasting

Accuracy Metric: R-squared (0-1, higher is better)

Process Flow:
  1. Collect historical sales data
  2. Calculate Σx, Σy, Σxy, Σx²
  3. Compute slope (m) and intercept (b)
  4. Generate prediction equation
  5. Calculate R-squared for accuracy
  6. Make future predictions
Parameters
How many customer segments to create
Distance: Euclidean √(Σ(xᵢ - yᵢ)²)
Objective: Minimize J = Σᵢ=₁ᵏ Σₓ∈Cᵢ ||x - μᵢ||²
Centroid Update: μᵢ = (1/|Cᵢ|) Σₓ∈Cᵢ x
Convergence: When cluster assignments stabilize
About K-Means Clustering

Purpose: Segment customers into groups based on behavior

Input: Customer purchase history and demographics

Output: Customer segments with profiles

Business Use: Targeted marketing, personalized offers

Evaluation: Within-cluster sum of squares (WCSS)

Customer Segments Typically Found:
  • VIP Customers: High spend, frequent purchases
  • Loyal Customers: Regular purchases, good spending
  • Potential Customers: Recent interest, moderate spending
  • Casual Customers: Infrequent, low spending
  • At-Risk Customers: No recent purchases
Parameters
Customer IDs 1-10 available
Entropy: H(S) = -Σ pᵢ log₂(pᵢ)
Information Gain: IG = H(parent) - Σ (|Dᵥ|/|D|) H(Dᵥ)
Gini Impurity: G = 1 - Σ pᵢ²
Split Criteria: Maximize information gain
About Decision Tree

Purpose: Recommend products based on customer profile

Input: Customer history, preferences, demographics

Output: Personalized product recommendations

Business Use: Cross-selling, upselling, personalized marketing

Advantages: Easy to interpret, handles mixed data types

Decision Rules Applied:
  • Rule 1: Customer type (Individual/Business/Government)
  • Rule 2: Preferred product category from history
  • Rule 3: Price sensitivity based on past purchases
  • Rule 4: Product ratings and popularity
  • Rule 5: Product type (Goods/Services) preference
Parameters
Enter customer review text to analyze sentiment
Bayes Theorem: P(A|B) = P(B|A)P(A) / P(B)
Naive Assumption: Features independent
Laplace Smoothing: α = 0.1
Log Probability: Σ log(P(word|class))
About Naive Bayes

Purpose: Classify text sentiment as Positive/Negative/Neutral

Input: Customer review text

Output: Sentiment classification with confidence scores

Business Use: Customer feedback analysis, review monitoring

Training Data: 30 labeled reviews (10 each class)

Keyword Dictionary:
Positive: bagus, puas, cepat, murah, baik, mantap, berkualitas, sesuai, memuaskan, recommend
Negative: jelek, lambat, mahal, kecewa, buruk, gagal, rusak, tidak, sulit, komplain
Neutral: biasa, standar, cukup, lumayan, oke, standard, normal, regular, average, moderate
Parameters
Rule Format: IF condition THEN action
Inference: Forward Chaining
Certainty: Confidence factors (0-1)
Rules: 5 issue categories × multiple symptoms
About Expert System

Purpose: Diagnose problems and provide solutions

Input: Problem symptoms and product type

Output: Step-by-step troubleshooting guide

Business Use: Customer support automation, self-service

Knowledge Base: 5 issue types with 20+ symptoms

Issue Categories in Knowledge Base:
  • Hardware Issues: Power, overheating, physical damage
  • Software Issues: Errors, crashes, performance
  • Network Issues: Connectivity, speed, configuration
  • Usage Issues: Understanding, operation, features
  • Configuration Issues: Settings, compatibility, setup
Parameters
Product IDs 1-15 available
Decomposition: Yₜ = Tₜ + Sₜ + Cₜ + εₜ
Moving Average: MAₜ = (Yₜ + Yₜ₋₁ + Yₜ₋₂) / 3
Trend: Linear regression on time index
Seasonality: Periodic pattern detection
About Time Series Analysis

Purpose: Forecast future values based on historical patterns

Input: Historical time-ordered data

Output: Trend analysis, seasonality, future predictions

Business Use: Demand forecasting, inventory planning

Components: Trend, Seasonality, Cyclical, Irregular

Analysis Components:
  • Trend Analysis: Long-term direction (up/down/flat)
  • Seasonality: Regular periodic fluctuations
  • Cyclical Patterns: Longer-term economic cycles
  • Irregular/Random: Unpredictable variations
  • Moving Averages: Smooth out short-term fluctuations
Parameters
Purchase Frequency (normalized)
Average Rating (normalized)
Perceptron Rule: w = w + η(y - ŷ)x
Activation: f(z) = 1 if z ≥ 0 else 0
Learning Rate: η = 0.1
Epochs: 100 maximum
Weights: [bias, w1, w2] initialized randomly
About Simple Perceptron

Purpose: Binary classification of customer loyalty

Input: 2 normalized features [0-1 range]

Output: 1 (Loyal) or 0 (Not Loyal) with confidence

Business Use: Customer retention prediction

Training Data: 4 samples with known labels

Neural Network Architecture:
  • Input Layer: 2 neurons (features)
  • Output Layer: 1 neuron (classification)
  • Activation: Step function (binary output)
  • Learning: Supervised with labeled data
  • Decision Boundary: Linear separation in feature space

Database Management

Setup database with sample data for demo

Important Notice

Initializing the database will:

  • Create 5 tables with correct foreign key constraints
  • Insert 15 sample products
  • Insert 10 sample customers
  • Insert 50 sample transactions (5 months)
  • Insert 10 sample reviews

Note: Existing tables will be dropped and recreated.

Ready to Initialize?

Click below to setup the database with sample data

Initialize Database
Requires MySQL database connection
Database Schema
Table: produk
Fields: id, nama, tipe, category, harga, rating, stok, deskripsi
Primary Key: id
Referenced by: transaksi, review, penjualan_harian
Table: pelanggan
Fields: id, nama, email, kategori, kota, join_date, status
Primary Key: id
Referenced by: transaksi, review
Table: transaksi
Fields: id, customer_id, product_id, jumlah, total_harga, rating, tanggal, metode_bayar
Foreign Keys: customer_id → pelanggan.id, product_id → produk.id