Last active
May 14, 2018 10:48
-
-
Save andreaschandra/268c632cf81d3c6592b566c01ffd4654 to your computer and use it in GitHub Desktop.
import libraries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bucket = <your-bucket> | |
prefix = 'topic-kmeans' | |
import warnings | |
warnings.simplefilter("ignore") | |
import os | |
import boto3 | |
import sagemaker | |
import numpy as np | |
import mxnet as mx | |
from sagemaker import get_execution_role | |
from sagemaker.amazon.common import numpy_to_record_serializer | |
from time import time | |
from sklearn.datasets import fetch_20newsgroups | |
from sklearn.feature_extraction.text import TfidfVectorizer | |
from sklearn.cluster import KMeans | |
from sklearn import metrics | |
# Define IAM role | |
role = get_execution_role() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment