Skip to content

Instantly share code, notes, and snippets.

View findtharun's full-sized avatar
🎯
Learning

Tharun Kumar Tallapalli findtharun

🎯
Learning
View GitHub Profile
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
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.
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
{
"inputContentType": "CSV",
"outputContentType": "CSV",
"input": [
{
"name": "sepal.length",
"type": "DECIMAL"
},
{
"name": "sepal.width",
{
"inputContentType": "CSV",
"outputContentType": "CSV",
"input": [
{
"name": "sepal.length",
"type": "DECIMAL"
},
{
"name": "sepal.width",
{
"inputContentType": "CSV",
"outputContentType": "CSV",
"input": [
{
"name": "sepal.length",
"type": "DECIMAL"
},
{
"name": "sepal.width",