Skip to content

Instantly share code, notes, and snippets.

First Sweep of DBSCAN:
DBSCAN(eps=24.37, min_samples=10).fit(new_vectors)
Email Blasts
0: ['email_blast',
'blast_email',
'email_blast_size',
0: ['local_marketing_solutions',
'marketing_solutions_online',
'digital_marketing_solutions',
'local_digital_marketing_solutions',
'website_marketing_solutions',
'internet_marketing_solutions',
'business_marketing_solutions',
'digital_marketing_solutions_company',
'site_marketing_solutions',
'online_marketing_solution',
Free latex/nitrile gloves
0: ['latex_free_nitrile_gloves',
'are_nitrile_gloves_latex_free',
'nitrile_or_latex_gloves',
'latex_or_nitrile_gloves',
'is_nitrile_gloves_latex_free',
'nitrile_gloves_latex_free',
'free_latex_gloves',
'nitrile_free_gloves',
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from sklearn.cluster import KMeans
import gensim
import sys
from pprint import pprint
import numpy as np
import collections
from sklearn.cluster import DBSCAN
Main clusters:
Disposable poly/nitrile/latex gloves
ADJECTIVE gloves
Food/service/automotive industry
Latex/Nitril/vinyl/poly material/rubber
Vinyl/poly gloves
Protection/safety products
Glove + ADJECTIVE/NOUN
Off topic sales jargon terms
Customer prospectives
{1: {1: ['potential_customers',
'prospective_customers',
'future_customers',
'existing_customers',
'current_customers',
'reach_customers',
'gain_new_customers',
'ideal_customers',
{1: {0: {'cluster': ['social_media',
'digital_marketing',
'small_business',
'marketing_strategy',
'business_owners',
'local_businesses',
'business_owner',
'small_business_owners',
'social_networks',
'social_media_manager',
epsilons = [10, 12, 14, 17, 20]
min_samples = [5, 10, 15, 20]
data = {
'sun_trust': ["best_Forest_Highland_Mobile_AL_auto", "Coral_Springs_FL_banks", "banker_branch_mortgage_net", "Baltimore_MD_Grove_Park_cash_advance", "bank_in_Downtown_Tampa_FL", "Sugar_Land_harp_lender", "top_bank_33020", "top_bank_in_Leesburg_Virginia", "accounting_Kensington_San_Diego", "chase_bank_charleston_sc", "car_insurance_Sterling_Charlotte_North_Carolina", "top_Midtown_Atlanta_banks", "bank_in_Pleasant_Valley_Austin", "bank_in_Casselberry_FL", "bank_Old_Town_Area_Baltimore_MD", "best_car_insurance_Huntersville_NC", "top_bank_Deerfield_Beach_FL", "top_bank_Pinecrest_Florida", "best_in_Raleigh_Memphis_amc", "bank_in_Virginia_Petersburg", "chevy_in_New_Village_Phoenix", "Hampton_VA_Downtown_bank", "Old_North_Knoxville_Knoxville_TN_bank", "top_bank_in_Leesburg_VA", "top_bank_in_Hampton_VA", "North_Central_Raleigh_NC_accounting", "sun_bank_florida", "bank_account_Jacksonville_FL", "Annapolis_Mary._accounting", "best_bank_Cocoa_Flori
epsilons = [10, 12, 14, 17, 20]
min_samples = [5, 10, 15, 20]
data = {
'sun_trust': ["best_Forest_Highland_Mobile_AL_auto", "Coral_Springs_FL_banks", "banker_branch_mortgage_net", "Baltimore_MD_Grove_Park_cash_advance", "bank_in_Downtown_Tampa_FL", "Sugar_Land_harp_lender", "top_bank_33020", "top_bank_in_Leesburg_Virginia", "accounting_Kensington_San_Diego", "chase_bank_charleston_sc", "car_insurance_Sterling_Charlotte_North_Carolina", "top_Midtown_Atlanta_banks", "bank_in_Pleasant_Valley_Austin", "bank_in_Casselberry_FL", "bank_Old_Town_Area_Baltimore_MD", "best_car_insurance_Huntersville_NC", "top_bank_Deerfield_Beach_FL", "top_bank_Pinecrest_Florida", "best_in_Raleigh_Memphis_amc", "bank_in_Virginia_Petersburg", "chevy_in_New_Village_Phoenix", "Hampton_VA_Downtown_bank", "Old_North_Knoxville_Knoxville_TN_bank", "top_bank_in_Leesburg_VA", "top_bank_in_Hampton_VA", "North_Central_Raleigh_NC_accounting", "sun_bank_florida", "bank_account_Jacksonville_FL", "Annapolis_Mary._accounting", "best_bank_Cocoa_Flori
epsilons = [10, 12, 14, 17, 20]
min_samples = [5, 10, 15, 20]
data = {
'sun_trust': ["best_Forest_Highland_Mobile_AL_auto", "Coral_Springs_FL_banks", "banker_branch_mortgage_net", "Baltimore_MD_Grove_Park_cash_advance", "bank_in_Downtown_Tampa_FL", "Sugar_Land_harp_lender", "top_bank_33020", "top_bank_in_Leesburg_Virginia", "accounting_Kensington_San_Diego", "chase_bank_charleston_sc", "car_insurance_Sterling_Charlotte_North_Carolina", "top_Midtown_Atlanta_banks", "bank_in_Pleasant_Valley_Austin", "bank_in_Casselberry_FL", "bank_Old_Town_Area_Baltimore_MD", "best_car_insurance_Huntersville_NC", "top_bank_Deerfield_Beach_FL", "top_bank_Pinecrest_Florida", "best_in_Raleigh_Memphis_amc", "bank_in_Virginia_Petersburg", "chevy_in_New_Village_Phoenix", "Hampton_VA_Downtown_bank", "Old_North_Knoxville_Knoxville_TN_bank", "top_bank_in_Leesburg_VA", "top_bank_in_Hampton_VA", "North_Central_Raleigh_NC_accounting", "sun_bank_florida", "bank_account_Jacksonville_FL", "Annapolis_Mary._accounting", "best_bank_Cocoa_Flori