1
+ {
2
+ "nbformat" : 4 ,
3
+ "nbformat_minor" : 0 ,
4
+ "metadata" : {
5
+ "colab" : {
6
+ "provenance" : [],
7
+ "toc_visible" : true ,
8
+ "include_colab_link" : true
9
+ },
10
+ "kernelspec" : {
11
+ "name" : " python3" ,
12
+ "display_name" : " Python 3"
13
+ }
14
+ },
15
+ "cells" : [
16
+ {
17
+ "cell_type" : " markdown" ,
18
+ "metadata" : {
19
+ "id" : " view-in-github" ,
20
+ "colab_type" : " text"
21
+ },
22
+ "source" : [
23
+ " <a href=\" https://colab.research.google.com/github/Abcxyzcmnl2006/leetcode/blob/main/data_preprocessing_template.ipynb\" target=\" _parent\" ><img src=\" https://colab.research.google.com/assets/colab-badge.svg\" alt=\" Open In Colab\" /></a>"
24
+ ]
25
+ },
26
+ {
27
+ "cell_type" : " markdown" ,
28
+ "metadata" : {
29
+ "id" : " WOw8yMd1VlnD"
30
+ },
31
+ "source" : [
32
+ " # Data Preprocessing Template"
33
+ ]
34
+ },
35
+ {
36
+ "cell_type" : " markdown" ,
37
+ "metadata" : {
38
+ "id" : " NvUGC8QQV6bV"
39
+ },
40
+ "source" : [
41
+ " ## Importing the libraries"
42
+ ]
43
+ },
44
+ {
45
+ "cell_type" : " code" ,
46
+ "metadata" : {
47
+ "id" : " wfFEXZC0WS-V"
48
+ },
49
+ "source" : [
50
+ " import numpy as np\n " ,
51
+ " import matplotlib.pyplot as plt\n " ,
52
+ " import pandas as pd"
53
+ ],
54
+ "execution_count" : null ,
55
+ "outputs" : []
56
+ },
57
+ {
58
+ "cell_type" : " markdown" ,
59
+ "metadata" : {
60
+ "id" : " fhYaZ-ENV_c5"
61
+ },
62
+ "source" : [
63
+ " ## Importing the dataset"
64
+ ]
65
+ },
66
+ {
67
+ "cell_type" : " code" ,
68
+ "metadata" : {
69
+ "id" : " aqHTg9bxWT_u"
70
+ },
71
+ "source" : [
72
+ " dataset = pd.read_csv('Data.csv')\n " ,
73
+ " X = dataset.iloc[:, :-1].values\n " ,
74
+ " y = dataset.iloc[:, -1].values"
75
+ ],
76
+ "execution_count" : null ,
77
+ "outputs" : []
78
+ },
79
+ {
80
+ "cell_type" : " markdown" ,
81
+ "metadata" : {
82
+ "id" : " 3abSxRqvWEIB"
83
+ },
84
+ "source" : [
85
+ " ## Splitting the dataset into the Training set and Test set"
86
+ ]
87
+ },
88
+ {
89
+ "cell_type" : " code" ,
90
+ "metadata" : {
91
+ "id" : " hm48sif-WWsh"
92
+ },
93
+ "source" : [
94
+ " from sklearn.model_selection import train_test_split\n " ,
95
+ " X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 0)"
96
+ ],
97
+ "execution_count" : null ,
98
+ "outputs" : []
99
+ }
100
+ ]
101
+ }
0 commit comments