import numpy as np from sklearn.cluster import KMeans import matplotlib.pyplot as plt # Sample data: customer_id, total_purchases, avg_time_between_purchases (hours) customer_data = np.array([ [1, 25, 0.5], [2, 10, 5], [3, 15, 2], [4, 30, 1], [5, 7, 10], [6, 20, 3], [7, 12, 7], [8, 28, 0.8], [9, 6, 12], [10, 18, 1.5] ]) # Extract customer IDs and feature data customer_ids = customer_data[:, 0].astype(int) features = customer_data[:, 1:] # Perform k-means clustering n_clusters = 2 kmeans = KMeans(n_clusters=n_clusters, random_state=42) cluster_labels = kmeans.fit_predict(features) # Find the cluster with the lowest average time between purchases impulsive_cluster = np.argmin(kmeans.cluster_centers_[:, 1]) # Get the customer IDs in the impulsive cluster impulsive_buyers = customer_ids[cluster_labels == impulsive_cluster] print("Impulsive buyers:", impulsive_buyers) # Visualize the clustering results (optional) plt.scatter(features[:, 0], features[:, 1], c=cluster_labels, cmap='viridis') plt.scatter(kmeans.cluster_centers_[:, 0], kmeans.cluster_centers_[:, 1], c='red', marker='x') plt.xlabel('Total Purchases') plt.ylabel('Average Time Between Purchases (hours)') plt.show()
top of page
If you feel like you're carrying half of your belongings with you at all times, this backpack is for you! It has a spacious inside compartment (with a pocket for your laptop), and a hidden back pocket for safekeeping your most valuable items.

• Made from 100% polyester
• Fabric weight: 9.56 oz/yd² (325 g/m²), weight may vary by 5%
• Dimensions: 16.1″ (41 cm) in height, 12.2″ (31 cm) in width, and 5.5″ (14 cm) in diameter
• Capacity: 5.3 gallons (20 l)
• Max weight: 44 lbs (20 kg)
• Water-resistant material
• Large inside pocket with a separate pocket for a 15” laptop, a hidden pocket with zipper on the back of the bag
• Top zipper has 2 sliders, and there are zipper pullers attached to each slider
• Silky lining, piped inside hems, and a soft mesh back
• Padded ergonomic bag straps from polyester with plastic strap regulators
• Blank product components sourced from China

This product is made especially for you as soon as you place an order, which is why it takes us a bit longer to deliver it to you. Making products on demand instead of in bulk helps reduce overproduction, so thank you for making thoughtful purchasing decisions!

Minimalist Backpack

SKU: 6303BF1023337_10876
$47.50가격
제외: 부가세
수량
    Product Page: Stores_Product_Widget
    bottom of page