<jupyter_start><jupyter_text>Exercise 1.01 Loading the dataset and creating the target Tujuan dari latihan ini adalah untuk:- Dapatkan dataset csv dari repositori pembelajaran mesin UCI- Muat kumpulan data ke dalam memori sebagai kerangka data panda- Identifikasi target yang tepat untuk diprediksi, dan buat kolom numerik biner dari target  Download the datasetKunjungi https://archive.ics.uci.edu/ml/datasets/Online+Shoppers+Purchasing+Intention+Dataset dan download file dengan nama `online_shoppers_intention.csv`. Buatlah folder dengan nama `data` and letahkkan file tadi di dalam folder ini.Data terletak di file `online_shoppers_intention.csv` dan informasi tentang data tersebut disediakan secara online di situs web UCI di sini: https://archive.ics.uci.edu/ml/datasets/Online+Shoppers+Purchasing+Intention+Dataset.<jupyter_code>import pandas as pd
data = pd.read_csv('../data/online_shoppers_intention.csv')
data.head(n=20)<jupyter_output><empty_output><jupyter_text>Looks good, let's see how many rows and columns we have<jupyter_code>data.shape
print(f'There are {data.shape[0]} rows and {data.shape[1]} columns')<jupyter_output>There are 12330 rows and 18 columns<jupyter_text>Looks like we have a given output variable which we can use as our taret, it is the 1st column, "Class". This seems like a intuitive, and most importantly useful, target to predict for, whether ther. If we were working for a bank this would be a great variable to predict!Sepertinya kita memiliki variabel output tertentu yang dapat kita gunakan sebagai target kita, yaitu kolom 1, "Class". Ini adalah target intuitif, dan yang akan diprediksi. Jika kita bekerja do bank, Class ini akan menjadi variabel yang bagus untuk diprediksi!<jupyter_code>feats = data.drop('Revenue', axis=1)
target = data['Revenue']
print(f'Features table has {feats.shape[0]} rows and {feats.shape[1]} columns')
print(f'Target table has {target.shape[0]} rows')<jupyter_output>Features table has 12330 rows and 17 columns
Target table has 12330 rows<jupyter_text>Looks good, let's save these as csvs for later.<jupyter_code>target.head()<jupyter_output><empty_output><jupyter_text>Save the data out to csv files<jupyter_code>feats.to_csv('../data/OSI_feats.csv', index=False)
target.to_csv('../data/OSI_target.csv', header='Revenue', index=False)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup