This file contains 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
train_data, validation_data, test_data = np.split(dataset.sample(frac=1, random_state=1729), [int(0.7 * len(dataset)), int(0.9 * len(dataset))]) | |
train_data.to_csv('train.csv', header=False, index=False) | |
validation_data.to_csv('validation.csv', header=False, index=False) | |
#UPLOADING AND TRAINING AND VALIDATION TO DATA TO S3 BUCKET | |
s3_input_train = boto3.Session().resource('s3').Bucket(bucket).Object(os.path.join(prefix, 'train/train.csv')).upload_file('train.csv') | |
s3_input_validation = boto3.Session().resource('s3').Bucket(bucket).Object(os.path.join(prefix, 'validation/validation.csv')).upload_file('validation.csv') | |
#MAKING DATA AS LIBSVM or CSV FORMAT |
This file contains 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
from sklearn.preprocessing import LabelEncoder | |
le=LabelEncoder() | |
dataset['variety']=le.fit_transform(dataset['variety']) | |
dataset = pd.concat([dataset['variety'], dataset.drop(['variety'], axis=1)], axis=1) | |
dataset.head(3) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 = 'testawslearn' | |
prefix = 'git' | |
# Define IAM role | |
import boto3 | |
import re | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import os |
This file contains 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
{ | |
"inputContentType": "CSV", | |
"outputContentType": "CSV", | |
"input": [ | |
{ | |
"name": "sepal.length", | |
"type": "DECIMAL" | |
}, | |
{ | |
"name": "sepal.width", |
This file contains 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
{ | |
"inputContentType": "CSV", | |
"outputContentType": "CSV", | |
"input": [ | |
{ | |
"name": "sepal.length", | |
"type": "DECIMAL" | |
}, | |
{ | |
"name": "sepal.width", |
This file contains 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
{ | |
"inputContentType": "CSV", | |
"outputContentType": "CSV", | |
"input": [ | |
{ | |
"name": "sepal.length", | |
"type": "DECIMAL" | |
}, | |
{ | |
"name": "sepal.width", |
NewerOlder