├── Lab_0
├── Datascience_Lab0.ipynb
├── dataset_HW0.txt
├── lab0_cheatsheet.pdf
└── lab0_slides.pdf
├── Lab_1
├── Data_Science_Lab1.ipynb
├── dataset_HW1.txt
└── lab1.pdf
├── Lab_10
├── Data_Science_Lab10_solutions.ipynb
└── datasets
│ ├── dataset.txt
│ └── dataset_descriptions.txt
├── Lab_2
├── Data_Science_Lab2.ipynb
├── dataset
│ ├── dataset_1_full.txt
│ ├── dataset_1_missing.txt
│ ├── dataset_2_full.txt
│ ├── dataset_2_missing.txt
│ ├── dataset_3_full.txt
│ ├── dataset_3_missing.txt
│ ├── dataset_4_full.txt
│ ├── dataset_4_missing.txt
│ ├── dataset_5_full.txt
│ ├── dataset_5_missing.txt
│ ├── dataset_6_full.txt
│ └── dataset_6_missing.txt
└── lab2.pdf
├── Lab_3
├── Data_Science_Lab3.ipynb
├── datasets
│ ├── dataset_1_test.txt
│ ├── dataset_1_train.txt
│ ├── dataset_1_train_noise_levels.txt
│ ├── dataset_2.txt
│ └── dataset_3.txt
└── lab3.pdf
├── Lab_4
├── Data_Science_Lab4.ipynb
├── datasets
│ ├── dataset_1.txt
│ ├── dataset_2.txt
│ ├── dataset_3.txt
│ ├── dataset_4.txt
│ └── dataset_4_descriptions.txt
└── lab4.pdf
├── Lab_5
├── Advanced_Pandas
│ ├── Advanced_Pandas.ipynb
│ ├── Advanced_Pandas_Solutions.ipynb
│ ├── cardio_disease.csv
│ └── cheese.csv
├── Maps
│ ├── California_County
│ │ ├── CaliforniaCounty.dbf
│ │ ├── CaliforniaCounty.shp
│ │ ├── CaliforniaCounty.shx
│ │ ├── California_County.prj
│ │ ├── California_County.sbn
│ │ ├── California_County.sbx
│ │ └── California_County.xml
│ ├── Map_Drawing.ipynb
│ ├── Map_Drawing_Solutions.ipynb
│ └── WIC.csv
├── Text Analysis
│ ├── Text_Analysis.ipynb
│ ├── Text_Analysis_Solutions.ipynb
│ └── tweet.csv
└── lab5.pdf
├── Lab_6
├── Data_Science_Lab6.ipynb
├── datasets
│ ├── dataset_1.txt
│ ├── dataset_2.txt
│ ├── dataset_3_test_1.txt
│ ├── dataset_3_test_2.txt
│ └── dataset_3_train.txt
└── lab6_slides.pdf
├── Lab_7
├── .ipynb_checkpoints
│ └── Data_Science_Lab7-checkpoint.ipynb
├── Data_Science_Lab7.ipynb
├── datasets
│ ├── dataset_1_year_2000.txt
│ ├── dataset_1_year_2001.txt
│ ├── dataset_1_year_2002.txt
│ ├── dataset_1_year_2003.txt
│ ├── dataset_1_year_2004.txt
│ ├── dataset_1_year_2005.txt
│ ├── dataset_1_year_2006.txt
│ ├── dataset_1_year_2007.txt
│ ├── dataset_1_year_2008.txt
│ ├── dataset_1_year_2009.txt
│ ├── dataset_1_year_2010.txt
│ ├── dataset_2.txt
│ ├── dataset_3.txt
│ ├── dataset_4_movie_names.txt
│ └── dataset_4_ratings.txt
└── lab7_slides.pdf
├── Lab_8
├── Data_Science_Lab8.ipynb
├── datasets
│ ├── challenge_testcase_1_test.txt
│ ├── challenge_testcase_1_train.txt
│ ├── challenge_testcase_2_test.txt
│ ├── challenge_testcase_2_train.txt
│ ├── challenge_testcase_3_test.txt
│ ├── challenge_testcase_3_train.txt
│ ├── dataset_1.txt
│ ├── dataset_2.txt
│ ├── dataset_3.txt
│ ├── dataset_4.txt
│ ├── dataset_5_description.txt
│ ├── dataset_5_test.txt
│ └── dataset_5_train.txt
└── lab8_slides.pdf
├── Lab_9
├── Data_Science_Lab9.ipynb
├── datasets
│ ├── dataset_1_test.txt
│ ├── dataset_1_train.txt
│ ├── dataset_2_test.txt
│ ├── dataset_2_train.txt
│ ├── dataset_3.txt
│ ├── dataset_5_test.txt
│ └── dataset_5_train.txt
└── lab9.pdf
├── astroid.gif
└── index.html
/Lab_0/Datascience_Lab0.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# CS 109A/AC 209A/STAT 121A Data Science: Lab 0\n",
8 | "**Harvard University**
\n",
9 | "**Fall 2016**
\n",
10 | "**Instructors: W. Pan, P. Protopapas, K. Rader**"
11 | ]
12 | },
13 | {
14 | "cell_type": "markdown",
15 | "metadata": {},
16 | "source": [
17 | "Import libraries"
18 | ]
19 | },
20 | {
21 | "cell_type": "code",
22 | "execution_count": 4,
23 | "metadata": {
24 | "collapsed": false
25 | },
26 | "outputs": [],
27 | "source": [
28 | "import numpy as np\n",
29 | "import matplotlib\n",
30 | "import matplotlib.pyplot as plt\n",
31 | "import random\n",
32 | "from mpl_toolkits.mplot3d import Axes3D\n",
33 | "from bs4 import BeautifulSoup\n",
34 | "import urllib\n",
35 | "%matplotlib inline"
36 | ]
37 | },
38 | {
39 | "cell_type": "markdown",
40 | "metadata": {},
41 | "source": [
42 | "## Problem 1: Processing Tabular Data from File\n",
43 | "\n",
44 | "In this problem, we practice reading csv formatted data and doing some very simple data exploration."
45 | ]
46 | },
47 | {
48 | "cell_type": "markdown",
49 | "metadata": {},
50 | "source": [
51 | "### Part (a): Reading CSV Data with Numpy\n",
52 | "\n",
53 | "Open the file $\\mathtt{dataset}$\\_$\\mathtt{HW0.txt}$, containing birth biometrics as well as maternal data for a number of U.S. births, and inspect the csv formatting of the data. Load the data, without the column headers, into an numpy array. \n",
54 | "\n",
55 | "Do some preliminary explorations of the data by printing out the dimensions as well as the first three rows of the array. Finally, for each column, print out the range of the values. \n",
56 | "\n",
57 | "Prettify your output, add in some text and formatting to make sure your outputs are readable (e.g. \"36x4\" is less readable than \"array dimensions: 36x4\")."
58 | ]
59 | },
60 | {
61 | "cell_type": "code",
62 | "execution_count": null,
63 | "metadata": {
64 | "collapsed": false
65 | },
66 | "outputs": [],
67 | "source": []
68 | },
69 | {
70 | "cell_type": "markdown",
71 | "metadata": {},
72 | "source": [
73 | "### Part (b): Simple Data Statistics\n",
74 | "\n",
75 | "Compute the mean birth weight and mean femur length for the entire dataset. Now, we want to split the birth data into three groups based on the mother's age:\n",
76 | "\n",
77 | "1. Group I: ages 0-17\n",
78 | "2. Group II: ages 18-34\n",
79 | "3. Group III: ages 35-50\n",
80 | "\n",
81 | "For each maternal age group, compute the mean birth weight and mean femure length. \n",
82 | "\n",
83 | "Prettify your output.\n",
84 | "\n",
85 | "Compare the group means with each other and with the overall mean, what can you conclude?"
86 | ]
87 | },
88 | {
89 | "cell_type": "code",
90 | "execution_count": null,
91 | "metadata": {
92 | "collapsed": false
93 | },
94 | "outputs": [],
95 | "source": []
96 | },
97 | {
98 | "cell_type": "markdown",
99 | "metadata": {},
100 | "source": [
101 | "### Part (c): Simple Data Visualization\n",
102 | "\n",
103 | "Visualize the data using a 3-D scatter plot (label the axes and title your plot). How does your visual analysis compare with the stats you've computed in Part (b)?"
104 | ]
105 | },
106 | {
107 | "cell_type": "code",
108 | "execution_count": null,
109 | "metadata": {
110 | "collapsed": false,
111 | "scrolled": true
112 | },
113 | "outputs": [],
114 | "source": []
115 | },
116 | {
117 | "cell_type": "markdown",
118 | "metadata": {},
119 | "source": [
120 | "### Part (d): Simple Data Visualization (Continued)\n",
121 | "\n",
122 | "Visualize two data attributes at a time,\n",
123 | "\n",
124 | "1. maternal age against birth weight\n",
125 | "2. maternal age against femur length\n",
126 | "3. birth weight against femur length\n",
127 | "\n",
128 | "using 2-D scatter plots.\n",
129 | "\n",
130 | "Compare your visual analysis with your analysis from Part (b) and (c)."
131 | ]
132 | },
133 | {
134 | "cell_type": "code",
135 | "execution_count": null,
136 | "metadata": {
137 | "collapsed": false,
138 | "scrolled": true
139 | },
140 | "outputs": [],
141 | "source": []
142 | },
143 | {
144 | "cell_type": "markdown",
145 | "metadata": {},
146 | "source": [
147 | "## Problem 2: Processing Web Data\n",
148 | "\n",
149 | "In this problem we practice some basic web-scrapping using Beautiful Soup."
150 | ]
151 | },
152 | {
153 | "cell_type": "markdown",
154 | "metadata": {},
155 | "source": [
156 | "### Part (a): Opening and Reading Webpages\n",
157 | "\n",
158 | "Open and load the page (Kafka's The Metamorphosis) at \n",
159 | "\n",
160 | "$\\mathtt{http://www.gutenberg.org/files/5200/5200-h/5200-h.htm}$\n",
161 | "\n",
162 | "into a BeautifulSoup object. \n",
163 | "\n",
164 | "The object we obtain is a parse tree (a data structure representing all tags and relationship between tags) of the html file. To concretely visualize this object, print out the first 1000 characters of a representation of the parse tree using the $\\mathtt{prettify()}$ function."
165 | ]
166 | },
167 | {
168 | "cell_type": "code",
169 | "execution_count": null,
170 | "metadata": {
171 | "collapsed": false,
172 | "scrolled": true
173 | },
174 | "outputs": [],
175 | "source": []
176 | },
177 | {
178 | "cell_type": "markdown",
179 | "metadata": {},
180 | "source": [
181 | "### Part (b): Exploring the Parsed HTML\n",
182 | "\n",
183 | "Explore the nested data structure you obtain in Part (a) by printing out the following:\n",
184 | "\n",
185 | "1. the content of the head tag\n",
186 | "2. the string inside the head tag\n",
187 | "3. each child of the head tag\n",
188 | "2. the string inside the title tag\n",
189 | "3. the string inside the preformatted text (pre) tag\n",
190 | "4. the string inside the first paragraph (p) tag\n",
191 | "\n",
192 | "Make your output readable."
193 | ]
194 | },
195 | {
196 | "cell_type": "code",
197 | "execution_count": null,
198 | "metadata": {
199 | "collapsed": false,
200 | "scrolled": true
201 | },
202 | "outputs": [],
203 | "source": []
204 | },
205 | {
206 | "cell_type": "markdown",
207 | "metadata": {},
208 | "source": [
209 | "### Part (c): Extracting Text\n",
210 | "\n",
211 | "Now we want to extract the text of The Metamorphosis and do some simple analysis. Beautiful Soup provides a way to extract all text from a webpage via the $\\mathtt{get}$_$\\mathtt{text()}$ function. \n",
212 | "\n",
213 | "Print the first and last 1000 characters of the text returned by $\\mathtt{get}$_$\\mathtt{text()}$. Is this the content of the novela? Where is the content of The Metamorphosis stored in the BeautifulSoup object?"
214 | ]
215 | },
216 | {
217 | "cell_type": "code",
218 | "execution_count": null,
219 | "metadata": {
220 | "collapsed": false,
221 | "scrolled": true
222 | },
223 | "outputs": [],
224 | "source": []
225 | },
226 | {
227 | "cell_type": "markdown",
228 | "metadata": {},
229 | "source": [
230 | "### Part (d): Extracting Text (Continued)\n",
231 | "\n",
232 | "Using the $\\mathtt{find}$_$\\mathtt{all()}$ function, extract the text of The Metamorphosis and concatenate the result into a single string. Print out the first 1000 characters of the string as a sanity check."
233 | ]
234 | },
235 | {
236 | "cell_type": "code",
237 | "execution_count": null,
238 | "metadata": {
239 | "collapsed": false,
240 | "scrolled": false
241 | },
242 | "outputs": [],
243 | "source": []
244 | },
245 | {
246 | "cell_type": "markdown",
247 | "metadata": {},
248 | "source": [
249 | "### Part (e): Word Count\n",
250 | "\n",
251 | "Count the number of words in The Metamorphosis. Compute the average word length and plot a histogram of word lengths.\n",
252 | "\n",
253 | "You'll need to adjust the number of bins for each histogram.\n",
254 | "\n",
255 | "**Hint**: You'll need to pre-process the text in order to obtain the correct word/sentence length and count. "
256 | ]
257 | },
258 | {
259 | "cell_type": "code",
260 | "execution_count": null,
261 | "metadata": {
262 | "collapsed": false
263 | },
264 | "outputs": [],
265 | "source": []
266 | },
267 | {
268 | "cell_type": "markdown",
269 | "metadata": {},
270 | "source": [
271 | "## Problem 3: Data from Simulations\n",
272 | "\n",
273 | "In this problem we practice generating data by setting up a simulation of a simple phenomenon, a queue. \n",
274 | "\n",
275 | "Suppose we're interested in simulating a queue that forms in front of a small Bank of America branch with one teller, where the customers arrive one at a time.\n",
276 | "\n",
277 | "We want to study the queue length and customer waiting time."
278 | ]
279 | },
280 | {
281 | "cell_type": "markdown",
282 | "metadata": {},
283 | "source": [
284 | "### Part (a): Simulating Arrival and Service Time\n",
285 | "\n",
286 | "Assume that gaps between consecutive arrivals are uniformly distributed over the interval of 1 to 20 minutes (i.e. any two times between 1 minute and 6 minutes are equally likely). \n",
287 | "\n",
288 | "Assume that the service times are uniform over the interval of 5 to 15 minutes. \n",
289 | "\n",
290 | "Generate the arrival and service times for 100 customers, using the $\\mathtt{uniform()}$ function from the $\\mathtt{random}$ library."
291 | ]
292 | },
293 | {
294 | "cell_type": "code",
295 | "execution_count": null,
296 | "metadata": {
297 | "collapsed": false
298 | },
299 | "outputs": [],
300 | "source": []
301 | }
302 | ],
303 | "metadata": {
304 | "kernelspec": {
305 | "display_name": "Python 2",
306 | "language": "python",
307 | "name": "python2"
308 | },
309 | "language_info": {
310 | "codemirror_mode": {
311 | "name": "ipython",
312 | "version": 2
313 | },
314 | "file_extension": ".py",
315 | "mimetype": "text/x-python",
316 | "name": "python",
317 | "nbconvert_exporter": "python",
318 | "pygments_lexer": "ipython2",
319 | "version": "2.7.11"
320 | }
321 | },
322 | "nbformat": 4,
323 | "nbformat_minor": 0
324 | }
325 |
--------------------------------------------------------------------------------
/Lab_0/dataset_HW0.txt:
--------------------------------------------------------------------------------
1 | birth_weight,femur_length,mother_age
2 | 2.96948929693,1.97915605326,16
3 | 4.03896293829,3.55568119774,16
4 | 5.30264328067,3.38563290356,15
5 | 6.08610660864,4.49542705624,17
6 | 5.74926036287,4.01743728517,16
7 | 6.04990316617,4.37889158456,15
8 | 5.42681579298,2.8518005755,17
9 | 6.23910322964,4.64574427708,16
10 | 5.34504951547,3.20765715162,17
11 | 4.16297458362,2.20239020343,16
12 | 5.27487188389,3.15653737285,16
13 | 5.57627684263,4.42260979415,15
14 | 5.49364519455,4.10115197621,16
15 | 6.66031744698,4.32829223618,16
16 | 4.79466786551,3.79690236166,16
17 | 5.98546785855,3.59528822664,15
18 | 4.62521953969,2.89420486042,17
19 | 5.60683336452,4.04229165716,16
20 | 4.52477222455,3.98956839177,17
21 | 6.31629850002,4.34395155651,15
22 | 5.59229009761,4.29827502052,16
23 | 6.23730155087,4.32844939432,15
24 | 5.19645533325,3.17804680726,16
25 | 4.61051961684,3.02154602216,15
26 | 4.38347209422,2.78235229283,16
27 | 5.00708475862,2.07372448362,16
28 | 4.10801731672,2.02072083176,16
29 | 5.18226898598,3.58182037999,15
30 | 3.91916624802,2.60680157156,16
31 | 5.89559639974,4.4430773707,15
32 | 4.64230422711,3.75100227628,15
33 | 5.6408840374,4.19042454383,15
34 | 3.97263167416,3.20216687363,15
35 | 5.27452300904,3.4222610693,16
36 | 5.6931016669,3.99617344457,17
37 | 4.31909877015,2.79374019245,15
38 | 6.05785975536,4.92252675343,15
39 | 5.4298877004,3.73730761773,16
40 | 6.00876416155,4.19935190745,17
41 | 6.15702446875,5.05860316463,15
42 | 5.7537305811,3.85355736939,16
43 | 6.43156454829,4.32753369837,16
44 | 5.234506976,3.2652430964,16
45 | 4.68815649708,2.57351765657,16
46 | 5.85440967675,4.66187475156,15
47 | 5.79408653555,4.17928754965,15
48 | 4.69735687487,2.41510016462,15
49 | 4.92690458156,2.97150428822,15
50 | 5.87608287847,4.58111172395,17
51 | 6.5156172092,4.58522547424,15
52 | 4.30982198435,3.9549545555,15
53 | 3.00870151922,1.71153196811,15
54 | 6.23639360317,4.15015617237,16
55 | 3.51976106157,2.35805905909,16
56 | 4.67071642571,4.69818597053,15
57 | 5.69711997952,3.35244787871,15
58 | 5.28232793328,3.37107252772,15
59 | 5.92000589626,4.21593070601,15
60 | 5.02821577115,3.90795619491,15
61 | 4.65102478292,2.42549680003,16
62 | 6.030251155,5.22115730364,16
63 | 5.31153386906,2.9383833595,15
64 | 5.59615976805,2.69406920183,15
65 | 5.00588854499,2.84432523444,15
66 | 7.22908686344,4.38073731878,16
67 | 4.41803942805,2.79218990837,15
68 | 5.60783728401,4.32081817391,15
69 | 5.11194862851,3.28955715611,15
70 | 3.57776442472,2.4476161616,16
71 | 3.40936920778,1.66092222547,15
72 | 3.91184073279,3.33989479488,16
73 | 4.15174779241,3.45823164074,16
74 | 4.76707041764,3.02596217445,15
75 | 5.86040838107,4.69489162753,16
76 | 5.46156648104,3.15607270667,15
77 | 5.84045184823,4.48584306535,15
78 | 4.56164368295,3.30845010985,17
79 | 4.26101927115,2.65086087232,15
80 | 5.79426477387,3.90964162778,16
81 | 6.3428616561,4.21521795078,16
82 | 6.10260575072,3.23183432272,15
83 | 4.8401025858,3.59670258025,15
84 | 3.77718659364,2.8005621805,16
85 | 4.89533283321,3.27628935733,17
86 | 5.25537404453,3.59703577667,16
87 | 6.08521866996,3.64194319968,15
88 | 3.0792227964,0.479154166011,16
89 | 5.27169016573,3.85666443761,15
90 | 6.28070598522,4.34610262852,15
91 | 5.38804159874,3.38787623597,17
92 | 5.48501182004,3.01553795201,15
93 | 5.5724809467,3.815090109,15
94 | 5.44833589153,3.15424000505,16
95 | 2.96742562601,1.39415746273,15
96 | 4.9168436275,3.22757552156,15
97 | 4.59215380287,2.9435348597,17
98 | 4.78439200262,4.09463152288,17
99 | 4.90757329645,3.75932156171,15
100 | 6.77990481805,4.90471862636,15
101 | 4.55618616032,2.76408938659,16
102 | 6.90452979083,4.16463681885,34
103 | 8.09664229874,4.53675893259,22
104 | 8.1653733546,5.50702961531,20
105 | 5.84628435807,3.9585062749,18
106 | 6.25528630767,3.76902438863,19
107 | 6.51521980746,5.56895415767,23
108 | 6.46446156194,3.31062827031,25
109 | 6.57961596728,3.67022423309,20
110 | 7.17102440833,5.15994565819,24
111 | 4.95205275455,2.18237202006,20
112 | 7.02897488165,4.63468269353,22
113 | 5.73744595152,2.91851553699,26
114 | 6.16077315018,3.00953877884,22
115 | 5.96886394318,3.80165804342,30
116 | 6.78375899211,3.62955163463,30
117 | 6.73694721628,4.79192993885,21
118 | 6.9641044678,4.81634741536,32
119 | 6.18244262485,3.362721799,24
120 | 5.36410624068,3.11553839062,20
121 | 5.26245695775,4.01063615072,22
122 | 6.9810215324,3.80760676018,23
123 | 7.55205648444,3.91540025452,23
124 | 6.80640825669,4.53519769623,25
125 | 6.97422957166,4.44526246894,22
126 | 6.87677151019,3.65510629178,32
127 | 7.38597728909,4.89859594284,27
128 | 6.83986200607,3.47391978863,27
129 | 9.02194194628,6.52662791185,31
130 | 5.50191675341,3.693032595,31
131 | 6.66892770095,3.54682405552,23
132 | 8.04686501671,4.60277153381,33
133 | 6.97299872902,4.18659384007,33
134 | 7.08981523346,4.23606869229,19
135 | 8.24115057323,4.79866002699,24
136 | 8.00780286398,4.59800061522,34
137 | 6.74053455535,4.32716775787,24
138 | 6.38471609039,2.73829924635,31
139 | 5.88087571194,4.43964385119,18
140 | 7.17934631653,4.27069731563,23
141 | 4.67715692376,2.11599215359,29
142 | 6.27793607844,3.9588420081,34
143 | 7.81059915449,5.33973034484,19
144 | 6.49091541684,3.79211848315,24
145 | 6.87247467776,4.25281621717,19
146 | 6.83810321656,3.94867350647,31
147 | 6.3058559358,3.41184275607,31
148 | 5.25082826493,3.65707173937,26
149 | 6.02537628642,3.57015948379,34
150 | 7.77415181663,3.98798381105,25
151 | 6.80167158593,3.65704694962,24
152 | 6.7187291593,3.99942886778,20
153 | 6.10436082955,3.92495072342,18
154 | 7.05157248593,4.83604151501,19
155 | 6.56242323384,3.74331743308,18
156 | 6.50295280508,3.81533524538,32
157 | 7.66965802695,4.33890101552,32
158 | 6.83158844628,4.05041829331,25
159 | 8.06416371119,6.64873007157,27
160 | 7.2453705284,4.24236241698,26
161 | 7.10656821938,5.31016866515,22
162 | 7.15387836592,4.4558150052,34
163 | 7.16592759389,3.75252168085,27
164 | 6.36606404645,4.22184407898,18
165 | 6.68969269157,4.26536535592,26
166 | 7.18615153845,4.81883033515,22
167 | 5.43806438895,2.76787911798,31
168 | 5.80343151564,2.42039203402,21
169 | 6.66016064539,5.02748960882,29
170 | 6.19658609194,3.86631872118,32
171 | 7.27753942561,5.08306058987,18
172 | 5.38323897588,2.18842269304,23
173 | 6.92827248816,4.65599909473,27
174 | 6.65385387837,3.22697888389,27
175 | 5.96864970925,3.16961037681,32
176 | 7.70502477343,4.34740994275,29
177 | 4.73937715416,2.98958754863,23
178 | 6.99694791665,4.11915237635,20
179 | 6.84015355708,3.79775687563,18
180 | 7.57429379416,4.69545524822,33
181 | 5.70051569978,3.43459780917,22
182 | 7.19028319173,5.06815815716,26
183 | 8.3768086651,5.35960667215,33
184 | 6.19258659836,4.08926672621,23
185 | 6.93164639178,4.97197470528,27
186 | 7.26769775473,4.55301962024,18
187 | 7.18361565715,4.18556493111,34
188 | 7.49601169801,3.61577781155,27
189 | 6.84344831961,3.99288820642,34
190 | 6.25625239092,3.43832672466,30
191 | 7.75933693156,4.52047191523,22
192 | 6.17841585972,3.08479630541,21
193 | 5.85590868984,4.35732588994,20
194 | 5.63787309935,2.73015835175,30
195 | 4.60716679815,2.51606016846,33
196 | 5.47326215619,3.30451069936,21
197 | 8.00421061658,5.00455728902,20
198 | 6.49157316891,4.20442399286,28
199 | 7.76175479987,4.73993158731,34
200 | 5.57237605158,3.02657862573,22
201 | 7.23316050335,4.72301573197,32
202 | 5.99529943665,3.77576081091,29
203 | 6.48167633223,4.26153275027,32
204 | 7.01684073728,3.89166531643,28
205 | 5.72020241593,2.51073044809,26
206 | 5.84288902155,3.24065941584,19
207 | 8.96906781615,5.32507980845,28
208 | 8.57786762995,5.7515916905,24
209 | 5.88999928285,3.35240631567,21
210 | 6.83642810152,4.05163118047,18
211 | 6.46158016582,3.98178167745,26
212 | 7.15648940229,4.75975601695,25
213 | 7.56930066698,4.3545833781,18
214 | 6.58771522833,3.04575021643,30
215 | 5.63048519168,2.72957485357,18
216 | 7.74333915577,4.33547690337,19
217 | 6.04976111897,4.23741627617,18
218 | 5.19927318915,3.28361887174,19
219 | 7.45620172509,4.35103199032,27
220 | 7.81646198701,4.10935340644,33
221 | 8.20490833532,4.9091722258,32
222 | 7.52233441527,4.59902722723,24
223 | 6.07676709218,3.89387297287,30
224 | 7.49476155892,5.05068482191,22
225 | 6.28907037363,3.84672830749,27
226 | 7.18620152219,4.75176621974,22
227 | 6.46750939043,3.33048710486,18
228 | 5.55242153077,3.06639378782,22
229 | 6.50975522338,4.09867595471,18
230 | 6.46896164082,4.31161646919,20
231 | 6.4628915107,3.51832290883,22
232 | 7.39626298606,4.11183181551,24
233 | 5.63857644956,3.17454978473,24
234 | 5.74642249584,3.33047394419,34
235 | 6.04338288382,3.61800316224,32
236 | 6.1683748204,3.28749903723,24
237 | 5.48595500235,3.23150802353,32
238 | 6.09892652823,3.69058445704,20
239 | 6.84722045917,3.87164011567,21
240 | 6.78505615615,4.30066350439,34
241 | 6.73036022655,5.2101015411,30
242 | 6.15619918445,4.15651655396,21
243 | 7.16337235953,3.88652516283,32
244 | 7.952669331,4.52223858109,20
245 | 7.25882558998,4.90356974484,21
246 | 7.3879203753,3.5391773094,20
247 | 8.81801546593,5.48249956861,18
248 | 7.83319190766,4.69672283601,19
249 | 6.37379340548,3.16723290287,27
250 | 5.62793483034,3.41677681542,32
251 | 6.49805772152,3.41516349287,20
252 | 5.18410933084,3.47435497072,22
253 | 6.5828945067,3.24838292185,20
254 | 6.74854715348,3.79789921815,28
255 | 7.57794369295,4.30688005477,24
256 | 8.01164680049,4.98710705854,29
257 | 5.70847357386,3.55116786423,19
258 | 6.90272087293,4.35633363616,20
259 | 6.23415171527,3.74533045036,27
260 | 6.46159751096,3.68515704998,20
261 | 6.72594667049,3.58424406968,23
262 | 7.4350352754,4.23427316874,29
263 | 6.00279033894,2.78031062991,23
264 | 7.55053205416,4.77102915171,31
265 | 5.43408373854,3.01530293356,29
266 | 7.11081156954,4.97824049338,34
267 | 7.52416100057,4.05165890249,27
268 | 5.49488496168,3.16939537154,21
269 | 6.67848256806,3.50725257396,32
270 | 7.57054232756,5.17163359485,27
271 | 8.82632328258,5.66153621563,27
272 | 6.11511519854,2.68187500299,18
273 | 6.19744264902,3.4066117906,29
274 | 6.96160327218,3.69861786076,30
275 | 6.77582494292,4.15318553279,26
276 | 6.26105845232,3.43623240388,34
277 | 7.18762219181,5.00651835767,18
278 | 7.2016808695,4.35171939307,25
279 | 8.64429935353,6.42776484774,33
280 | 6.1689518802,4.00492233948,29
281 | 6.62500615392,3.83506515452,28
282 | 5.58259229105,3.19367405008,29
283 | 8.37825440622,5.37205979815,29
284 | 6.2302693749,4.17609222219,31
285 | 5.44951153766,2.7343658677,32
286 | 6.95505038646,3.35920737348,26
287 | 5.47084334623,2.62931669098,23
288 | 6.7918698736,3.73816096715,22
289 | 5.40580948035,2.39177579271,25
290 | 6.25728094849,3.23756655978,18
291 | 7.78340697185,4.1528868077,33
292 | 7.80508397007,5.38653741621,25
293 | 6.29918294798,3.4823811886,24
294 | 6.1592611504,3.5262153566,23
295 | 5.47945071065,2.74327278702,34
296 | 7.016332019,3.9958968915,22
297 | 6.43474469779,3.49915007218,20
298 | 8.00530076092,5.71581575587,28
299 | 6.37686510748,3.88783727152,21
300 | 6.52641538415,3.79223470922,26
301 | 5.49668516332,3.02522215966,19
302 | 7.1749625153,5.16647765539,37
303 | 6.16504167333,3.53399253807,39
304 | 6.91781842826,3.83021502617,43
305 | 6.6871922716,4.36599193003,43
306 | 5.86297047392,3.15862625402,40
307 | 5.37236678431,3.79899992838,42
308 | 6.10905619845,4.69687515156,47
309 | 6.08165948891,3.78398476724,41
310 | 7.64476615264,5.09837167958,46
311 | 6.19285704152,3.11639059508,35
312 | 5.40341877301,2.71701553102,35
313 | 4.15062643279,3.27018072461,35
314 | 6.39330268853,4.72650603616,38
315 | 5.273826499,3.49156897936,37
316 | 4.86998605567,1.95271070544,35
317 | 7.5609519846,5.10310251971,44
318 | 3.92688417915,2.19279794231,44
319 | 7.19497111046,5.00616153308,47
320 | 3.99185473915,2.62567190386,44
321 | 5.73304689787,3.81687772691,45
322 | 5.80725891751,3.79686659442,36
323 | 5.90851634948,4.21691006167,47
324 | 5.78400199316,3.9263542416,41
325 | 5.1506611534,4.17903357992,47
326 | 6.11099330998,3.77425839725,43
327 | 5.77161863825,2.84552794167,43
328 | 6.06935241585,4.47325638879,48
329 | 5.87165322252,3.66909498117,43
330 | 6.15451571821,4.6174070454,46
331 | 5.07221010244,3.30091520869,44
332 | 5.93319010064,4.39241856473,49
333 | 3.84194830435,2.00840681687,49
334 | 5.3315964172,3.7600958955,35
335 | 4.10956879423,2.54157017616,38
336 | 7.05723529884,4.39150865639,47
337 | 4.62888048906,2.69539163341,48
338 | 5.53799472595,3.61527578063,43
339 | 4.90545739268,3.09487453256,46
340 | 4.69003875826,2.37650363322,48
341 | 5.71727466616,3.6071609615,47
342 | 6.54349711877,4.29605215778,37
343 | 6.15824421967,3.93275399369,37
344 | 5.65265021568,3.23459429374,41
345 | 6.35946023815,4.40690952054,42
346 | 4.90634795163,2.84084562844,48
347 | 5.83864815977,3.55150711503,36
348 | 4.99821011056,2.47469484689,38
349 | 5.87242451574,3.11641898637,47
350 | 5.4593152161,3.63159703788,39
351 | 4.90798256286,3.5153952476,44
352 | 7.15739072185,4.7989383165,45
353 | 6.2955736487,4.23807685731,40
354 | 5.35183815869,4.04239983257,48
355 | 6.75797404463,3.93922196098,46
356 | 5.78749054509,3.94757285926,42
357 | 5.07009496777,3.75489617802,47
358 | 6.32226809092,4.69575706369,38
359 | 5.65731915894,3.66793762678,40
360 | 4.86803156601,3.36165875243,46
361 | 7.55548345964,4.67111952418,38
362 | 7.0356602561,5.23872549924,39
363 | 6.15558817629,3.59995290723,38
364 | 7.75245166716,5.61073200676,48
365 | 6.32718003393,3.45301516116,36
366 | 6.63638452774,4.11117081567,36
367 | 5.69560783485,4.97989663116,48
368 | 4.6462935416,2.51606410726,43
369 | 5.87581876054,2.76790949811,46
370 | 4.95048282096,4.0054843586,46
371 | 5.55450044679,3.38972425403,38
372 | 7.24488374215,4.76929356069,40
373 | 5.92339724686,3.30785607588,47
374 | 5.07178207396,3.42938774508,44
375 | 6.77101820773,3.61057579031,38
376 | 7.71623415489,5.02381508754,43
377 | 4.55461786225,2.33334535102,46
378 | 5.30336758779,3.15021895891,35
379 | 5.58156868407,4.19584336093,38
380 | 5.77288878558,4.49810529654,41
381 | 5.30202197384,3.43638090069,44
382 | 6.15715025859,4.3119720067,36
383 | 6.5897430316,4.30182972935,38
384 | 5.97376260038,3.92515792775,49
385 | 6.83251526432,4.34277185701,48
386 | 6.31151585444,4.09017031935,35
387 | 5.0295200418,3.87715674591,38
388 | 4.9825423462,3.99325615434,43
389 | 5.45489289266,3.09918258362,47
390 | 5.66159468184,3.81889763972,49
391 | 6.95902471706,4.75711553758,36
392 | 6.97666301716,3.69291792545,38
393 | 6.79090659579,4.86349411916,37
394 | 5.31115594284,3.32336541597,42
395 | 4.0718309981,2.53165682151,41
396 | 5.4041783279,3.96902191187,38
397 | 4.71549669275,2.97015506386,40
398 | 6.63826815044,4.64974466372,35
399 | 6.08697226551,3.6986156726,43
400 | 6.01154194053,4.17483171023,41
401 | 6.15256601088,4.81657155184,37
402 |
--------------------------------------------------------------------------------
/Lab_0/lab0_cheatsheet.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_0/lab0_cheatsheet.pdf
--------------------------------------------------------------------------------
/Lab_0/lab0_slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_0/lab0_slides.pdf
--------------------------------------------------------------------------------
/Lab_1/Data_Science_Lab1.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# CS 109A/AC 209A/STAT 121A Data Science: Lab 1 (Solutions)\n",
8 | "**Harvard University**
\n",
9 | "**Fall 2016**
\n",
10 | "**Instructors: W. Pan, P. Protopapas, K. Rader**
\n",
11 | "**Due Date: ** Tuesday, September 13th, 2016 at 11:59pm"
12 | ]
13 | },
14 | {
15 | "cell_type": "markdown",
16 | "metadata": {},
17 | "source": [
18 | "Download the `IPython` notebook as well as the data file from Vocareum and complete locally.\n",
19 | "\n",
20 | "To submit your assignment, in Vocareum, upload (using the 'Upload' button on your Jupyter Dashboard) your solution to Vocareum as a single notebook with following file name format:\n",
21 | "\n",
22 | "`last_first_CourseNumber_HW1.ipynb`\n",
23 | "\n",
24 | "where `CourseNumber` is the course in which you're enrolled (CS 109a, Stats 121a, AC 209a). Submit your assignment in Vocareum using the 'Submit' button.\n",
25 | "\n",
26 | "**Avoid running your notebook on Vocareum and avoid changing your file after submitting.**\n",
27 | "\n",
28 | "Problems on homework assignments are equally weighted. The Challenge Question is required for AC 209A students and optional for all others. Student who complete the Challenge Problem as optional extra credit will receive +0.5% towards your final grade for each correct solution. "
29 | ]
30 | },
31 | {
32 | "cell_type": "markdown",
33 | "metadata": {},
34 | "source": [
35 | "Import libraries"
36 | ]
37 | },
38 | {
39 | "cell_type": "code",
40 | "execution_count": 1,
41 | "metadata": {
42 | "collapsed": false
43 | },
44 | "outputs": [
45 | {
46 | "name": "stderr",
47 | "output_type": "stream",
48 | "text": [
49 | "//anaconda/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.\n",
50 | " warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')\n"
51 | ]
52 | }
53 | ],
54 | "source": [
55 | "import numpy as np\n",
56 | "import pandas as pd\n",
57 | "import matplotlib\n",
58 | "import matplotlib.pyplot as plt\n",
59 | "%matplotlib inline"
60 | ]
61 | },
62 | {
63 | "cell_type": "markdown",
64 | "metadata": {},
65 | "source": [
66 | "---"
67 | ]
68 | },
69 | {
70 | "cell_type": "markdown",
71 | "metadata": {},
72 | "source": [
73 | "## Problem 0: Basic Information\n",
74 | "\n",
75 | "Fill in your basic information. "
76 | ]
77 | },
78 | {
79 | "cell_type": "markdown",
80 | "metadata": {},
81 | "source": [
82 | "### Part (a): Your name"
83 | ]
84 | },
85 | {
86 | "cell_type": "markdown",
87 | "metadata": {},
88 | "source": [
89 | "[Last, First]"
90 | ]
91 | },
92 | {
93 | "cell_type": "markdown",
94 | "metadata": {},
95 | "source": [
96 | "### Part (b): Course Number"
97 | ]
98 | },
99 | {
100 | "cell_type": "markdown",
101 | "metadata": {},
102 | "source": [
103 | "[CS 109a or STATS 121a or AC 209a]"
104 | ]
105 | },
106 | {
107 | "cell_type": "markdown",
108 | "metadata": {},
109 | "source": [
110 | "---"
111 | ]
112 | },
113 | {
114 | "cell_type": "markdown",
115 | "metadata": {
116 | "collapsed": true
117 | },
118 | "source": [
119 | "## Problem 1: Basic Data Visualization, Manipulation and Analysis\n",
120 | "\n",
121 | "In this problem, we will be using some basic tools of data visualization and statistical analysis to help build our intuition for finding, describing and interpreting patterns in data. We will be working with the data contained in the file `dataset_HW1.txt`. The data in `dataset_HW1.txt` contains biometric readings for a number of diabetic patients. In this problem, we will try to detect disease subtypes within this set of patients using their biometric readings."
122 | ]
123 | },
124 | {
125 | "cell_type": "markdown",
126 | "metadata": {},
127 | "source": [
128 | "### Part (a): Understanding a Pandas Dataframe\n",
129 | "Load the data from `dataset_HW1.txt` into a pandas dataframe. Get a basic picture of the information contained in the dataframe by printing the head, the size of the dataframe, the range of values in numeric-valued columns. Store the max, min and range information as a pandas dataframe."
130 | ]
131 | },
132 | {
133 | "cell_type": "markdown",
134 | "metadata": {},
135 | "source": [
136 | "Solution:"
137 | ]
138 | },
139 | {
140 | "cell_type": "code",
141 | "execution_count": null,
142 | "metadata": {
143 | "collapsed": false
144 | },
145 | "outputs": [],
146 | "source": []
147 | },
148 | {
149 | "cell_type": "markdown",
150 | "metadata": {},
151 | "source": [
152 | "### Part (b): Descriptive Statistics\n",
153 | "Find the mean, median and standard deviation of the real-valued columns in the entire dataset. Now find the same set of descriptive statistics for each of the following subset of data:\n",
154 | "\n",
155 | "1. children (ages 3 - 17)\n",
156 | "2. adult males (ages 18 - 90)\n",
157 | "3. adult females (ages 18 - 90)\n",
158 | "\n",
159 | "Append these stats to the dataframe from part (a), containing the max, min and range. Explain what these stats say about the entire dataset as well as each of the above subsets.\n",
160 | "\n",
161 | "Give a summary of the demographics of the patients contained in the dataset, i.e. how many children, how many adults, how many adult females and how many adult males. Display these results as pie charts."
162 | ]
163 | },
164 | {
165 | "cell_type": "markdown",
166 | "metadata": {},
167 | "source": [
168 | "**Solution:**"
169 | ]
170 | },
171 | {
172 | "cell_type": "markdown",
173 | "metadata": {},
174 | "source": [
175 | "### Part (c): Data Visualization\n",
176 | "To understand how the biometric reading might help us determine diabetic subtypes, we begin with some visual analysis of the biometric data:\n",
177 | "\n",
178 | "1. plot histograms of marker 1 and marker 2 (play with different values for the bin number to find the most usefule visualization)\n",
179 | "2. plot both markers in a scatter plot, color each point according to disease subtype\n",
180 | "\n",
181 | "Do the above for each demographics within the data: children, adult men and adult women."
182 | ]
183 | },
184 | {
185 | "cell_type": "markdown",
186 | "metadata": {},
187 | "source": [
188 | "**Solution:**"
189 | ]
190 | },
191 | {
192 | "cell_type": "markdown",
193 | "metadata": {},
194 | "source": [
195 | "### Part (d): Putting it All Together\n",
196 | "\n",
197 | "Summarize and interpret the patterns in the **histograms** from Part (c), compare these patterns to each other. In particular, explain what these patterns indicate about the relationship between the biometric data (marker 1 and marker 2) and subtypes of diabetes amongst the patients.\n",
198 | "\n",
199 | "Summarize and interpret the patterns in the **scatter plots** from Part (c), compare these patterns to each other. In particular, explain what these patterns indicate about the relationship between the biometric readings (marker 1 and marker 2) and subtypes of diabetes amongst the patients.\n",
200 | "\n",
201 | "Do your analyses of the patterns in histograms and the scatter plots support or contradict each other? Is one of the two visualizations more useful than the other for anlyzing the relationship between biometric data and disease subtypes? If so which, and why?\n",
202 | "\n",
203 | "Compare the descriptive stats you computed in part (b) with the visualizations. Which aspects of the visualizations (histogram and scatter plots) does each statistic measure? \n",
204 | "\n",
205 | "Do the stats support, contradict or enhance your visual analysis of the biometric data? \n",
206 | "\n",
207 | "Finally, what can you conclude, based on your visual analysis and stats, about the relationship between biometric data and diabetic subtypes in this pool of patients?"
208 | ]
209 | },
210 | {
211 | "cell_type": "markdown",
212 | "metadata": {},
213 | "source": [
214 | "**Solution:**"
215 | ]
216 | },
217 | {
218 | "cell_type": "markdown",
219 | "metadata": {},
220 | "source": [
221 | "---"
222 | ]
223 | }
224 | ],
225 | "metadata": {
226 | "kernelspec": {
227 | "display_name": "Python 2",
228 | "language": "python",
229 | "name": "python2"
230 | },
231 | "language_info": {
232 | "codemirror_mode": {
233 | "name": "ipython",
234 | "version": 2
235 | },
236 | "file_extension": ".py",
237 | "mimetype": "text/x-python",
238 | "name": "python",
239 | "nbconvert_exporter": "python",
240 | "pygments_lexer": "ipython2",
241 | "version": "2.7.11"
242 | }
243 | },
244 | "nbformat": 4,
245 | "nbformat_minor": 0
246 | }
247 |
--------------------------------------------------------------------------------
/Lab_1/lab1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_1/lab1.pdf
--------------------------------------------------------------------------------
/Lab_2/Data_Science_Lab2.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# CS 109A/AC 209A/STAT 121A Data Science: Lab 2\n",
8 | "**Harvard University**
\n",
9 | "**Fall 2016**
\n",
10 | "**Instructors: W. Pan, P. Protopapas, K. Rader**
"
11 | ]
12 | },
13 | {
14 | "cell_type": "markdown",
15 | "metadata": {},
16 | "source": [
17 | "Import libraries"
18 | ]
19 | },
20 | {
21 | "cell_type": "code",
22 | "execution_count": 2,
23 | "metadata": {
24 | "collapsed": false
25 | },
26 | "outputs": [],
27 | "source": [
28 | "import numpy as np\n",
29 | "import pandas as pd\n",
30 | "import random\n",
31 | "import sklearn as sk\n",
32 | "from sklearn.neighbors import KNeighborsRegressor as KNN\n",
33 | "from sklearn.cross_validation import train_test_split as sk_split\n",
34 | "from sklearn.linear_model import LinearRegression as Lin_Reg\n",
35 | "import time\n",
36 | "import matplotlib\n",
37 | "import matplotlib.pyplot as plt\n",
38 | "%matplotlib inline"
39 | ]
40 | },
41 | {
42 | "cell_type": "markdown",
43 | "metadata": {},
44 | "source": [
45 | "---"
46 | ]
47 | },
48 | {
49 | "cell_type": "markdown",
50 | "metadata": {},
51 | "source": [
52 | "## Problem 2: Handling Missing Data\n",
53 | "\n",
54 | "In this problem, we will be handling the problem of datasets with missing values. Clearly, we cannot simply remove entire rows or columns that contain missing values. In this problem, we explore two different ways to fill in missing values.\n",
55 | "\n",
56 | "The datasets required for this problem is in the ``dataset`` directory. Each file in the ``dataset`` directory contains a one-dimensional data set, with the first column containing the independent variable X, and the second column containing the dependent variable Y.\n",
57 | "\n",
58 | "The files ``dataset_1_missing.txt`` to ``dataset_6_missing.txt`` contains rows that are missing their y-values, where as ``dataset_1_full.txt`` to ``dataset_6_full.txt`` contain datasets with all y-values correctly filled in.\n",
59 | " \n",
60 | "In this problem, you **may not** use ``sklearn`` or build-in ``pandas`` functions to **directly fill in missing values**. Usage of these libraries/pakcages for related tasks is fine."
61 | ]
62 | },
63 | {
64 | "cell_type": "markdown",
65 | "metadata": {},
66 | "source": [
67 | "### Part (a): Model Based Data Imputation\n",
68 | "\n",
69 | "- Describe in detail how predictive models for data (like KNN and simple linear regression) can be used to fill in missing values in a data set.\n",
70 | "\n",
71 | "\n",
72 | "- Implement your scheme. That is, write code (preferably a function ``fill`` or two functions ``fill_knn``, ``fill_lin_reg``), which takes an ``n x 2`` dataframe or array with values missing in the 2nd column and fills in these values using KNN and linear regression. \n",
73 | "\n",
74 | "\n",
75 | "- You need to, also, write code to evaluate the quality of the values you've filled in."
76 | ]
77 | },
78 | {
79 | "cell_type": "markdown",
80 | "metadata": {},
81 | "source": [
82 | "**Solution:**"
83 | ]
84 | },
85 | {
86 | "cell_type": "markdown",
87 | "metadata": {},
88 | "source": [
89 | "### Part (b): Which Model is Better?\n",
90 | "\n",
91 | "- For datasets ``dataset_1_missing.txt`` to ``dataset_6_missing.txt``, compare the result of filling in the missing values using KNN and linear regression, using both the R^2 coefficient as well as data visualization (the correct y-values are contained in ``dataset_1_full.txt`` to ``dataset_6_full.txt``). \n",
92 | "\n",
93 | "\n",
94 | "- Use your analysis to form conjectures regarding the conditions under which KNN performs better than linear regression, under which linear regression performs better than KNN and under which both perform equally (well or poorly). Explain in detail exactly what might cause each model to fail or perform well. \n",
95 | "\n",
96 | "\n",
97 | "\n",
98 | "- Using ``dataset_1_missing.txt``, explain the impact of the choice of $k$ on the performance of KNN. \n",
99 | "\n",
100 | "\n",
101 | "Use numerical analysis and data visualization to support every part of your argument."
102 | ]
103 | },
104 | {
105 | "cell_type": "markdown",
106 | "metadata": {},
107 | "source": [
108 | "**Solution:**"
109 | ]
110 | },
111 | {
112 | "cell_type": "markdown",
113 | "metadata": {},
114 | "source": [
115 | "---"
116 | ]
117 | }
118 | ],
119 | "metadata": {
120 | "kernelspec": {
121 | "display_name": "Python 2",
122 | "language": "python",
123 | "name": "python2"
124 | },
125 | "language_info": {
126 | "codemirror_mode": {
127 | "name": "ipython",
128 | "version": 2
129 | },
130 | "file_extension": ".py",
131 | "mimetype": "text/x-python",
132 | "name": "python",
133 | "nbconvert_exporter": "python",
134 | "pygments_lexer": "ipython2",
135 | "version": "2.7.11"
136 | }
137 | },
138 | "nbformat": 4,
139 | "nbformat_minor": 0
140 | }
141 |
--------------------------------------------------------------------------------
/Lab_2/dataset/dataset_2_missing.txt:
--------------------------------------------------------------------------------
1 | x,y
2 | 4.084432757565581440e-01,2.921075013690730415e-01
3 | 6.408832683573784106e-01,
4 | 6.377591425287770788e-01,
5 | 5.814256239750328348e-01,
6 | 7.727996956614244795e-01,7.879238962730836349e+00
7 | 3.509262014983655087e-01,
8 | 9.906300808530276170e-01,7.999633977136181961e+00
9 | 3.126652337309621110e-02,-1.341000481259018384e+00
10 | 6.391663602184829429e-01,7.557090547629770505e+00
11 | 6.056843505923921178e-01,6.987967894402332902e+00
12 | 3.029646445948808164e-01,-3.242724930152256491e-01
13 | 5.726782694603094193e-01,5.721378053831365662e+00
14 | 6.750996379704191641e-01,
15 | 8.945201976253471798e-01,
16 | 4.032121539113004971e-01,-1.008124287496547922e+00
17 | 9.409202186222735964e-01,7.032745323351644373e+00
18 | 6.409609156059121737e-01,
19 | 2.289579235472847252e-01,
20 | 9.615612222313846269e-01,9.034591649933014779e+00
21 | 6.064674602245241353e-01,6.637890763901551416e+00
22 | 4.668228193424336370e-01,7.586374138977722836e-01
23 | 3.539355574349495326e-01,
24 | 1.205004052684746085e-01,-8.301858890208455577e-01
25 | 6.756780294982975832e-01,
26 | 9.818767334440606787e-01,
27 | 8.182777526640880872e-01,
28 | 6.844701129827301944e-02,
29 | 4.116122068080652063e-02,
30 | 1.660770537834144189e-01,
31 | 6.464703214234377437e-01,6.411075332992669296e+00
32 | 8.026344855856226701e-02,-1.276446818877121192e+00
33 | 5.301335593706872906e-01,5.677485800444967090e+00
34 | 6.400222241391586575e-01,1.004435273881092172e+01
35 | 1.453356115608842591e-01,-1.499938214238126122e+00
36 | 3.206047376178177144e-01,
37 | 7.491553121952503336e-01,7.764674860393322220e+00
38 | 7.775972181056123311e-02,-2.154094367051643921e+00
39 | 6.846735752004038389e-01,
40 | 9.885201394995302149e-01,9.175082084065380172e+00
41 | 6.460715792354774223e-01,
42 | 1.852549182059523014e-01,5.684540493256045046e-01
43 | 8.503151129155291921e-01,
44 | 1.908117608674686494e-02,-4.684866478928224609e-01
45 | 7.490984910220981341e-01,
46 | 2.076779669870290057e-01,-1.326027168913220589e+00
47 | 6.771058514824166430e-01,4.614152691853093735e+00
48 | 2.314483015286233902e-01,
49 | 1.154968490369977507e-01,-1.725017647644823349e+00
50 | 7.217947308994558941e-01,
51 | 8.852000980152728848e-01,8.430319672561749300e+00
52 | 7.229610639560368757e-02,5.031265488196523528e-01
53 | 5.587901868132060246e-01,8.943423328770665037e+00
54 | 2.195720800700213804e-01,8.479833698364913630e-03
55 | 1.877819377230536269e-01,-1.025942855623611649e+00
56 | 6.316367886140341614e-01,6.796887485434518261e+00
57 | 6.758723540442779232e-01,9.054977601044360114e+00
58 | 7.301631370002485966e-01,
59 | 3.077181362970825562e-01,6.181807565173051966e-01
60 | 1.308606081747558658e-01,-1.090762186169288439e+00
61 | 5.751380184627642445e-01,
62 | 5.593488593469457815e-01,7.520821964087573974e+00
63 | 5.564823767532977028e-01,
64 | 7.747562704151511603e-01,
65 | 6.863463744798082855e-01,6.350126349390714964e+00
66 | 5.225406972150619112e-01,6.088853134979748560e+00
67 | 3.966294034976314276e-01,2.522283200162522832e-02
68 | 2.577303468285361276e-01,-1.603913054799464888e+00
69 | 7.464858177880919765e-01,9.738553044370593881e+00
70 | 4.922472886665926195e-01,1.807066251427306813e+00
71 | 7.411529280771221861e-01,6.593327797637357435e+00
72 | 9.621433872872710014e-01,
73 | 1.790201480204137718e-01,-1.162149076951036086e+00
74 | 2.255369997052611986e-01,-3.310867753452555462e-01
75 | 3.613091198221205502e-01,-2.106461298561153050e-01
76 | 1.158510391236691195e-01,
77 | 5.545023893521283664e-01,5.318518298987354065e+00
78 | 9.942881781079515591e-02,3.954146131983837797e-02
79 | 3.610609723645097358e-02,
80 | 3.128993576821830214e-01,-3.955708608250549929e-01
81 | 1.458554923816254290e-01,
82 | 5.940946452461428606e-01,
83 | 2.317279588183694949e-01,9.533521189458857847e-01
84 | 5.916416800797027475e-01,5.838014906688250960e+00
85 | 5.089202336743690047e-01,7.299161622834542840e+00
86 | 6.697795904052582516e-01,
87 | 8.615324062549686301e-01,
88 | 3.099346986238636914e-01,-3.607720374207179503e-02
89 | 3.626007990746473730e-01,-3.856396704288034272e-02
90 | 2.386226826387838340e-02,-1.398571538668669678e+00
91 | 7.271178059204846944e-01,
92 | 3.435404742901883024e-01,-2.206102735837041084e+00
93 | 2.126346799936743581e-01,
94 | 9.689994079998521803e-01,
95 | 9.334511138645648076e-01,
96 | 6.374480931416561802e-01,5.906345032914090964e+00
97 | 7.610116547701247791e-01,
98 | 6.647039212671835839e-01,6.438115396631771681e+00
99 | 6.613963513278902084e-01,8.850135976936396531e+00
100 | 2.086318267525723025e-01,-3.185852679353375905e-01
101 | 3.037697509041541455e-01,-8.003374646084888688e-01
102 | 4.736688448373759242e-01,-1.941228408138278905e+00
103 | 7.006403048178684312e-01,8.973159747798300501e+00
104 | 7.255484009779540333e-01,7.642104424098485005e+00
105 | 2.864019976498266562e-01,1.750496107398410661e+00
106 | 2.253473630200611977e-01,-6.882481736538332839e-01
107 | 9.432937657376139207e-02,-1.637095251390084050e+00
108 | 2.789673033067431307e-01,
109 | 2.737930402932394758e-01,
110 | 9.974582637560930332e-01,
111 | 4.558835854337532911e-01,1.228977660985010267e+00
112 | 2.020371232337977441e-01,-7.554622400081258959e-01
113 | 6.519407056377002352e-02,-3.194134867817489454e+00
114 | 5.636493187774047620e-01,6.864087837880790133e+00
115 | 8.056148674047481917e-01,6.845888340215594781e+00
116 | 6.847113445225604389e-01,8.277747752481676713e+00
117 | 7.896963298018881972e-01,6.914197851926926042e+00
118 | 6.428604178358623411e-01,7.782221273679635232e+00
119 | 5.296649804812543216e-01,5.966980679128482734e+00
120 | 6.281808084300577466e-01,5.778899142939717848e+00
121 | 5.933534360737342528e-01,5.378905789525401104e+00
122 | 1.452751503102085451e-01,3.886261159234760676e-02
123 | 9.531143159227968287e-01,7.119423816496762925e+00
124 | 4.945751290707025571e-01,
125 | 2.076940744915852788e-01,2.069899547970344145e-02
126 | 7.967156682710393456e-01,7.139253427936625762e+00
127 | 8.742007719332488547e-01,9.524806046590580166e+00
128 | 3.417230066096323959e-01,
129 | 1.112301200986712812e-01,-1.774384832324125583e+00
130 | 7.552126612928005134e-01,
131 | 5.341762276353494432e-01,8.235964896174946759e+00
132 | 4.148516503669626987e-01,-4.141483734565865049e-02
133 | 8.901096287354165471e-01,8.127391173331615093e+00
134 | 3.683873501878147660e-01,6.192791925810858800e-02
135 | 7.058489442037904071e-01,6.977247244791469960e+00
136 | 5.190559439900617189e-01,6.296481559444015552e+00
137 | 6.309767080736295997e-01,6.503662109812609948e+00
138 | 3.634980376735257313e-01,1.281454670209107638e+00
139 | 4.078200432656977625e-01,2.681123735383148521e-01
140 | 8.187156270730140406e-01,
141 | 9.995157357171798873e-01,8.659467541987384109e+00
142 | 1.709864575058956948e-01,-1.440958318200441957e+00
143 | 4.315105081883865434e-01,2.169054021596128479e-02
144 | 8.766191959254744370e-01,
145 | 4.689084912107854830e-02,-3.452090272062325216e+00
146 | 9.843503693421973288e-02,
147 | 3.867254025348614288e-01,
148 | 1.383638645004403589e-02,-3.728798609878058112e+00
149 | 2.021366385580224412e-01,
150 | 5.667184102005885515e-01,6.200209022331197417e+00
151 | 3.238907009209128773e-01,
152 | 6.384828154790322952e-02,
153 | 1.527038684753709852e-01,-1.541000290111411264e+00
154 | 1.267678678679665660e-01,-1.938847646380756018e+00
155 | 8.453926986651510989e-01,7.897579706197949356e+00
156 | 7.399425395676917372e-01,6.441764289755601780e+00
157 | 3.568840763405831673e-01,-3.135765433855040474e+00
158 | 7.015979367224706165e-01,7.739036451872966182e+00
159 | 4.590041628626397863e-01,1.908291891022064313e+00
160 | 5.170639105831222881e-01,7.783810792462714012e+00
161 | 3.575831377000904254e-02,
162 | 6.720206690574687114e-01,8.162869283721425617e+00
163 | 4.332868588174683122e-01,-6.048744516113302438e-01
164 | 4.061967220632705100e-01,-9.599738577431877751e-01
165 | 2.839381795298344668e-01,-2.542411024635666816e+00
166 | 8.538376155986129312e-01,8.332610734538583586e+00
167 | 2.161246126316703764e-01,
168 | 3.672346687583486480e-01,1.003240648852130601e+00
169 | 2.572626823875648894e-01,
170 | 4.507156801807802315e-01,
171 | 3.869588435612685284e-01,4.438449251680198770e-01
172 | 2.876326899911295643e-01,7.831145701887582966e-01
173 | 2.498509284251237972e-02,-2.525003923251583959e+00
174 | 3.071822157817134524e-01,
175 | 4.947240856927156427e-01,1.179437368806652398e+00
176 | 9.757447836371027083e-01,1.056601686178536781e+01
177 | 6.434945351186481810e-01,
178 | 9.717967869298576034e-01,9.269259102055183774e+00
179 | 7.971342348292153046e-01,
180 | 9.151607266793194695e-01,6.901323320977409637e+00
181 | 9.549842073215276672e-01,9.426314636595112262e+00
182 | 6.101931701322822477e-01,6.363232915231902709e+00
183 | 1.297114781262870276e-01,-5.306365211042805008e-01
184 | 6.301914829453245659e-01,8.085743717515672557e+00
185 | 4.045700687472960633e-01,6.627952638229306359e-02
186 | 6.570658028064684242e-01,7.686347729449797939e+00
187 | 4.475504938462896432e-01,-8.903688436874763745e-01
188 | 5.705267002073061144e-01,6.577647550816736022e+00
189 | 3.745080881809865758e-01,-2.981009786703880948e-01
190 | 5.510969476833879055e-01,6.789012206133035576e+00
191 | 2.956726685081485506e-01,-5.039721433559654074e-01
192 | 2.999478340039558599e-01,-5.225865475959112771e-01
193 | 9.355243159457404811e-02,-1.704484227493749504e+00
194 | 5.584966831731569270e-01,
195 | 9.115151657765073745e-01,
196 | 8.600253262297830048e-01,8.732016022359307073e+00
197 | 1.276681415327356461e-01,-3.568045828067780256e+00
198 | 5.110108711395138226e-01,6.754461197508302206e+00
199 | 8.812116036439056055e-01,
200 | 3.559244989455622177e-01,-3.951639287608919027e-01
201 | 9.741176259068210497e-01,
202 | 9.810371639977908398e-01,
203 | 4.454975309083795132e-01,4.855100107473830917e-02
204 | 1.910740433864613896e-01,
205 | 8.034058611942176409e-01,
206 | 1.332783155316731305e-01,6.711998420899831785e-01
207 | 1.724849758978292957e-01,-1.500506055587037979e+00
208 | 9.451373611789551932e-01,1.025576211137402538e+01
209 | 1.732195912826938189e-01,-1.626951308986162026e+00
210 | 2.806872319000147664e-01,1.064553420435261133e+00
211 | 2.518465778352846351e-01,-1.491404950763662196e+00
212 | 9.692461818036045562e-01,1.112816434327648452e+01
213 | 9.829864856519187066e-01,7.811245569348045592e+00
214 | 5.888601830620118216e-01,7.695848877706453983e+00
215 | 2.207381635138798703e-01,
216 | 1.356461719094231855e-01,5.287019490421598356e-01
217 | 4.207669551777182271e-02,
218 | 5.740159315805021256e-01,7.241852488482585670e+00
219 | 2.790102954193847129e-01,-8.070803254624951961e-01
220 | 6.757004646024445949e-01,8.709419514968022469e+00
221 | 6.050918339642925581e-01,
222 | 4.599861996171242806e-01,-9.465277463928187807e-01
223 | 2.440479635944289294e-01,-2.451495543189357917e+00
224 | 2.983656563309806664e-01,-3.968878180522912302e-01
225 | 8.732464191298917600e-01,1.039450394373228193e+01
226 | 9.533300893061286141e-01,8.459792209398631968e+00
227 | 1.393140748002541507e-02,-1.658487434900157487e+00
228 | 5.828646044839007612e-01,5.766004727368167160e+00
229 | 2.824613480053814740e-01,-1.675550368514604038e+00
230 | 2.726411415501054369e-01,-3.297520449098700901e-01
231 | 9.728391150419697375e-01,7.527778855170794259e+00
232 | 3.277322605610318851e-01,2.115545140801606827e-01
233 | 4.085379062188427834e-01,-4.866191372224726308e-02
234 | 3.233658868150783849e-01,
235 | 3.140846704366522246e-01,-4.861647783885065799e-01
236 | 4.098975865527172413e-01,-1.217736409688876975e+00
237 | 7.603609320892036338e-01,7.956355819876281821e+00
238 | 3.877886389728329997e-01,-8.234032564840578772e-01
239 | 6.707363690232355236e-01,6.579568262613953777e+00
240 | 5.428676279460359355e-01,
241 | 4.062504110946119074e-01,
242 | 5.800123342467583543e-01,
243 | 5.150463571491735726e-01,7.364228904424455990e+00
244 | 2.659579408441334891e-01,
245 | 7.403535295796950244e-01,7.433922059584155306e+00
246 | 5.533897256574888956e-01,
247 | 5.016496036847529760e-01,6.643206141118493946e+00
248 | 5.087182165397021727e-01,6.099602303852286411e+00
249 | 6.873371544180615356e-01,
250 | 1.524297113909302004e-01,-1.500211345437023613e+00
251 | 2.382455338192722705e-01,-1.373350306110421304e+00
252 | 1.083341817601448653e-01,-2.662109542767887582e+00
253 | 3.076200114518657935e-01,-8.821091257074549219e-01
254 | 2.455872451170237891e-02,
255 | 3.489626919228994151e-02,
256 | 3.928704007458102554e-01,
257 | 7.141318172782123996e-01,8.027022326226701310e+00
258 | 8.517579267151645928e-01,8.513066905792111783e+00
259 | 7.419843912091561577e-01,
260 | 1.567978027143341890e-01,
261 | 3.527948802418319207e-01,4.781287977964887581e-01
262 | 7.265897035690549455e-02,-3.252436844888128231e+00
263 | 7.228946927483248519e-01,8.887396824050728839e+00
264 | 9.316686474471411739e-01,
265 | 9.703449731541048395e-01,
266 | 9.116486996175812152e-01,9.369981310129496421e+00
267 | 8.640845961769354489e-01,
268 | 4.269869856660357677e-01,
269 | 7.785132160922269007e-01,
270 | 3.515144578073174930e-01,-1.840514850254112211e+00
271 | 2.095317144547550470e-01,
272 | 8.366720865312454736e-01,
273 | 5.577001024264902629e-01,
274 | 6.151597434229806316e-01,8.395868045888912334e+00
275 | 6.837910183262129182e-01,6.488602497935493929e+00
276 | 9.406617660763643141e-01,
277 | 8.646285724094231462e-01,
278 | 2.039495142091090063e-01,
279 | 9.039050588543127152e-01,9.264802352240739225e+00
280 | 5.941994973126548674e-01,7.514402438942466844e+00
281 | 2.704824352677128729e-01,-1.036152623083915536e+00
282 | 9.916820566949436921e-01,9.070164142048586342e+00
283 | 4.646240389000280135e-01,-3.612880609478112959e-01
284 | 5.626057089845211134e-01,6.432709718846281177e+00
285 | 8.349091984035729164e-01,
286 | 8.438226461111084653e-01,6.635215380764587501e+00
287 | 6.799715768087079004e-01,6.990836244643454656e+00
288 | 3.832772960518607830e-01,
289 | 6.568539956022196868e-01,8.353112288372013694e+00
290 | 9.663658692229054603e-01,1.066950785767026844e+01
291 | 6.408438469840869178e-01,
292 | 7.501783029821602611e-01,
293 | 4.185146978184954847e-01,-1.486543525312942648e+00
294 | 1.551068348975342959e-01,
295 | 9.266699791256468588e-01,8.425262008041240591e+00
296 | 8.874869572611541191e-01,1.102319342428502580e+01
297 | 1.807531207023038711e-03,-4.006825920675325392e+00
298 | 2.720154684727648098e-01,
299 | 9.320271307375268544e-01,9.322715372446074511e+00
300 | 6.594040442907467270e-01,5.810840642021963376e+00
301 | 5.644567038524672675e-03,-3.005115106372197697e+00
302 | 6.396265454008015494e-01,7.849250517071771682e+00
303 | 8.775631211379131269e-01,6.645148792915012592e+00
304 | 7.103563003173978263e-01,
305 | 8.836129928312799198e-01,7.514328641243970708e+00
306 | 5.619241960966521177e-01,
307 | 2.735606135073228584e-01,8.598665533533342842e-01
308 | 9.163372438041130774e-01,7.895844111842638569e+00
309 | 2.886618138517769161e-01,-5.944007072066685993e-01
310 | 9.842791556195379377e-01,8.004768652946363972e+00
311 | 2.559733370921920548e-01,3.674741156003871190e-01
312 | 9.078370396851380697e-01,7.785925957413281751e+00
313 | 7.781949434709393154e-01,7.377506115566854206e+00
314 | 7.524215765060405792e-01,
315 | 9.042924978154498472e-01,8.780080774623492346e+00
316 | 7.267290504224636072e-01,7.637931804875783826e+00
317 | 2.449649871810011259e-01,-9.770345996799703059e-01
318 | 3.154218046315907520e-01,-1.317048583175364662e+00
319 | 7.323866428858020194e-01,7.509833982993004753e+00
320 | 9.855434909369229501e-01,9.581190870862275943e+00
321 | 6.357504415681511922e-01,6.995336049093301867e+00
322 | 2.927739776558024865e-01,-4.116753771087187097e-01
323 | 3.014493967007810804e-01,-1.801002232091341249e+00
324 | 9.381461548858183175e-02,-1.379063586652963469e+00
325 | 2.197515177632247685e-01,-8.923271855423302590e-01
326 | 8.063096518424258674e-01,8.062270207076398520e+00
327 | 8.893925005954417262e-02,-1.770733029607430176e+00
328 | 7.951781083388520521e-02,
329 | 2.175999259125849239e-01,
330 | 2.386333106755708089e-01,
331 | 8.440506497473352354e-01,9.544911256432245139e+00
332 | 3.063234267186912829e-01,4.687141731851451887e-01
333 | 8.183567818394585913e-01,8.348439226587156980e+00
334 | 4.603880088087480837e-01,2.353370205364883283e+00
335 | 3.690523056890815390e-02,-2.355219545667346370e-01
336 | 6.815481697659864224e-01,
337 | 8.935283339507915645e-01,7.180750831448724725e+00
338 | 1.762980026677107848e-02,
339 | 1.596676145487255782e-01,-2.360030047001345554e+00
340 | 7.446577176207459514e-01,
341 | 2.049458995802042605e-01,-2.780924561765401926e+00
342 | 8.556286127485079884e-01,6.551961042317939743e+00
343 | 6.706157734737578924e-01,
344 | 3.884271793289706398e-01,1.885603678246220438e+00
345 | 9.464044348547921981e-01,
346 | 4.900360162972684508e-01,8.200950895366645454e-01
347 | 7.520297857483342341e-01,8.285956002963581923e+00
348 | 4.992088278743126439e-01,
349 | 3.898564456274790091e-01,2.832312352098176333e-02
350 | 8.324900592957548140e-01,8.078748972088142466e+00
351 | 3.207685589327520237e-01,-4.706474433592462425e-01
352 | 7.681208170237868726e-01,9.121650051963763772e+00
353 | 4.055759859163716730e-01,
354 | 2.675273171258807370e-02,-2.937596471425723443e+00
355 | 8.071293624070692285e-01,6.332844336472443381e+00
356 | 8.558755516922549322e-01,9.293804556188922206e+00
357 | 7.520741695916948188e-01,7.756721680911956796e+00
358 | 9.097618176239894439e-01,8.906041659827675261e+00
359 | 9.206216955260257961e-01,8.675010864404230304e+00
360 | 9.499621287556712090e-01,7.955360737084139267e+00
361 | 9.883525855079183797e-01,
362 | 8.669725786251333277e-01,
363 | 8.184945157634283541e-01,6.838451757315030299e+00
364 | 5.442711325474792750e-01,
365 | 1.002086039603594658e-01,-1.441771211008056053e-01
366 | 9.818386580985540846e-01,8.750689841384971857e+00
367 | 2.457293880754338744e-01,-8.197009791288070168e-01
368 | 9.490429951947025877e-01,7.227790638053930294e+00
369 | 6.889448911402968889e-01,7.328747495426123137e+00
370 | 5.285370889053818688e-01,6.326984215112874566e+00
371 | 3.557876243707938091e-01,-1.280503456907381654e+00
372 | 7.956087250857633020e-01,7.035583375728404754e+00
373 | 5.807747500148057185e-01,6.660016572923633582e+00
374 | 9.659384388565865898e-01,9.484578421504636481e+00
375 | 7.203130151250547453e-01,6.873499109718940403e+00
376 | 2.742357670282854487e-01,
377 | 6.768181561104471555e-01,
378 | 1.922244040350115091e-01,-8.249285584409937755e-02
379 | 2.812680630564501350e-03,
380 | 4.374072146486107648e-02,-1.910968127272520301e+00
381 | 3.239393729909604280e-01,
382 | 7.128340346720449805e-01,
383 | 6.332526905170721143e-01,
384 | 2.597610002841320709e-01,3.601249756526749835e-01
385 | 3.054388255832850563e-01,
386 | 7.949088448315221322e-01,
387 | 4.457516568448868233e-01,8.498945420152641539e-01
388 | 8.901295588673793224e-01,9.249777590926472115e+00
389 | 8.171608972945606508e-01,
390 | 2.732983109002474764e-01,-2.264056792283053898e+00
391 | 3.627122503642981055e-01,-4.744292860995482641e-01
392 | 4.976939595195680743e-01,-9.480272007073464735e-02
393 | 2.341923725172128101e-01,
394 | 6.594375031586409142e-01,
395 | 6.615674834881016819e-01,7.328232614524514688e+00
396 | 8.762321273816485734e-01,
397 | 2.669753718156021582e-01,-2.115954614085491237e+00
398 | 1.374750108850328889e-01,-2.333745920673733210e+00
399 | 2.783376007398871144e-01,-6.627973558798165854e-01
400 | 3.665105873900711408e-01,
401 | 8.327354262952537667e-01,8.605200323994928624e+00
402 | 4.588316138286414603e-01,-1.305801513852551388e-01
403 | 4.495828688777323556e-01,
404 | 6.603660092698391271e-01,6.879115682756069106e+00
405 | 7.798493647522390937e-01,7.428974172126622477e+00
406 | 2.773396271498905774e-01,-3.007913084919406899e-01
407 | 9.941524470549178982e-01,9.503059153213081700e+00
408 | 8.431538207135119700e-01,8.686190822263194278e+00
409 | 9.639705533567185514e-01,9.608220096387899645e+00
410 | 5.000702680992508142e-01,6.206799212853802317e+00
411 | 4.269488964175142121e-01,-4.196265500132327908e-01
412 | 1.157457589403193543e-01,-2.486284684601050898e+00
413 | 9.053852282467699242e-01,
414 | 2.247173982471204479e-01,-1.153390477408264836e+00
415 | 4.439010637880140830e-01,-7.926397283565034257e-02
416 | 7.334135895394133797e-02,
417 | 3.929957329771985863e-01,4.843921976783276406e-01
418 | 2.792504673855537023e-01,1.072197532623677674e-01
419 | 4.023017476031345296e-01,1.535214167740963642e+00
420 | 4.673143242996383728e-01,-3.696784781410968890e-01
421 | 5.788413416140472112e-01,
422 | 9.361586017186050990e-01,8.727454078725852327e+00
423 | 6.869936697676308768e-01,
424 | 9.758607099692749864e-01,8.686876217277292866e+00
425 | 6.260220471685280508e-01,7.541551122162719167e+00
426 | 7.937885605307199999e-01,8.577536634179036668e+00
427 | 4.484160261944738490e-01,
428 | 9.620915249350869836e-01,
429 | 4.943023530573554813e-01,
430 | 3.445388137388334382e-01,6.909031023562945961e-01
431 | 9.914851340445673955e-04,
432 | 4.514244146156403126e-01,2.864729623314876683e+00
433 | 1.885705405314413996e-01,
434 | 5.274731634120908286e-01,5.333570483951122654e+00
435 | 3.998742707890353687e-01,-7.314010077035359991e-01
436 | 7.993225873270148885e-02,
437 | 9.576716934197024855e-01,8.085762603622224987e+00
438 | 9.662899629375665267e-02,-3.124146598415997733e+00
439 | 2.354898950905380817e-01,
440 | 2.602894237972188662e-01,
441 | 5.502651718312190354e-02,
442 | 7.206722280601575159e-01,
443 | 6.202173594854681893e-01,8.127585878048645185e+00
444 | 8.677406037584128873e-01,9.091445700432259969e+00
445 | 7.827646848404816726e-01,
446 | 8.589149851271815628e-01,6.932864665684683736e+00
447 | 2.312827973653722724e-01,
448 | 9.309528528000740044e-01,9.338874085504439648e+00
449 | 5.462244115683696499e-01,6.667150563533862595e+00
450 | 4.687692093012715278e-01,1.455015465147569298e+00
451 | 1.849268126793350842e-01,1.356244702437483518e-01
452 | 9.103595052978508129e-01,8.942203144654875757e+00
453 | 6.617702904914012363e-01,8.250035676869881485e+00
454 | 5.881039880519906005e-01,
455 | 9.292137754022222751e-01,7.380521339247805734e+00
456 | 4.127751734012941043e-01,1.922122121730351907e-01
457 | 9.163243054293759293e-01,1.046048551962279127e+01
458 | 4.796674460914257532e-01,4.197471469503288866e-01
459 | 8.869464877771355837e-01,
460 | 2.996484250097085633e-01,
461 | 7.681252008863306280e-01,
462 | 1.016051151866642632e-01,-2.225338587517693423e+00
463 | 5.260530592040590925e-01,6.957873200583362561e+00
464 | 9.010909647979848947e-01,9.752659218013235431e+00
465 | 4.132763861741610700e-01,-1.470718225432685600e-01
466 | 5.740460129082592955e-01,6.607645210375532763e+00
467 | 9.164905995538806804e-01,8.519346801426019411e+00
468 | 9.335681378658828855e-01,
469 | 6.447004933293680740e-01,8.186955500221039017e+00
470 | 3.494987579833238600e-01,2.960405332716855575e-01
471 | 1.172659277795694566e-01,
472 | 4.568197327174028377e-01,
473 | 9.472585670364901400e-01,7.948800893707718807e+00
474 | 3.922769906467373779e-01,-1.164377994844652431e+00
475 | 3.609446627945711583e-03,-1.547287985884002293e+00
476 | 9.231821001167334062e-01,
477 | 8.229385017004899883e-01,8.794467326790277539e+00
478 | 1.249045813491722612e-01,-5.568190382834075081e-01
479 | 6.157996130121577982e-01,
480 | 2.534985716428642677e-01,-1.622761220801526072e+00
481 | 2.014583188978646966e-02,-1.514689861650639680e+00
482 | 1.904080777704260097e-01,-2.348382589613283500e+00
483 | 8.373957036015303723e-01,
484 | 5.488799600011725621e-01,6.855604016016084046e+00
485 | 2.670845433812796266e-03,-1.583769920628087302e+00
486 | 8.060151137819805411e-01,
487 | 2.524725003328739392e-01,2.220464801851540493e-01
488 | 2.145779514485245398e-01,
489 | 7.882587314825663105e-01,
490 | 3.706847788752698492e-02,
491 | 6.630042626672826289e-01,7.748026550038000337e+00
492 | 7.874865941029907113e-02,
493 | 5.486056508376419005e-01,7.175548182418678422e+00
494 | 2.650434185653349761e-01,
495 | 1.966279230370713282e-01,-1.015273505984872759e-01
496 | 3.528292525476180996e-01,
497 | 1.806507491285413991e-01,-8.354934573509327222e-01
498 | 4.445777943833216783e-01,
499 | 9.184623522426578202e-01,7.978327869022975527e+00
500 | 3.549552037427199380e-01,
501 | 2.057022927786299471e-01,
502 |
--------------------------------------------------------------------------------
/Lab_2/dataset/dataset_3_missing.txt:
--------------------------------------------------------------------------------
1 | x,y
2 | 1.213844258821866751e-01,
3 | 1.600691059890533285e-01,5.373957038143709397e+00
4 | 4.705780782725654809e-03,
5 | 5.714591126306377555e-01,1.026139417172837121e+01
6 | 2.595223179662548008e-01,
7 | 3.917233318647246332e-01,
8 | 9.034888341513254151e-01,
9 | 7.037237888784897422e-01,-1.846264589971179149e+00
10 | 5.647122468754647295e-01,-1.786784598225565901e+00
11 | 2.097281269163555617e-01,
12 | 5.626272825629939911e-01,
13 | 9.756328537085734443e-01,-5.161062089636869743e-01
14 | 4.529630091154683846e-01,-4.436644810847893972e-01
15 | 5.782247188368292434e-01,
16 | 5.260981538724736062e-01,7.624219127168629484e+00
17 | 8.629295712596692924e-01,
18 | 7.377393238255933738e-01,
19 | 8.652978460445356346e-01,
20 | 3.974442940305178418e-01,
21 | 5.768277811994390047e-01,9.068984089178004027e+00
22 | 3.258949074090855547e-04,
23 | 2.205378391438848062e-01,5.916128553536735168e+00
24 | 5.654904670218308116e-02,
25 | 6.825688684844235521e-01,-6.273426455777517674e-01
26 | 7.030015793998574125e-01,-6.563157760571609600e-01
27 | 4.147697676872795780e-01,7.005385472482497100e+00
28 | 7.051770143843172356e-02,-4.194711151903550039e+00
29 | 6.729146792699428614e-01,1.061655834406136023e+01
30 | 2.192326449424087942e-01,8.192391988409696069e+00
31 | 1.500473140857818688e-01,
32 | 1.710458925830463661e-01,-1.313946356241692648e+00
33 | 2.285359056273850165e-02,-3.159143464082396768e+00
34 | 7.187052382320530119e-01,8.365776140058986954e+00
35 | 1.824553313038190794e-01,7.080058069254982378e+00
36 | 6.609234411777904494e-01,
37 | 9.862333000449536868e-01,1.197323064324589836e+01
38 | 1.059007072071087574e-01,
39 | 1.180259357901783934e-01,-3.341900978456251892e+00
40 | 1.747747415941812710e-01,
41 | 8.138525491380137478e-01,1.008693681816927068e+01
42 | 2.614058759962412104e-02,5.885681776998670678e+00
43 | 5.268934531236670882e-01,1.012357339368164943e+01
44 | 6.381221801179202124e-01,7.257468219954484212e+00
45 | 6.391993574938970024e-01,9.176021853318772514e+00
46 | 2.140176203793767717e-01,7.425285062282944715e+00
47 | 9.203775094997181938e-01,
48 | 6.871121516279474761e-01,
49 | 5.762429248720375430e-01,
50 | 3.038743262104607323e-01,
51 | 8.808871808450314811e-01,1.004445546894091557e+01
52 | 4.628348345232403682e-01,8.466363741696481426e+00
53 | 4.853030041595187694e-01,8.675275981345500043e+00
54 | 6.262806825948806777e-01,9.518911472961157472e+00
55 | 7.722929591106292291e-01,1.165299360804737816e+01
56 | 1.440460397583255281e-01,7.435377600637607109e+00
57 | 9.017692543092173940e-01,
58 | 8.827280554339385077e-01,1.070141474465835607e+01
59 | 2.558317371011989971e-01,5.894971555206446112e+00
60 | 2.923439403271652637e-01,7.505784696696286673e+00
61 | 4.456930185032014213e-01,-3.357826696221999363e-01
62 | 3.122589693212238782e-01,6.313944962217940216e+00
63 | 2.044067384303445145e-01,8.148737697736329721e+00
64 | 3.548494766730702077e-01,
65 | 9.812946635118259264e-01,1.026301984687260571e+01
66 | 6.312323503930062918e-01,
67 | 1.807656884915587181e-01,-1.048815127158439386e+00
68 | 1.044616957698948356e-01,7.244404481478341040e+00
69 | 7.613312744131041088e-01,9.023081783076111861e+00
70 | 1.817646170122992899e-01,
71 | 2.182561423685367430e-01,
72 | 4.802151177183995312e-01,
73 | 1.860694370758729788e-01,
74 | 7.643228633787672033e-01,9.785123754744358138e+00
75 | 1.779185848657359736e-01,-4.192326101969487517e+00
76 | 5.674938765354540227e-01,9.851438530020789841e+00
77 | 8.800987957555130858e-01,1.147223985243271471e+01
78 | 5.624919906549245008e-01,
79 | 7.687984945494888978e-01,3.339974256084854431e-02
80 | 3.918717240650682054e-02,5.666472783163875704e+00
81 | 8.860072481465913752e-01,9.019182677503469137e+00
82 | 9.670382927501384174e-01,
83 | 5.368644512254504564e-01,9.001940176384939818e+00
84 | 5.699740559650545713e-01,9.465614705847992028e+00
85 | 3.400549244743488186e-01,7.418096874889885228e+00
86 | 7.658640372525480355e-01,8.164166116183483979e+00
87 | 2.044771856558081913e-01,5.166883065001830921e+00
88 | 2.102961397597435944e-01,-2.450511166274151442e+00
89 | 1.524086009412006781e-02,-5.045299752602800503e+00
90 | 8.864216438841552304e-01,
91 | 2.221129954889830005e-01,5.844925395477263308e+00
92 | 9.893036413001321527e-01,1.624864191421846904e+00
93 | 6.013254226448072615e-01,
94 | 3.622237683163784805e-01,7.293530967069218995e+00
95 | 2.453832932092805397e-01,8.568532076620011040e+00
96 | 1.776004873021290731e-01,4.587089369345044965e+00
97 | 9.240380273285317969e-01,
98 | 1.106333488070055937e-01,4.057884311353118889e+00
99 | 6.168080789240382167e-01,
100 | 2.024321201330158138e-01,
101 | 1.826456629920655272e-01,
102 | 1.528020300660407615e-01,9.152532568427163895e+00
103 | 4.932477292510351052e-02,
104 | 5.825947863435194662e-01,
105 | 9.490474827751638198e-01,
106 | 6.860697865121634376e-02,7.219001100574759633e+00
107 | 4.794182521900082206e-01,
108 | 1.430533814671551829e-01,6.167730457295613533e+00
109 | 6.339609095390483784e-01,9.914483029845007067e+00
110 | 1.404297765229715056e-01,4.925616823167759506e+00
111 | 2.656201539516622745e-03,
112 | 7.859424034000421777e-01,1.117752601257852874e+01
113 | 3.255124292638629235e-01,
114 | 9.466298079652996078e-01,-1.470004310641765954e-01
115 | 1.582840432335701486e-01,
116 | 6.239500110237407027e-01,9.512298762789043849e+00
117 | 5.932043801405424421e-01,
118 | 2.883750988723746689e-01,-3.596407929944951842e+00
119 | 4.254449959851319685e-01,8.508295931162635384e+00
120 | 6.820732253456556204e-01,1.073338409995949405e+01
121 | 9.020468588251758790e-01,
122 | 8.008339700379374371e-02,-3.155985397289786221e+00
123 | 9.177847078161328609e-01,8.602472992249975192e+00
124 | 8.011077767486149970e-01,
125 | 5.236665300423483105e-01,
126 | 3.176048987020050340e-01,-2.943427888687784932e+00
127 | 6.491448106158711484e-01,8.886064735824625416e+00
128 | 7.508611386284469447e-01,
129 | 7.684839995907458698e-01,-9.127872958109648494e-01
130 | 8.273725620420450122e-01,1.042841558310869665e+01
131 | 4.883369667928976199e-01,-2.843509630096073160e+00
132 | 1.820010743944565634e-01,5.730916018462669292e+00
133 | 8.379662271166816723e-01,2.450534670941948434e-01
134 | 7.299230199390506213e-01,1.013821893324249501e+01
135 | 5.070018422457371887e-01,
136 | 1.887206756216053272e-01,6.699789139281202566e+00
137 | 8.190526859944036175e-03,
138 | 2.665209197384762474e-01,7.562003872545643546e+00
139 | 3.168824333778331725e-01,9.852732477352647678e+00
140 | 6.491811236008149244e-02,8.420703463218865537e+00
141 | 5.315796679788795664e-01,
142 | 8.940866644100035066e-01,9.576031250702726538e+00
143 | 6.719605394078808080e-01,
144 | 4.916952691746164783e-01,
145 | 6.390846539502675894e-01,8.748975852988392532e+00
146 | 2.193469623630872611e-01,7.237447058972056979e+00
147 | 7.538456200778356209e-01,
148 | 2.409374683511579240e-01,
149 | 2.919898842292818486e-01,
150 | 3.013082290474640157e-01,7.292104067756866037e+00
151 | 5.220390333498148294e-01,
152 | 2.180192500176559856e-01,
153 | 3.017185995418031341e-01,5.722354212918517646e+00
154 | 7.986878857788733965e-01,1.047102301477517372e+01
155 | 8.180891477836428338e-01,-4.513675828718781702e-01
156 | 3.299248178408711318e-01,-8.671901471003757855e-01
157 | 7.177512237463715694e-01,-1.832643817361103267e+00
158 | 6.224954444302961409e-01,-1.526232934561922328e+00
159 | 1.398615640289027073e-01,-2.658631617052470197e+00
160 | 3.097132904794911434e-01,6.795348519250833164e+00
161 | 6.806846060836436729e-01,
162 | 2.339816221172491550e-01,-2.538753533584638955e+00
163 | 4.706142417452339188e-01,
164 | 5.944781113100650050e-02,5.258383056657173427e+00
165 | 6.351202461210533334e-01,
166 | 7.069627465930767851e-01,7.629979267322807068e+00
167 | 5.945752178614482908e-01,9.533812693069078747e+00
168 | 6.480022117218493527e-01,-1.028903477066715588e+00
169 | 6.343946587774395018e-01,3.583891567150661039e-01
170 | 7.794547492957536461e-01,1.015489668329144735e+01
171 | 2.418452179271923796e-02,
172 | 8.532801691497784446e-01,
173 | 3.356194273805268580e-02,5.975797507626501748e+00
174 | 5.079446985042944673e-01,-9.097392248597189202e-01
175 | 7.523033605576702199e-01,9.635018423182366121e+00
176 | 2.921732986726213177e-01,
177 | 1.369958035435956401e-01,7.657559816410621778e+00
178 | 9.841999053960310828e-01,
179 | 9.524384945722301765e-01,1.098880422417769509e+01
180 | 2.207947092611352025e-01,
181 | 8.880868180590222316e-01,
182 | 6.160152609167953708e-01,-1.347049926181393076e+00
183 | 6.811746286252875482e-01,1.067187418943898436e+01
184 | 6.459739012675267400e-01,8.608763339839427431e+00
185 | 9.246237836864374948e-01,1.021541575200338059e+01
186 | 3.452007280404325584e-01,6.044430959118704649e+00
187 | 2.803088917156487669e-01,7.668997347661004937e+00
188 | 6.895562720570936888e-01,
189 | 4.651609901935163105e-01,
190 | 7.110565396350575496e-01,-9.802920804245829345e-02
191 | 1.888721289331299902e-01,6.138403381771700751e+00
192 | 2.874904758851516418e-01,-1.180843619254390742e+00
193 | 9.174109516987555279e-01,
194 | 5.470147780150267369e-01,9.831760381109369007e-01
195 | 6.240213430348230395e-01,-2.314212886167211991e+00
196 | 3.645067908303223359e-01,
197 | 2.129752131238481505e-01,
198 | 8.083683160252118638e-01,1.021976809368271688e+01
199 | 9.851319612345049714e-01,-5.693897692539513500e-01
200 | 2.528642846488592388e-01,-3.280009034486043085e+00
201 | 8.164489410262436575e-01,
202 | 1.871690767948863687e-02,5.212654836966770233e+00
203 | 7.204300655944329002e-02,-3.831383133095439320e+00
204 | 1.476788614084357798e-01,5.331835995700266118e+00
205 | 2.333607318502773920e-01,-2.481447804588886807e+00
206 | 5.011218616843625684e-01,-1.896989412514633155e+00
207 | 9.368930099700562009e-01,4.107706950305320959e-01
208 | 7.158777398652396151e-01,8.639182289802176840e+00
209 | 1.367043140321545502e-01,
210 | 8.248734326607820577e-02,6.401020216299817989e+00
211 | 5.114073550092601561e-01,-2.388896252058255953e+00
212 | 8.943660757008353723e-01,1.474465624538825459e+00
213 | 7.226872611506551802e-01,9.250854151765455669e+00
214 | 8.929060875863943370e-01,1.073797858895436264e+01
215 | 5.579154236048800009e-01,7.646498451062406332e+00
216 | 1.738605011368060671e-01,6.811086568021185172e+00
217 | 6.124053448926394250e-01,9.444191666683760644e+00
218 | 4.725255703660239393e-01,-1.607792285058696979e+00
219 | 1.943224390260762657e-01,8.023060043826495402e+00
220 | 3.501975636394250024e-01,-2.891132475871475815e+00
221 | 2.800368786353382156e-01,5.677399491091477124e+00
222 | 7.451448872427085535e-01,
223 | 8.447290067078828679e-01,9.820670933769156008e+00
224 | 1.310698158062835184e-01,-3.154713261366399291e+00
225 | 1.518821003121929580e-01,-4.779210443334068970e+00
226 | 2.401746097962239590e-01,-3.662994422755888824e+00
227 | 5.554574677605508271e-01,8.044091077517681043e+00
228 | 2.403338204582277093e-01,5.131395314678663055e+00
229 | 6.738096414598313544e-01,
230 | 5.618640897913995680e-01,
231 | 4.989603941807505549e-01,
232 | 3.547020807684697630e-01,8.473778010889706280e+00
233 | 4.272605402843778766e-01,7.503471439751058902e+00
234 | 7.422609969963611665e-02,7.648704654551378823e+00
235 | 5.236783100180166795e-01,
236 | 7.075802624048408429e-01,8.736981086833939258e+00
237 | 5.676573756379327262e-01,9.797088920076491902e+00
238 | 1.672724893362353971e-01,3.931794410569311893e+00
239 | 2.635463104586602823e-01,
240 | 1.551301585012498929e-02,8.026622526158909920e+00
241 | 6.911439228324681716e-01,
242 | 4.776293612116767617e-01,-1.570564321687182296e+00
243 | 7.492467537576957826e-01,1.001075447978564270e+01
244 | 5.779465121890445811e-01,1.050457964539987898e+01
245 | 6.011911874023713187e-01,
246 | 1.541851841464055850e-01,7.429023336421677115e+00
247 | 3.522320846371893577e-01,7.256559797726782612e+00
248 | 8.399462408924878165e-01,-1.692864218631351392e-01
249 | 6.739001059323328491e-01,8.050993721629666311e+00
250 | 3.439437847089905631e-01,
251 | 8.471571144491215621e-01,
252 | 7.665353981825795415e-02,6.341392628006783383e+00
253 | 9.936866253660022741e-01,1.189795095031174554e+01
254 | 5.688152967249726633e-02,-4.518192077652702920e+00
255 | 1.497485581610384919e-01,-3.297649929512609379e+00
256 | 5.901802393300620286e-01,-2.587277833782210656e+00
257 | 4.070272155027822025e-01,
258 | 6.422686674218236469e-01,
259 | 3.922618633772588792e-01,7.128638720178374300e+00
260 | 8.038747495865128379e-01,1.082463760499353356e+01
261 | 4.976874752957008985e-01,9.314913874234315827e+00
262 | 2.718190331165363238e-01,6.675208592744400704e+00
263 | 2.004718469283449656e-01,-9.680580967665286529e-01
264 | 3.541671142116771254e-01,
265 | 6.478686906672959100e-02,5.818205971409046384e+00
266 | 9.892385990868929335e-01,
267 | 2.161241443737732526e-01,7.266746866501620161e+00
268 | 1.239276506229560759e-01,-3.083394202988606114e+00
269 | 6.453341765602584879e-01,1.133416447001166993e+01
270 | 7.534474819441604465e-01,8.737153741837083487e+00
271 | 1.377837797523508989e-01,-2.322477120609997225e+00
272 | 3.580412534526589141e-02,6.749787511664283812e+00
273 | 1.687546905186401158e-01,-3.828198453345898145e+00
274 | 7.709215170415117946e-02,8.656753480411859769e+00
275 | 4.765523669359729153e-01,
276 | 1.350646659290027918e-01,6.019255602167408625e+00
277 | 7.011529133383759271e-01,
278 | 5.880290687296472196e-01,9.402915067153935880e+00
279 | 2.417193183712122995e-01,8.505253424753808744e+00
280 | 8.689506306431088456e-01,1.155271358249052582e+00
281 | 4.030517237485859994e-01,
282 | 1.233740811951826721e-01,5.698297448781499241e+00
283 | 4.318965676761221673e-02,
284 | 1.994691798236036817e-01,7.303127442155201265e+00
285 | 9.618787137540585341e-02,
286 | 7.384731921037931412e-01,
287 | 3.244532719912063268e-01,
288 | 8.034705652649508645e-01,1.200183176435904642e+01
289 | 2.250819072809393528e-01,-2.968755826092375649e+00
290 | 5.656984321845637265e-01,9.946829475781967744e+00
291 | 9.015261644886057857e-01,9.992600814073956172e+00
292 | 6.977333691474584265e-01,-8.486802461412246146e-01
293 | 7.337796339550253233e-01,9.451240045398433764e+00
294 | 3.077843227526870784e-01,6.667295648122689045e+00
295 | 6.729974031695450387e-01,1.011408216301798824e+01
296 | 4.960490678596494174e-01,7.993710532127555446e+00
297 | 2.395358189298925078e-01,7.612561881707564204e+00
298 | 2.296736472850429145e-01,6.241005056479874469e+00
299 | 6.316947606826254225e-01,
300 | 8.776643639337002867e-01,
301 | 2.909108979655986582e-01,9.897161394211670071e+00
302 | 6.672591515346129043e-01,
303 | 9.720844215756907492e-02,-3.490802869206080850e+00
304 | 3.688779657383221000e-01,6.360842590292902443e+00
305 | 5.751350567902940858e-01,8.594125634514435674e+00
306 | 6.586981985529020145e-01,8.229430463780671445e+00
307 | 3.401485044401252322e-01,-3.256667695781412686e+00
308 | 1.006214324866974152e-01,
309 | 4.526869718811726839e-01,7.437083208770184584e+00
310 | 8.634303085015522239e-01,
311 | 5.835910293122160697e-01,-3.339072411199812684e-01
312 | 8.388314075260673297e-01,9.192513020367368171e+00
313 | 5.920497263032672430e-01,-2.812348363370285043e-01
314 | 7.083870508463938620e-01,
315 | 1.854818197068389685e-01,
316 | 1.469489523021770827e-01,
317 | 7.909274830867329964e-02,
318 | 1.303470620137900937e-01,7.250832006060115908e+00
319 | 7.812410089569622462e-01,9.723957006030586214e+00
320 | 1.791173243336575682e-01,
321 | 6.430100053601096599e-01,9.311087661141865368e+00
322 | 8.496673583801936935e-01,2.265240685659142272e-01
323 | 1.319506415979261327e-01,
324 | 8.053208194117639218e-01,1.028912849755661441e+01
325 | 6.770134312618225625e-02,
326 | 5.189117267136020839e-01,
327 | 5.182946810129039905e-01,8.717977259739791762e+00
328 | 4.654212092028828796e-01,
329 | 3.654466601589182462e-01,6.495918862362529467e+00
330 | 5.028986072561805187e-01,8.088762400103721717e+00
331 | 2.774456470212225412e-01,-6.157849443655511124e+00
332 | 7.072352411019406926e-01,-1.396892530006978994e+00
333 | 1.142352726173468946e-01,-3.260184013960345517e+00
334 | 2.252617504486610356e-01,-4.344402901656508220e+00
335 | 4.367650819052890654e-01,
336 | 7.866112865697800771e-01,
337 | 9.371588102289221123e-01,9.464759351763150974e+00
338 | 1.852566047138134442e-01,7.634494598096781104e+00
339 | 7.122031436862706899e-01,-6.129378567259280430e-01
340 | 5.899894122043281008e-01,-1.212511827106071305e+00
341 | 3.804619806023623596e-02,
342 | 2.168327096347733018e-02,
343 | 6.218865131241987365e-01,
344 | 2.836375517821105863e-01,-2.417585793642832215e+00
345 | 8.532351499408438178e-01,1.016431365583701485e+01
346 | 2.246567813696186411e-01,
347 | 8.905111270463696993e-01,9.851640761224315312e+00
348 | 1.723291908664543737e-01,-3.432295696587981837e+00
349 | 2.314794820560437394e-01,-3.905853259696706825e+00
350 | 9.780354618616473594e-01,1.089027364739186510e+01
351 | 5.629493450367885066e-01,8.790587003802432520e-01
352 | 5.614388025541814375e-01,
353 | 6.864012344963631440e-01,
354 | 4.050942479191254053e-01,7.991041525727107242e+00
355 | 3.245316596303832180e-01,6.464786266077937604e+00
356 | 3.051952723659087097e-01,
357 | 4.015168928078793886e-02,4.974842809386291975e+00
358 | 3.556862768078128401e-02,-4.007210958731525885e+00
359 | 2.675936331400328161e-01,
360 | 4.388249847244645174e-01,-1.570086724626537755e+00
361 | 4.300171218587900412e-01,-1.814268494622139904e+00
362 | 2.573416966854880084e-01,6.491175163205251231e+00
363 | 1.116583099761462305e-01,6.844542512001462242e+00
364 | 8.083669954549997927e-01,
365 | 4.936812673147720210e-01,9.225124639187093578e+00
366 | 8.757102052387281121e-01,-4.282222618405659986e-01
367 | 7.167300140897456817e-01,9.524716603413430960e+00
368 | 4.590399927823451964e-01,8.695450284501720972e+00
369 | 2.754414447539133004e-02,
370 | 1.032708777668054356e-01,-3.201256770869741253e+00
371 | 2.676338578448345107e-02,8.191883757837890911e+00
372 | 9.560549245252584205e-01,1.124198060736340565e+01
373 | 1.647308540568849233e-01,-4.072963062025796610e+00
374 | 2.653609377966666960e-01,
375 | 6.090950740049724255e-01,
376 | 7.098198161500204328e-01,1.030137052745530291e+01
377 | 2.508158421334250043e-02,
378 | 4.637589757092727138e-01,
379 | 6.295541848234569304e-01,9.294963615284636660e+00
380 | 4.794219499841756438e-02,6.623883409290811208e+00
381 | 2.502264253357862067e-01,8.166414037296842565e+00
382 | 5.719563136698219141e-01,-2.051932809775290689e+00
383 | 3.955756035729479647e-01,8.481948916450875231e+00
384 | 1.696747307999033616e-01,7.396811364589883198e+00
385 | 4.785737958168785333e-01,
386 | 7.285626993990513833e-01,1.013157274847561595e+01
387 | 9.283610708907545916e-01,
388 | 2.726939536795678354e-01,
389 | 8.656139926086111602e-01,
390 | 8.282256031214330072e-01,3.288469615632987342e-01
391 | 2.243648266041511352e-01,
392 | 7.922831050175104250e-01,1.040204676977204912e+01
393 | 9.530804457436492516e-02,-3.424365075836133254e+00
394 | 6.334327387619693717e-01,8.344715760352414691e+00
395 | 7.463343752716505852e-01,1.046185042714341762e+01
396 | 2.784319450349618252e-01,7.794805252196310263e+00
397 | 4.956765695717332276e-01,8.752198630890557496e+00
398 | 4.762899077886281196e-01,-1.889850070487116618e+00
399 | 9.904906322912739869e-01,1.412706573176583547e+01
400 | 9.220101652521759394e-01,1.119188821851177451e+01
401 | 5.070185486114121565e-01,9.205698714366096880e+00
402 | 4.840583566915179770e-01,-1.710416063725792135e+00
403 | 5.110525618179854179e-01,7.021289141120696797e+00
404 | 8.676537923195645208e-01,1.165796661906150611e+00
405 | 3.072897866564389124e-01,
406 | 5.926859661392516188e-01,-1.250430859780271575e-01
407 | 6.312198833558547717e-01,
408 | 7.511975099924304011e-01,
409 | 5.946545867694528198e-01,-1.592829100961823841e+00
410 | 4.803652241751127372e-01,-1.635431591172963550e+00
411 | 6.155041642743727115e-01,9.075471270846181326e+00
412 | 3.657348402332137871e-01,7.205038011533175357e+00
413 | 3.216257327482018313e-01,7.198365702741936545e+00
414 | 3.038646476742471458e-01,-5.031421133234408316e+00
415 | 7.953425214953683264e-01,9.360192253823894859e+00
416 | 5.164185104319085617e-02,6.590653410298664028e+00
417 | 3.894867121108341879e-01,1.052662875081107074e+01
418 | 8.759345358033446827e-01,
419 | 2.730443777315999521e-01,
420 | 6.985185051891221741e-01,
421 | 5.378020041895126280e-01,-1.462496516361669663e+00
422 | 8.980633670761054566e-01,
423 | 8.525639208296001970e-01,1.083708007848235511e+01
424 | 6.595789373554250545e-01,
425 | 8.943468020746038194e-01,
426 | 3.686638110130696644e-01,7.355532616126344791e+00
427 | 3.320163506227025163e-02,-4.907949871349387649e+00
428 | 6.073752700676565697e-01,
429 | 7.417753251522337665e-01,8.975475074720343116e+00
430 | 8.007153489046595629e-01,6.124667988508791794e-01
431 | 4.626827153991273089e-01,
432 | 8.139899223532134354e-01,-1.397477265172824445e+00
433 | 4.955081892728565585e-01,
434 | 3.186650999697635545e-01,-2.008531073255933386e+00
435 | 9.888166955545740766e-02,-4.205959048176562298e+00
436 | 2.323115249569437379e-01,7.022597394619074507e+00
437 | 9.626507554290414381e-01,1.095345245646441512e+01
438 | 6.715943364127571202e-01,9.287035464051417222e+00
439 | 6.754840093177620908e-01,9.631474791615325159e+00
440 | 5.102818674858753401e-01,8.784933529910027517e+00
441 | 5.150530333299307983e-01,8.524731207708734715e+00
442 | 4.070753891090198584e-01,-5.832961791988225286e+00
443 | 1.798711861694983760e-01,6.676594734607055770e+00
444 | 7.314405590329388085e-01,-2.705666119301050720e+00
445 | 2.745878579532967656e-02,
446 | 3.564542807117235812e-01,-3.115288583529397304e+00
447 | 2.021724738893129203e-01,6.342091043580014187e+00
448 | 2.504240521335846514e-01,7.308923404731748619e+00
449 | 8.316726320824479046e-01,4.003788476869019064e-02
450 | 5.241034767426977492e-01,-1.286011734900553094e+00
451 | 8.632364951665366659e-01,9.782537102302416798e+00
452 | 6.859924913599724228e-02,5.761812740994742832e+00
453 | 1.859823509314684209e-01,
454 | 6.956037332438855803e-01,
455 | 8.078787179907875871e-01,
456 | 3.709639344113024872e-01,8.048885019998985868e+00
457 | 8.044042308625108939e-01,-6.856324402357749648e-01
458 | 5.233974918195616333e-02,
459 | 9.597171801995222351e-01,8.952279198528263038e+00
460 | 8.856863075167311639e-01,1.111170835744944618e+01
461 | 5.152270607051507856e-01,
462 | 5.225537511862761164e-01,9.270416471761818045e+00
463 | 4.340946788999981987e-01,7.338786122132208156e+00
464 | 4.267980734014462652e-01,7.697987498568199527e+00
465 | 9.490370088297869211e-01,1.173531058463316512e+01
466 | 7.515096920575388140e-01,
467 | 2.308072233656084382e-01,
468 | 4.073294518184331636e-01,9.312041442801099578e+00
469 | 3.720327176479309994e-01,
470 | 9.972248394934891680e-01,1.198836662134318409e+01
471 | 9.939004943343117127e-01,6.303919511613225168e-01
472 | 4.119659086398002046e-01,
473 | 7.589056821335574687e-01,
474 | 9.052802561585988617e-01,
475 | 6.964613309424632082e-01,
476 | 4.462048064044124018e-01,8.365491940113034985e+00
477 | 7.214707584509427729e-01,9.650240862532033503e+00
478 | 8.238114330479456848e-01,
479 | 3.128347751804635424e-01,
480 | 3.643366925900296538e-01,-2.190077211294282566e+00
481 | 1.259015570554300467e-02,5.675646280622903106e+00
482 | 3.264078866677915247e-01,
483 | 2.503858175517656992e-01,7.576494682325618513e+00
484 | 6.680558809938608178e-02,
485 | 4.939521096009447110e-01,
486 | 2.213165321580864431e-01,-1.774740370326868710e+00
487 | 8.718092821571571394e-01,2.347123773713626349e-01
488 | 3.112982351595668939e-01,
489 | 8.842221534228398294e-01,
490 | 6.541243640058475028e-01,
491 | 2.545434962167920645e-01,7.320820378524921956e+00
492 | 8.353537203247861642e-01,-1.063608676024065502e+00
493 | 7.030442801047358525e-01,9.511801534438983907e+00
494 | 9.593810620341158835e-02,7.088998916397587280e+00
495 | 2.242793627108129462e-01,7.539637718771514230e+00
496 | 5.100638853890383517e-01,7.511941704177090173e+00
497 | 5.800904524026004871e-01,
498 | 3.625184168968729193e-01,
499 | 7.850295393163166935e-01,9.084265459375007623e+00
500 | 7.646906073558963346e-01,1.076500303958427907e+01
501 | 2.974292257453484689e-01,-7.139178355080844085e-02
502 |
--------------------------------------------------------------------------------
/Lab_2/dataset/dataset_4_full.txt:
--------------------------------------------------------------------------------
1 | x,y
2 | 1.635299999999999948e-02,9.132500000000000062e-01
3 | 7.275700000000000500e-01,3.688600000000000212e-01
4 | 6.277000000000000357e-01,1.407700000000000062e-01
5 | 8.319999999999999618e-01,2.498499999999999888e-01
6 | 1.639200000000000101e-01,1.224699999999999900e+00
7 | 9.827000000000000179e-01,2.722800000000000220e-01
8 | 8.082500000000000240e-01,2.758499999999999841e-01
9 | 6.302799999999999514e-01,3.185600000000000098e-01
10 | 7.236299999999999955e-01,7.496400000000000285e-02
11 | 2.426500000000000046e-01,9.880700000000000038e-01
12 | 6.945099999999999607e-01,1.939800000000000135e-01
13 | 6.074899999999999745e-01,5.935300000000000020e-01
14 | 1.274300000000000085e-02,6.914099999999999691e-01
15 | 9.765200000000000546e-01,2.364100000000000090e-01
16 | 9.132900000000000462e-01,1.079800000000000065e-01
17 | 4.799599999999999977e-01,7.735600000000000254e-01
18 | 6.095199999999999507e-01,3.156200000000000117e-01
19 | 3.016199999999999992e-01,9.202799999999999869e-01
20 | 7.625199999999999756e-01,9.160899999999999599e-02
21 | 3.322599999999999998e-01,7.429299999999999793e-01
22 | 2.432600000000000040e-01,1.087199999999999944e+00
23 | 3.826100000000000056e-01,7.592900000000000205e-01
24 | 5.897199999999999664e-02,9.479899999999999993e-01
25 | 5.920100000000000362e-01,3.933599999999999874e-01
26 | 2.707899999999999752e-01,8.171399999999999775e-01
27 | 1.428000000000000103e-01,1.087299999999999933e+00
28 | 6.501299999999999857e-01,2.551399999999999779e-01
29 | 9.194200000000000150e-01,2.101000000000000090e-01
30 | 9.242299999999999960e-01,2.216700000000000059e-01
31 | 3.260700000000000265e-01,8.585599999999999898e-01
32 | 9.311599999999999877e-01,3.125800000000000245e-01
33 | 4.203899999999999859e-01,6.679199999999999582e-01
34 | 5.889799999999999480e-01,3.559499999999999886e-01
35 | 2.192999999999999949e-01,1.165200000000000014e+00
36 | 9.821900000000000075e-01,3.695399999999999796e-01
37 | 9.801800000000000512e-01,2.518699999999999828e-01
38 | 2.426099999999999923e-01,1.023200000000000109e+00
39 | 7.615699999999999692e-01,2.893800000000000261e-01
40 | 4.026300000000000018e-02,9.309899999999999842e-01
41 | 5.768499999999999739e-01,2.831899999999999973e-01
42 | 7.008299999999999530e-01,2.690000000000000169e-01
43 | 5.301799999999999846e-01,4.121000000000000218e-01
44 | 4.897599999999999731e-01,6.409799999999999942e-01
45 | 2.394399999999999862e-01,1.020000000000000018e+00
46 | 3.801499999999999879e-01,8.233399999999999608e-01
47 | 2.148700000000000054e-01,1.085099999999999953e+00
48 | 5.733800000000000008e-01,4.214300000000000268e-01
49 | 9.769400000000000306e-01,4.892699999999999827e-01
50 | 1.379499999999999893e-01,8.428499999999999881e-01
51 | 1.087000000000000050e-01,1.001900000000000013e+00
52 | 5.995000000000000329e-01,2.868499999999999939e-01
53 | 4.663499999999999868e-01,5.097599999999999909e-01
54 | 9.072799999999999754e-01,8.987299999999999456e-02
55 | 6.884900000000000464e-01,1.395000000000000129e-01
56 | 1.618599999999999900e-02,8.071199999999999486e-01
57 | 1.841599999999999904e-01,1.130800000000000027e+00
58 | 7.980099999999999971e-01,-8.472999999999999629e-03
59 | 8.908199999999999452e-01,1.320500000000000007e-01
60 | 2.855599999999999805e-01,9.491100000000000092e-01
61 | 7.987499999999999600e-01,1.733699999999999963e-01
62 | 8.761900000000000244e-01,3.040200000000000125e-01
63 | 1.892099999999999893e-01,9.575900000000000523e-01
64 | 4.003700000000000037e-01,7.986100000000000421e-01
65 | 6.988799999999999457e-01,2.948200000000000265e-01
66 | 6.508199999999999541e-01,1.186200000000000032e-01
67 | 1.341199999999999892e-01,1.256899999999999906e+00
68 | 7.149999999999999689e-01,2.027400000000000035e-01
69 | 9.013299999999999645e-01,2.118899999999999950e-01
70 | 6.467500000000000471e-01,2.403299999999999881e-01
71 | 1.473099999999999965e-01,1.099699999999999900e+00
72 | 3.206300000000000261e-01,9.785500000000000309e-01
73 | 4.832099999999999729e-01,5.850699999999999790e-01
74 | 7.887199999999999767e-01,1.237199999999999966e-01
75 | 9.593300000000000161e-01,4.681500000000000106e-01
76 | 4.773000000000000020e-01,7.636800000000000255e-01
77 | 5.064699999999999758e-01,6.962699999999999445e-01
78 | 5.812000000000000499e-01,3.717400000000000149e-01
79 | 7.570700000000000207e-01,3.031599999999999920e-02
80 | 7.826800000000000423e-01,2.152699999999999891e-01
81 | 2.237899999999999889e-01,1.054300000000000015e+00
82 | 1.575000000000000011e-01,1.045400000000000107e+00
83 | 5.862500000000000488e-01,4.279000000000000026e-01
84 | 5.190399999999999459e-01,6.183999999999999497e-01
85 | 8.477000000000000091e-01,7.920900000000000163e-02
86 | 5.579600000000000115e-01,4.545799999999999841e-01
87 | 2.564799999999999858e-01,9.348400000000000043e-01
88 | 5.237800000000000233e-01,6.382100000000000550e-01
89 | 2.546100000000000030e-01,1.226799999999999891e+00
90 | 1.405599999999999905e-01,1.059399999999999897e+00
91 | 2.991699999999999915e-02,7.803600000000000536e-01
92 | 6.913799999999999946e-01,1.923499999999999932e-01
93 | 5.725400000000000489e-01,4.625099999999999767e-01
94 | 5.295800000000000507e-01,6.036399999999999544e-01
95 | 1.944599999999999940e-01,9.289199999999999680e-01
96 | 4.531700000000000172e-01,6.905200000000000227e-01
97 | 2.094300000000000050e-01,8.733300000000000507e-01
98 | 4.773000000000000020e-01,6.164300000000000335e-01
99 | 7.245300000000000074e-01,3.006699999999999928e-01
100 | 3.887000000000000177e-02,7.928300000000000347e-01
101 | 6.284300000000000441e-01,3.040499999999999869e-01
102 |
--------------------------------------------------------------------------------
/Lab_2/dataset/dataset_4_missing.txt:
--------------------------------------------------------------------------------
1 | x,y
2 | 1.635299999999999948e-02,9.132500000000000062e-01
3 | 7.275700000000000500e-01,3.688600000000000212e-01
4 | 6.277000000000000357e-01,1.407700000000000062e-01
5 | 8.319999999999999618e-01,2.498499999999999888e-01
6 | 1.639200000000000101e-01,1.224699999999999900e+00
7 | 9.827000000000000179e-01,2.722800000000000220e-01
8 | 8.082500000000000240e-01,2.758499999999999841e-01
9 | 6.302799999999999514e-01,3.185600000000000098e-01
10 | 7.236299999999999955e-01,
11 | 2.426500000000000046e-01,9.880700000000000038e-01
12 | 6.945099999999999607e-01,1.939800000000000135e-01
13 | 6.074899999999999745e-01,
14 | 1.274300000000000085e-02,6.914099999999999691e-01
15 | 9.765200000000000546e-01,2.364100000000000090e-01
16 | 9.132900000000000462e-01,
17 | 4.799599999999999977e-01,
18 | 6.095199999999999507e-01,3.156200000000000117e-01
19 | 3.016199999999999992e-01,9.202799999999999869e-01
20 | 7.625199999999999756e-01,
21 | 3.322599999999999998e-01,
22 | 2.432600000000000040e-01,1.087199999999999944e+00
23 | 3.826100000000000056e-01,
24 | 5.897199999999999664e-02,9.479899999999999993e-01
25 | 5.920100000000000362e-01,3.933599999999999874e-01
26 | 2.707899999999999752e-01,8.171399999999999775e-01
27 | 1.428000000000000103e-01,1.087299999999999933e+00
28 | 6.501299999999999857e-01,2.551399999999999779e-01
29 | 9.194200000000000150e-01,2.101000000000000090e-01
30 | 9.242299999999999960e-01,2.216700000000000059e-01
31 | 3.260700000000000265e-01,8.585599999999999898e-01
32 | 9.311599999999999877e-01,
33 | 4.203899999999999859e-01,
34 | 5.889799999999999480e-01,3.559499999999999886e-01
35 | 2.192999999999999949e-01,
36 | 9.821900000000000075e-01,
37 | 9.801800000000000512e-01,2.518699999999999828e-01
38 | 2.426099999999999923e-01,1.023200000000000109e+00
39 | 7.615699999999999692e-01,2.893800000000000261e-01
40 | 4.026300000000000018e-02,9.309899999999999842e-01
41 | 5.768499999999999739e-01,2.831899999999999973e-01
42 | 7.008299999999999530e-01,2.690000000000000169e-01
43 | 5.301799999999999846e-01,
44 | 4.897599999999999731e-01,
45 | 2.394399999999999862e-01,
46 | 3.801499999999999879e-01,8.233399999999999608e-01
47 | 2.148700000000000054e-01,1.085099999999999953e+00
48 | 5.733800000000000008e-01,
49 | 9.769400000000000306e-01,
50 | 1.379499999999999893e-01,
51 | 1.087000000000000050e-01,
52 | 5.995000000000000329e-01,
53 | 4.663499999999999868e-01,5.097599999999999909e-01
54 | 9.072799999999999754e-01,
55 | 6.884900000000000464e-01,1.395000000000000129e-01
56 | 1.618599999999999900e-02,8.071199999999999486e-01
57 | 1.841599999999999904e-01,1.130800000000000027e+00
58 | 7.980099999999999971e-01,
59 | 8.908199999999999452e-01,1.320500000000000007e-01
60 | 2.855599999999999805e-01,
61 | 7.987499999999999600e-01,1.733699999999999963e-01
62 | 8.761900000000000244e-01,3.040200000000000125e-01
63 | 1.892099999999999893e-01,9.575900000000000523e-01
64 | 4.003700000000000037e-01,
65 | 6.988799999999999457e-01,
66 | 6.508199999999999541e-01,1.186200000000000032e-01
67 | 1.341199999999999892e-01,
68 | 7.149999999999999689e-01,2.027400000000000035e-01
69 | 9.013299999999999645e-01,2.118899999999999950e-01
70 | 6.467500000000000471e-01,2.403299999999999881e-01
71 | 1.473099999999999965e-01,
72 | 3.206300000000000261e-01,9.785500000000000309e-01
73 | 4.832099999999999729e-01,5.850699999999999790e-01
74 | 7.887199999999999767e-01,
75 | 9.593300000000000161e-01,
76 | 4.773000000000000020e-01,
77 | 5.064699999999999758e-01,6.962699999999999445e-01
78 | 5.812000000000000499e-01,
79 | 7.570700000000000207e-01,3.031599999999999920e-02
80 | 7.826800000000000423e-01,2.152699999999999891e-01
81 | 2.237899999999999889e-01,1.054300000000000015e+00
82 | 1.575000000000000011e-01,1.045400000000000107e+00
83 | 5.862500000000000488e-01,4.279000000000000026e-01
84 | 5.190399999999999459e-01,6.183999999999999497e-01
85 | 8.477000000000000091e-01,7.920900000000000163e-02
86 | 5.579600000000000115e-01,4.545799999999999841e-01
87 | 2.564799999999999858e-01,9.348400000000000043e-01
88 | 5.237800000000000233e-01,
89 | 2.546100000000000030e-01,1.226799999999999891e+00
90 | 1.405599999999999905e-01,1.059399999999999897e+00
91 | 2.991699999999999915e-02,
92 | 6.913799999999999946e-01,
93 | 5.725400000000000489e-01,4.625099999999999767e-01
94 | 5.295800000000000507e-01,6.036399999999999544e-01
95 | 1.944599999999999940e-01,9.289199999999999680e-01
96 | 4.531700000000000172e-01,
97 | 2.094300000000000050e-01,8.733300000000000507e-01
98 | 4.773000000000000020e-01,
99 | 7.245300000000000074e-01,3.006699999999999928e-01
100 | 3.887000000000000177e-02,7.928300000000000347e-01
101 | 6.284300000000000441e-01,
102 |
--------------------------------------------------------------------------------
/Lab_2/dataset/dataset_5_full.txt:
--------------------------------------------------------------------------------
1 | x,y
2 | 2.137600000000000056e-01,8.715300000000000269e-01
3 | 2.980999999999999761e-01,6.692799999999999860e-01
4 | 7.683400000000000230e-01,1.179300000000000015e+00
5 | 5.011499999999999844e-01,1.332500000000000018e+00
6 | 9.094600000000000461e-01,2.399599999999999955e+00
7 | 5.785300000000000165e-02,1.644200000000000106e+00
8 | 4.367500000000000271e-01,1.361399999999999944e+00
9 | 5.722500000000000364e-01,1.944600000000000106e+00
10 | 5.650699999999999612e-01,1.620000000000000107e+00
11 | 8.238199999999999967e-01,1.639199999999999990e+00
12 | 1.260999999999999899e-01,1.825299999999999923e+00
13 | 3.001199999999999979e-01,8.735100000000000087e-01
14 | 2.122000000000000188e-03,6.780500000000000416e-01
15 | 9.511100000000000110e-01,2.043000000000000149e+00
16 | 7.662999999999999812e-01,1.137899999999999912e+00
17 | 7.512999999999999678e-01,1.022599999999999953e+00
18 | 1.388600000000000112e-01,1.362200000000000077e+00
19 | 3.493200000000000194e-01,9.714800000000000102e-01
20 | 1.513400000000000023e-01,1.378200000000000092e+00
21 | 4.967199999999999949e-01,2.089399999999999924e+00
22 | 8.086499999999999799e-01,1.388600000000000056e+00
23 | 6.328700000000000436e-01,1.372100000000000097e+00
24 | 6.884000000000000119e-01,1.254999999999999893e+00
25 | 6.395699999999999719e-01,1.440800000000000081e+00
26 | 7.293199999999999683e-01,9.881199999999999983e-01
27 | 8.598500000000000032e-01,1.504899999999999904e+00
28 | 6.269599999999999618e-01,1.213899999999999979e+00
29 | 1.805900000000000005e-01,1.313600000000000101e+00
30 | 5.733099999999999863e-01,1.849299999999999944e+00
31 | 1.635699999999999932e-01,9.875199999999999534e-01
32 | 9.060500000000000220e-01,2.157200000000000006e+00
33 | 7.734299999999999509e-02,1.441599999999999993e+00
34 | 3.385299999999999976e-01,4.365399999999999836e-01
35 | 5.806200000000000250e-01,1.508999999999999897e+00
36 | 4.752399999999999958e-01,1.888099999999999890e+00
37 | 8.053200000000000358e-01,1.020799999999999930e+00
38 | 5.307800000000000296e-01,1.917200000000000015e+00
39 | 2.273100000000000120e-01,1.090500000000000025e+00
40 | 7.094799999999999995e-01,6.821199999999999486e-01
41 | 1.486300000000000121e-01,1.318000000000000060e+00
42 | 6.581200000000000383e-01,1.006999999999999895e+00
43 | 6.339799999999999880e-01,1.409499999999999975e+00
44 | 2.293100000000000138e-01,7.980699999999999461e-01
45 | 1.822300000000000031e-01,8.505099999999999882e-01
46 | 1.663499999999999979e-01,1.391100000000000003e+00
47 | 1.496099999999999930e-01,1.459699999999999998e+00
48 | 2.027500000000000135e-01,9.291700000000000514e-01
49 | 9.549600000000000311e-01,2.351799999999999891e+00
50 | 1.590799999999999853e-02,6.652299999999999880e-01
51 | 9.575099999999999723e-01,1.997900000000000009e+00
52 | 2.569199999999999956e-02,7.829599999999999893e-01
53 | 9.711100000000000287e-01,2.203800000000000203e+00
54 | 2.975999999999999757e-01,5.081099999999999506e-01
55 | 5.250700000000000367e-01,2.207199999999999829e+00
56 | 8.623399999999999954e-01,1.828300000000000036e+00
57 | 8.963999999999999746e-01,2.193999999999999950e+00
58 | 1.890100000000000113e-01,1.254699999999999926e+00
59 | 6.607199999999999740e-01,1.301500000000000101e+00
60 | 9.412300000000000111e-01,2.279500000000000082e+00
61 | 9.757099999999999662e-01,2.463699999999999779e+00
62 | 1.079399999999999943e-01,1.174500000000000099e+00
63 | 1.789000000000000035e-01,1.527099999999999902e+00
64 | 7.465500000000000469e-01,1.194099999999999939e+00
65 | 4.946899999999999908e-02,9.574599999999999778e-01
66 | 7.128500000000000114e-02,1.531700000000000061e+00
67 | 4.891300000000000092e-01,1.960299999999999931e+00
68 | 8.498900000000000343e-01,2.081900000000000084e+00
69 | 9.970400000000000373e-01,2.054699999999999971e+00
70 | 4.392599999999999977e-03,1.165200000000000014e+00
71 | 5.426100000000000367e-01,1.875099999999999989e+00
72 | 8.613499999999999490e-01,1.541900000000000048e+00
73 | 9.091399999999999482e-01,1.992699999999999916e+00
74 | 8.453500000000000458e-01,1.888099999999999890e+00
75 | 8.788700000000000401e-01,2.326600000000000001e+00
76 | 7.461799999999999544e-01,8.192399999999999682e-01
77 | 1.174899999999999972e-01,1.386100000000000110e+00
78 | 5.090200000000000280e-01,1.665799999999999947e+00
79 | 1.688300000000000078e-01,1.630900000000000016e+00
80 | 8.311100000000000154e-01,1.402099999999999902e+00
81 | 9.280100000000000016e-01,2.482600000000000140e+00
82 | 1.694799999999999918e-01,1.126600000000000046e+00
83 | 8.837399999999999700e-01,2.157200000000000006e+00
84 | 3.878599999999999826e-01,6.986900000000000333e-01
85 | 3.825700000000000212e-01,1.223600000000000021e+00
86 | 2.714500000000000246e-01,2.300000000000000100e-01
87 | 8.678799999999999848e-01,1.950700000000000101e+00
88 | 7.415000000000000480e-01,1.129699999999999926e+00
89 | 4.478699999999999903e-01,1.294399999999999995e+00
90 | 7.096400000000000485e-01,8.468299999999999716e-01
91 | 9.443300000000000027e-01,2.366000000000000103e+00
92 | 1.741199999999999970e-01,1.019600000000000062e+00
93 | 2.446000000000000119e-01,7.873299999999999743e-01
94 | 6.409299999999999997e-01,7.829599999999999893e-01
95 | 8.086100000000000509e-01,9.807099999999999707e-01
96 | 8.533699999999999619e-01,1.760499999999999954e+00
97 | 3.981199999999999739e-01,1.268499999999999961e+00
98 | 1.154899999999999954e-01,1.079099999999999948e+00
99 | 8.028100000000000513e-02,1.482799999999999896e+00
100 | 3.604700000000000126e-01,8.751900000000000235e-01
101 | 8.289100000000000357e-01,1.445000000000000062e+00
102 |
--------------------------------------------------------------------------------
/Lab_2/dataset/dataset_5_missing.txt:
--------------------------------------------------------------------------------
1 | x,y
2 | 2.137600000000000056e-01,8.715300000000000269e-01
3 | 2.980999999999999761e-01,6.692799999999999860e-01
4 | 7.683400000000000230e-01,1.179300000000000015e+00
5 | 5.011499999999999844e-01,
6 | 9.094600000000000461e-01,
7 | 5.785300000000000165e-02,1.644200000000000106e+00
8 | 4.367500000000000271e-01,
9 | 5.722500000000000364e-01,
10 | 5.650699999999999612e-01,
11 | 8.238199999999999967e-01,1.639199999999999990e+00
12 | 1.260999999999999899e-01,1.825299999999999923e+00
13 | 3.001199999999999979e-01,8.735100000000000087e-01
14 | 2.122000000000000188e-03,
15 | 9.511100000000000110e-01,
16 | 7.662999999999999812e-01,
17 | 7.512999999999999678e-01,1.022599999999999953e+00
18 | 1.388600000000000112e-01,
19 | 3.493200000000000194e-01,
20 | 1.513400000000000023e-01,
21 | 4.967199999999999949e-01,
22 | 8.086499999999999799e-01,
23 | 6.328700000000000436e-01,1.372100000000000097e+00
24 | 6.884000000000000119e-01,1.254999999999999893e+00
25 | 6.395699999999999719e-01,1.440800000000000081e+00
26 | 7.293199999999999683e-01,9.881199999999999983e-01
27 | 8.598500000000000032e-01,1.504899999999999904e+00
28 | 6.269599999999999618e-01,1.213899999999999979e+00
29 | 1.805900000000000005e-01,1.313600000000000101e+00
30 | 5.733099999999999863e-01,1.849299999999999944e+00
31 | 1.635699999999999932e-01,9.875199999999999534e-01
32 | 9.060500000000000220e-01,
33 | 7.734299999999999509e-02,1.441599999999999993e+00
34 | 3.385299999999999976e-01,4.365399999999999836e-01
35 | 5.806200000000000250e-01,
36 | 4.752399999999999958e-01,1.888099999999999890e+00
37 | 8.053200000000000358e-01,
38 | 5.307800000000000296e-01,1.917200000000000015e+00
39 | 2.273100000000000120e-01,1.090500000000000025e+00
40 | 7.094799999999999995e-01,
41 | 1.486300000000000121e-01,1.318000000000000060e+00
42 | 6.581200000000000383e-01,1.006999999999999895e+00
43 | 6.339799999999999880e-01,
44 | 2.293100000000000138e-01,7.980699999999999461e-01
45 | 1.822300000000000031e-01,8.505099999999999882e-01
46 | 1.663499999999999979e-01,1.391100000000000003e+00
47 | 1.496099999999999930e-01,1.459699999999999998e+00
48 | 2.027500000000000135e-01,9.291700000000000514e-01
49 | 9.549600000000000311e-01,
50 | 1.590799999999999853e-02,6.652299999999999880e-01
51 | 9.575099999999999723e-01,
52 | 2.569199999999999956e-02,
53 | 9.711100000000000287e-01,2.203800000000000203e+00
54 | 2.975999999999999757e-01,5.081099999999999506e-01
55 | 5.250700000000000367e-01,2.207199999999999829e+00
56 | 8.623399999999999954e-01,1.828300000000000036e+00
57 | 8.963999999999999746e-01,2.193999999999999950e+00
58 | 1.890100000000000113e-01,1.254699999999999926e+00
59 | 6.607199999999999740e-01,
60 | 9.412300000000000111e-01,2.279500000000000082e+00
61 | 9.757099999999999662e-01,
62 | 1.079399999999999943e-01,1.174500000000000099e+00
63 | 1.789000000000000035e-01,1.527099999999999902e+00
64 | 7.465500000000000469e-01,
65 | 4.946899999999999908e-02,9.574599999999999778e-01
66 | 7.128500000000000114e-02,1.531700000000000061e+00
67 | 4.891300000000000092e-01,1.960299999999999931e+00
68 | 8.498900000000000343e-01,2.081900000000000084e+00
69 | 9.970400000000000373e-01,
70 | 4.392599999999999977e-03,1.165200000000000014e+00
71 | 5.426100000000000367e-01,1.875099999999999989e+00
72 | 8.613499999999999490e-01,1.541900000000000048e+00
73 | 9.091399999999999482e-01,
74 | 8.453500000000000458e-01,
75 | 8.788700000000000401e-01,2.326600000000000001e+00
76 | 7.461799999999999544e-01,
77 | 1.174899999999999972e-01,1.386100000000000110e+00
78 | 5.090200000000000280e-01,1.665799999999999947e+00
79 | 1.688300000000000078e-01,
80 | 8.311100000000000154e-01,1.402099999999999902e+00
81 | 9.280100000000000016e-01,
82 | 1.694799999999999918e-01,
83 | 8.837399999999999700e-01,2.157200000000000006e+00
84 | 3.878599999999999826e-01,6.986900000000000333e-01
85 | 3.825700000000000212e-01,1.223600000000000021e+00
86 | 2.714500000000000246e-01,2.300000000000000100e-01
87 | 8.678799999999999848e-01,
88 | 7.415000000000000480e-01,
89 | 4.478699999999999903e-01,
90 | 7.096400000000000485e-01,8.468299999999999716e-01
91 | 9.443300000000000027e-01,2.366000000000000103e+00
92 | 1.741199999999999970e-01,
93 | 2.446000000000000119e-01,7.873299999999999743e-01
94 | 6.409299999999999997e-01,7.829599999999999893e-01
95 | 8.086100000000000509e-01,
96 | 8.533699999999999619e-01,1.760499999999999954e+00
97 | 3.981199999999999739e-01,1.268499999999999961e+00
98 | 1.154899999999999954e-01,1.079099999999999948e+00
99 | 8.028100000000000513e-02,1.482799999999999896e+00
100 | 3.604700000000000126e-01,8.751900000000000235e-01
101 | 8.289100000000000357e-01,1.445000000000000062e+00
102 |
--------------------------------------------------------------------------------
/Lab_2/lab2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_2/lab2.pdf
--------------------------------------------------------------------------------
/Lab_3/Data_Science_Lab3.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# CS 109A/AC 209A/STAT 121A Data Science: Lab 3\n",
8 | "**Harvard University**
\n",
9 | "**Fall 2016**
\n",
10 | "**Instructors: W. Pan, P. Protopapas, K. Rader**
\n",
11 | "**Due Date: ** Wednesday, September 28th, 2016 at 11:59pm"
12 | ]
13 | },
14 | {
15 | "cell_type": "markdown",
16 | "metadata": {},
17 | "source": [
18 | "Download the `IPython` notebook as well as the data file from Vocareum and complete locally.\n",
19 | "\n",
20 | "To submit your assignment, in Vocareum, upload (using the 'Upload' button on your Jupyter Dashboard) your solution to Vocareum as a single notebook with following file name format:\n",
21 | "\n",
22 | "`last_first_CourseNumber_HW3.ipynb`\n",
23 | "\n",
24 | "where `CourseNumber` is the course in which you're enrolled (CS 109a, Stats 121a, AC 209a). Submit your assignment in Vocareum using the 'Submit' button.\n",
25 | "\n",
26 | "**Avoid editing your file in Vocareum after uploading. If you need to make a change in a solution. Delete your old solution file from Vocareum and upload a new solution. Click submit only ONCE after verifying that you have uploaded the correct file. The assignment will CLOSE after you click the submit button.**\n",
27 | "\n",
28 | "Problems on homework assignments are equally weighted. The Challenge Question is required for AC 209A students and optional for all others. Student who complete the Challenge Problem as optional extra credit will receive +0.5% towards your final grade for each correct solution. "
29 | ]
30 | },
31 | {
32 | "cell_type": "markdown",
33 | "metadata": {},
34 | "source": [
35 | "Import libraries"
36 | ]
37 | },
38 | {
39 | "cell_type": "code",
40 | "execution_count": 1,
41 | "metadata": {
42 | "collapsed": false
43 | },
44 | "outputs": [],
45 | "source": [
46 | "import numpy as np\n",
47 | "import pandas as pd\n",
48 | "from sklearn.linear_model import LinearRegression as Lin_Reg\n",
49 | "import matplotlib\n",
50 | "import matplotlib.pyplot as plt\n",
51 | "import matplotlib.cm as cmx\n",
52 | "import matplotlib.colors as colors\n",
53 | "import scipy as sp\n",
54 | "%matplotlib inline"
55 | ]
56 | },
57 | {
58 | "cell_type": "markdown",
59 | "metadata": {},
60 | "source": [
61 | "## Problem 0: Basic Information\n",
62 | "\n",
63 | "Fill in your basic information. \n",
64 | "\n",
65 | "### Part (a): Your name"
66 | ]
67 | },
68 | {
69 | "cell_type": "markdown",
70 | "metadata": {},
71 | "source": [
72 | "[Last, First]"
73 | ]
74 | },
75 | {
76 | "cell_type": "markdown",
77 | "metadata": {},
78 | "source": [
79 | "### Part (b): Course Number"
80 | ]
81 | },
82 | {
83 | "cell_type": "markdown",
84 | "metadata": {},
85 | "source": [
86 | "[CS 109a or STATS 121a or AC 209a]"
87 | ]
88 | },
89 | {
90 | "cell_type": "markdown",
91 | "metadata": {},
92 | "source": [
93 | "### Part (c): Who did you work with?"
94 | ]
95 | },
96 | {
97 | "cell_type": "markdown",
98 | "metadata": {},
99 | "source": [
100 | "[First and Land names of students with whom you have collaborated]"
101 | ]
102 | },
103 | {
104 | "cell_type": "markdown",
105 | "metadata": {},
106 | "source": [
107 | "**All data sets can be found in the ``datasets`` folder and are in comma separated value (CSV) format**"
108 | ]
109 | },
110 | {
111 | "cell_type": "markdown",
112 | "metadata": {},
113 | "source": [
114 | "## Problem 1: Multiple linear regression\n",
115 | "\n",
116 | "### Part (a): Implement multiple linear regression from scratch\n",
117 | "\n",
118 | "You are provided a data set containing attributes related to automobiles as well as their corresponding prices. The task is to build a linear regression model from scratch that can estimate the price of an automobile (response variable) using its attributes (predictor variables).\n",
119 | "\n",
120 | "The file ``dataset_1_train.txt`` contains the training set that you can use to fit a regression model, and the file ``dataset_1_test.txt`` contains the test set that you can use to evaluate the model. In each file, the first two columns contain the predictors of the automobile, namely ``'horsepower'`` and ``'highway MPG'``, and the last column contains the automobile prices.\n",
121 | "\n",
122 | "- Implement the following two functions from scratch. \n",
123 | "\n",
124 | " - ``multiple_linear_regression_fit``:\n",
125 | "\n",
126 | " - takes as input: the training set, ``x_train``, ``y_train``\n",
127 | "\n",
128 | " - fits a multiple linear regression model\n",
129 | "\n",
130 | " - returns the model parameters (coefficients on the predictors, as an array, and the intercept, as a float).\n",
131 | "\n",
132 | " - ``multiple_linear_regression_score``:\n",
133 | "\n",
134 | " - takes model parameters (coefficients and intercept) and the test set, ``x_test`` ``y_test``, as inputs\n",
135 | "\n",
136 | " - returns the R^2 score for the model on the test set, along with the predicted y-values.\n",
137 | " \n",
138 | "- Use your functions to predict automobile prices and evaluate your predictions.\n",
139 | "\n",
140 | "**Note:** You **may not** use pre-built models or model evaluators for these tasks."
141 | ]
142 | },
143 | {
144 | "cell_type": "markdown",
145 | "metadata": {},
146 | "source": [
147 | "### Part (b): Confidence interval on regression parameters\n",
148 | "Using your linear regression implementation from Part (a), model the data in ``dataset_2.txt``, which contains five predictor variables in the first five columns, and the response variable in the last column.\n",
149 | "\n",
150 | "Compute confidence intervals for the model parameters you obtain:\n",
151 | "\n",
152 | "- Create 200 random subsamples of the data set of size 100, and use your function to fit a multiple linear regression model to each subsample. \n",
153 | "\n",
154 | "- For each coefficient on the predictor variables: plot a histogram of the values obtained across the subsamples, and calculate the confidence interval for the coefficients at a confidence level of 95%. \n",
155 | "\n",
156 | "- Highlight the mean coeffcient values and the end points of the confidence intervals using vertical lines on the histogram plot. How large is the spread of the coefficient values in the histograms, and how tight are the confidence intervals?\n",
157 | "\n",
158 | "- Use the formula for computing confidence intervals provided in class (or use ``statmodels``) to compute the the confidence intervals. Compare confidence intervals you find through simulation to the ones given by the formula (or ``statmodels``), are your results what you would expect?\n",
159 | "\n",
160 | "**Note:** You **may not** use pre-built models or model evaluators for these tasks."
161 | ]
162 | }
163 | ],
164 | "metadata": {
165 | "anaconda-cloud": {},
166 | "kernelspec": {
167 | "display_name": "Python 2",
168 | "language": "python",
169 | "name": "python2"
170 | },
171 | "language_info": {
172 | "codemirror_mode": {
173 | "name": "ipython",
174 | "version": 2
175 | },
176 | "file_extension": ".py",
177 | "mimetype": "text/x-python",
178 | "name": "python",
179 | "nbconvert_exporter": "python",
180 | "pygments_lexer": "ipython2",
181 | "version": "2.7.11"
182 | }
183 | },
184 | "nbformat": 4,
185 | "nbformat_minor": 0
186 | }
187 |
--------------------------------------------------------------------------------
/Lab_3/datasets/dataset_1_test.txt:
--------------------------------------------------------------------------------
1 | horsepower, highway MPG, price
2 | 1.600000000000000000e+02,2.600000000000000000e+01,1.862000000000000000e+04
3 | 6.900000000000000000e+01,3.600000000000000000e+01,5.118000000000000000e+03
4 | 7.300000000000000000e+01,3.100000000000000000e+01,7.053000000000000000e+03
5 | 7.300000000000000000e+01,3.100000000000000000e+01,7.603000000000000000e+03
6 | 8.200000000000000000e+01,3.700000000000000000e+01,7.126000000000000000e+03
7 | 8.200000000000000000e+01,3.300000000000000000e+01,7.775000000000000000e+03
8 | 9.400000000000000000e+01,3.200000000000000000e+01,9.960000000000000000e+03
9 | 8.200000000000000000e+01,2.500000000000000000e+01,9.233000000000000000e+03
10 | 1.110000000000000000e+02,2.900000000000000000e+01,1.125900000000000000e+04
11 | 8.200000000000000000e+01,3.200000000000000000e+01,7.463000000000000000e+03
12 | 9.400000000000000000e+01,3.100000000000000000e+01,1.019800000000000000e+04
13 | 8.200000000000000000e+01,2.900000000000000000e+01,8.013000000000000000e+03
14 | 1.110000000000000000e+02,2.300000000000000000e+01,1.169400000000000000e+04
15 | 6.200000000000000000e+01,3.900000000000000000e+01,5.348000000000000000e+03
16 | 6.200000000000000000e+01,3.800000000000000000e+01,6.338000000000000000e+03
17 | 6.200000000000000000e+01,3.800000000000000000e+01,6.488000000000000000e+03
18 | 6.200000000000000000e+01,3.700000000000000000e+01,6.918000000000000000e+03
19 | 6.200000000000000000e+01,3.200000000000000000e+01,7.898000000000000000e+03
20 | 6.200000000000000000e+01,3.200000000000000000e+01,8.778000000000000000e+03
21 | 7.000000000000000000e+01,3.700000000000000000e+01,6.938000000000000000e+03
22 | 7.000000000000000000e+01,3.700000000000000000e+01,7.198000000000000000e+03
23 | 5.600000000000000000e+01,3.600000000000000000e+01,7.898000000000000000e+03
24 | 5.600000000000000000e+01,4.700000000000000000e+01,7.788000000000000000e+03
25 | 7.000000000000000000e+01,4.700000000000000000e+01,7.738000000000000000e+03
26 | 7.000000000000000000e+01,3.400000000000000000e+01,8.358000000000000000e+03
27 | 7.000000000000000000e+01,3.400000000000000000e+01,9.258000000000000000e+03
28 | 7.000000000000000000e+01,3.400000000000000000e+01,8.058000000000000000e+03
29 | 7.000000000000000000e+01,3.400000000000000000e+01,8.238000000000000000e+03
30 | 1.120000000000000000e+02,2.900000000000000000e+01,9.298000000000000000e+03
31 | 1.120000000000000000e+02,2.900000000000000000e+01,9.538000000000000000e+03
32 | 1.160000000000000000e+02,3.000000000000000000e+01,8.449000000000000000e+03
33 | 1.160000000000000000e+02,3.000000000000000000e+01,9.639000000000000000e+03
34 | 1.160000000000000000e+02,3.000000000000000000e+01,9.989000000000000000e+03
35 | 1.160000000000000000e+02,3.000000000000000000e+01,1.119900000000000000e+04
36 | 1.160000000000000000e+02,3.000000000000000000e+01,1.154900000000000000e+04
37 | 1.160000000000000000e+02,3.000000000000000000e+01,1.766900000000000000e+04
38 | 9.200000000000000000e+01,3.400000000000000000e+01,8.948000000000000000e+03
39 | 7.300000000000000000e+01,3.300000000000000000e+01,1.069800000000000000e+04
40 | 9.200000000000000000e+01,3.200000000000000000e+01,9.988000000000000000e+03
41 | 9.200000000000000000e+01,3.200000000000000000e+01,1.089800000000000000e+04
42 | 9.200000000000000000e+01,3.200000000000000000e+01,1.124800000000000000e+04
43 | 1.610000000000000000e+02,2.400000000000000000e+01,1.655800000000000000e+04
44 | 1.610000000000000000e+02,2.400000000000000000e+01,1.599800000000000000e+04
45 | 1.560000000000000000e+02,2.400000000000000000e+01,1.569000000000000000e+04
46 | 1.560000000000000000e+02,2.400000000000000000e+01,1.575000000000000000e+04
47 | 5.200000000000000000e+01,4.600000000000000000e+01,7.775000000000000000e+03
48 | 8.500000000000000000e+01,3.400000000000000000e+01,7.975000000000000000e+03
49 | 5.200000000000000000e+01,4.600000000000000000e+01,7.995000000000000000e+03
50 | 8.500000000000000000e+01,3.400000000000000000e+01,8.195000000000000000e+03
51 | 8.500000000000000000e+01,3.400000000000000000e+01,8.495000000000000000e+03
52 | 6.800000000000000000e+01,4.200000000000000000e+01,9.495000000000000000e+03
53 | 1.000000000000000000e+02,3.200000000000000000e+01,9.995000000000000000e+03
54 | 9.000000000000000000e+01,2.900000000000000000e+01,1.159500000000000000e+04
55 | 9.000000000000000000e+01,2.900000000000000000e+01,9.980000000000000000e+03
56 | 1.100000000000000000e+02,2.400000000000000000e+01,1.329500000000000000e+04
57 | 6.800000000000000000e+01,3.800000000000000000e+01,1.384500000000000000e+04
58 | 8.800000000000000000e+01,3.100000000000000000e+01,1.229000000000000000e+04
59 | 1.140000000000000000e+02,2.800000000000000000e+01,1.294000000000000000e+04
60 | 1.140000000000000000e+02,2.800000000000000000e+01,1.341500000000000000e+04
61 | 1.140000000000000000e+02,2.800000000000000000e+01,1.598500000000000000e+04
62 | 1.140000000000000000e+02,2.800000000000000000e+01,1.651500000000000000e+04
63 | 1.620000000000000000e+02,2.200000000000000000e+01,1.842000000000000000e+04
64 | 1.620000000000000000e+02,2.200000000000000000e+01,1.895000000000000000e+04
65 | 1.140000000000000000e+02,2.800000000000000000e+01,1.684500000000000000e+04
66 | 1.600000000000000000e+02,2.500000000000000000e+01,1.904500000000000000e+04
67 | 1.340000000000000000e+02,2.300000000000000000e+01,2.148500000000000000e+04
68 | 1.060000000000000000e+02,2.700000000000000000e+01,2.247000000000000000e+04
69 | 1.140000000000000000e+02,2.500000000000000000e+01,2.262500000000000000e+04
70 |
--------------------------------------------------------------------------------
/Lab_3/datasets/dataset_1_train.txt:
--------------------------------------------------------------------------------
1 | horsepower, highway MPG, price
2 | 1.110000000000000000e+02,2.700000000000000000e+01,9.310750991418681224e+03
3 | 1.110000000000000000e+02,2.700000000000000000e+01,2.384328332171893635e+04
4 | 1.540000000000000000e+02,2.600000000000000000e+01,3.746441991779442469e+04
5 | 1.020000000000000000e+02,3.000000000000000000e+01,8.707094661205987904e+02
6 | 1.150000000000000000e+02,2.200000000000000000e+01,1.763846748800121713e+04
7 | 1.100000000000000000e+02,2.500000000000000000e+01,1.895529447734661517e+04
8 | 1.100000000000000000e+02,2.500000000000000000e+01,2.933802649610847220e+04
9 | 1.100000000000000000e+02,2.500000000000000000e+01,2.599491874752452713e+04
10 | 1.400000000000000000e+02,2.000000000000000000e+01,1.532065009116091460e+04
11 | 1.600000000000000000e+02,2.200000000000000000e+01,8.527993033961731271e+03
12 | 1.010000000000000000e+02,2.900000000000000000e+01,1.577399845985263528e+04
13 | 1.010000000000000000e+02,2.900000000000000000e+01,3.012776536901946383e+04
14 | 1.210000000000000000e+02,2.800000000000000000e+01,3.196351448690744292e+04
15 | 1.210000000000000000e+02,2.800000000000000000e+01,2.549600889025541619e+04
16 | 1.210000000000000000e+02,2.500000000000000000e+01,3.016971743356125808e+04
17 | 1.820000000000000000e+02,2.200000000000000000e+01,1.707643173866556026e+04
18 | 1.820000000000000000e+02,2.200000000000000000e+01,3.757172309617942665e+04
19 | 1.820000000000000000e+02,2.000000000000000000e+01,4.265163818896483281e+04
20 | 4.800000000000000000e+01,5.300000000000000000e+01,5.053923866247179831e+03
21 | 7.000000000000000000e+01,4.300000000000000000e+01,1.048776183355656713e+03
22 | 7.000000000000000000e+01,4.300000000000000000e+01,1.166146052779430283e+04
23 | 6.800000000000000000e+01,4.100000000000000000e+01,8.838129245274182040e+02
24 | 6.800000000000000000e+01,3.800000000000000000e+01,1.594781687785450413e+04
25 | 1.020000000000000000e+02,3.000000000000000000e+01,2.395706294967579197e+03
26 | 6.800000000000000000e+01,3.800000000000000000e+01,1.167009926273048768e+04
27 | 6.800000000000000000e+01,3.800000000000000000e+01,1.357141117688423719e+03
28 | 6.800000000000000000e+01,3.800000000000000000e+01,2.819376021068803675e+04
29 | 1.020000000000000000e+02,3.000000000000000000e+01,1.772222493939471860e+03
30 | 8.800000000000000000e+01,3.000000000000000000e+01,2.502360485723842430e+04
31 | 1.450000000000000000e+02,2.400000000000000000e+01,1.182253265119651587e+04
32 | 5.800000000000000000e+01,5.400000000000000000e+01,5.963362610863765440e+03
33 | 7.600000000000000000e+01,3.800000000000000000e+01,7.511397193973250069e+03
34 | 6.000000000000000000e+01,4.200000000000000000e+01,7.124343243214688300e+03
35 | 7.600000000000000000e+01,3.400000000000000000e+01,1.143551505359530893e+03
36 | 7.600000000000000000e+01,3.400000000000000000e+01,1.522908578539724476e+04
37 | 7.600000000000000000e+01,3.400000000000000000e+01,1.929527298173105373e+04
38 | 7.600000000000000000e+01,3.400000000000000000e+01,1.766097149194819849e+03
39 | 8.600000000000000000e+01,3.300000000000000000e+01,2.048718585348252964e+04
40 | 8.600000000000000000e+01,3.300000000000000000e+01,1.113889380303662983e+04
41 | 8.600000000000000000e+01,3.300000000000000000e+01,2.627243737602881993e+03
42 | 8.600000000000000000e+01,3.300000000000000000e+01,8.307762505696114204e+02
43 | 1.010000000000000000e+02,2.800000000000000000e+01,1.851116306062525837e+03
44 | 1.000000000000000000e+02,3.100000000000000000e+01,7.292044994387069892e+02
45 | 7.800000000000000000e+01,2.900000000000000000e+01,9.865126792421997379e+03
46 | 7.000000000000000000e+01,4.300000000000000000e+01,8.407123025722492457e+03
47 | 7.000000000000000000e+01,4.300000000000000000e+01,2.123173313583297204e+04
48 | 9.000000000000000000e+01,2.900000000000000000e+01,2.144674737309509510e+04
49 | 1.760000000000000000e+02,1.900000000000000000e+01,1.588126827662055257e+04
50 | 1.760000000000000000e+02,1.900000000000000000e+01,1.361944245041373142e+04
51 | 2.620000000000000000e+02,1.700000000000000000e+01,1.432794117406007899e+03
52 | 6.800000000000000000e+01,3.100000000000000000e+01,7.752324045938099744e+02
53 | 6.800000000000000000e+01,3.800000000000000000e+01,1.753238391406256414e+04
54 | 6.800000000000000000e+01,3.800000000000000000e+01,1.777062197770922921e+03
55 | 6.800000000000000000e+01,3.800000000000000000e+01,1.107695391718996916e+03
56 | 6.800000000000000000e+01,3.800000000000000000e+01,4.327947063388020297e+02
57 | 1.010000000000000000e+02,2.300000000000000000e+01,1.258669456066790190e+04
58 | 1.010000000000000000e+02,2.300000000000000000e+01,3.017909931626961770e+04
59 | 1.010000000000000000e+02,2.300000000000000000e+01,2.085372561622421199e+04
60 | 1.350000000000000000e+02,2.300000000000000000e+01,2.435070229497342007e+04
61 | 8.400000000000000000e+01,3.200000000000000000e+01,1.571549365606712672e+04
62 | 8.400000000000000000e+01,3.200000000000000000e+01,1.000669402691990763e+04
63 | 8.400000000000000000e+01,3.200000000000000000e+01,1.391847729912740988e+03
64 | 8.400000000000000000e+01,3.200000000000000000e+01,8.551229838714369180e+03
65 | 6.400000000000000000e+01,4.200000000000000000e+01,2.629012265356760327e+04
66 | 8.400000000000000000e+01,3.200000000000000000e+01,1.026479908814578721e+03
67 | 1.200000000000000000e+02,2.700000000000000000e+01,2.996090924211921083e+04
68 | 7.200000000000000000e+01,3.900000000000000000e+01,1.380907329162183669e+04
69 | 1.230000000000000000e+02,2.500000000000000000e+01,3.597517541597151285e+04
70 | 1.230000000000000000e+02,2.500000000000000000e+01,3.951606738503594534e+04
71 | 1.230000000000000000e+02,2.500000000000000000e+01,2.478254203579797104e+04
72 | 1.230000000000000000e+02,2.500000000000000000e+01,4.043162400395410077e+04
73 | 1.550000000000000000e+02,1.800000000000000000e+01,2.440045176180269846e+04
74 | 1.550000000000000000e+02,1.800000000000000000e+01,3.298486131755439419e+04
75 | 1.840000000000000000e+02,1.600000000000000000e+01,3.698511693344198284e+04
76 | 1.840000000000000000e+02,1.600000000000000000e+01,3.694868810439416120e+04
77 | 1.750000000000000000e+02,2.400000000000000000e+01,1.074125976748004177e+04
78 | 6.800000000000000000e+01,4.100000000000000000e+01,6.248402498526968429e+02
79 | 6.800000000000000000e+01,3.800000000000000000e+01,1.673426185469475342e+02
80 | 6.800000000000000000e+01,3.800000000000000000e+01,1.724958950985088450e+03
81 | 1.020000000000000000e+02,3.000000000000000000e+01,2.580183715865156955e+03
82 | 1.160000000000000000e+02,3.000000000000000000e+01,7.538139676315964834e+02
83 | 8.800000000000000000e+01,3.200000000000000000e+01,1.276358429180890016e+04
84 | 1.450000000000000000e+02,2.400000000000000000e+01,5.155505757691615827e+02
85 | 1.450000000000000000e+02,2.400000000000000000e+01,1.477097393556263114e+03
86 | 1.450000000000000000e+02,2.400000000000000000e+01,1.809692970924570182e+04
87 | 8.800000000000000000e+01,3.200000000000000000e+01,7.886947933822814321e+02
88 | 8.800000000000000000e+01,3.200000000000000000e+01,1.451360588061587441e+04
89 | 1.160000000000000000e+02,3.000000000000000000e+01,1.724269667447024403e+04
90 | 1.160000000000000000e+02,3.000000000000000000e+01,1.525861427814647323e+04
91 | 6.900000000000000000e+01,3.700000000000000000e+01,7.661805631440907746e+03
92 | 5.500000000000000000e+01,5.000000000000000000e+01,6.462997233710116234e+03
93 | 6.900000000000000000e+01,3.700000000000000000e+01,9.555875384267883419e+03
94 | 6.900000000000000000e+01,3.700000000000000000e+01,1.293166010942215871e+04
95 | 6.900000000000000000e+01,3.700000000000000000e+01,5.798670271374313643e+02
96 | 6.900000000000000000e+01,3.700000000000000000e+01,1.225531699251390137e+03
97 | 6.900000000000000000e+01,3.700000000000000000e+01,1.005697330053531459e+03
98 | 6.900000000000000000e+01,3.700000000000000000e+01,1.524585127415503393e+03
99 | 6.900000000000000000e+01,3.700000000000000000e+01,2.941169199922077314e+04
100 | 6.900000000000000000e+01,3.700000000000000000e+01,1.650556158238050193e+04
101 | 9.700000000000000000e+01,3.400000000000000000e+01,1.343482096633112803e+02
102 | 9.700000000000000000e+01,3.400000000000000000e+01,7.335505372325046665e+03
103 | 1.520000000000000000e+02,2.200000000000000000e+01,7.769924417253505453e+03
104 | 1.520000000000000000e+02,2.200000000000000000e+01,2.515402270840517667e+04
105 | 1.520000000000000000e+02,2.500000000000000000e+01,1.380982800935717023e+04
106 | 1.600000000000000000e+02,2.500000000000000000e+01,1.530797865011931208e+04
107 | 2.000000000000000000e+02,2.300000000000000000e+01,1.324263197547486925e+03
108 | 1.600000000000000000e+02,2.500000000000000000e+01,9.814153083048056942e+03
109 | 9.700000000000000000e+01,2.400000000000000000e+01,5.704846046643143382e+03
110 | 9.500000000000000000e+01,3.300000000000000000e+01,1.839035659014435078e+04
111 | 9.700000000000000000e+01,2.400000000000000000e+01,1.239037890882737520e+04
112 | 9.500000000000000000e+01,2.500000000000000000e+01,2.732906709627965756e+04
113 | 9.500000000000000000e+01,2.400000000000000000e+01,2.303642056312730347e+04
114 | 9.500000000000000000e+01,3.300000000000000000e+01,2.536303218421339261e+04
115 | 9.500000000000000000e+01,2.400000000000000000e+01,2.839224081998343172e+04
116 | 9.500000000000000000e+01,2.500000000000000000e+01,9.569349853889689257e+03
117 | 9.700000000000000000e+01,2.400000000000000000e+01,3.371206439861381659e+04
118 | 9.500000000000000000e+01,3.300000000000000000e+01,1.241741044509043786e+04
119 | 1.420000000000000000e+02,2.400000000000000000e+01,2.599027561413395961e+04
120 | 6.800000000000000000e+01,4.100000000000000000e+01,1.069544914771685171e+02
121 | 1.020000000000000000e+02,3.000000000000000000e+01,1.867615099034340892e+04
122 | 6.800000000000000000e+01,3.800000000000000000e+01,1.890447699101785838e+04
123 | 6.800000000000000000e+01,3.800000000000000000e+01,1.235778405885616991e+02
124 | 6.800000000000000000e+01,3.800000000000000000e+01,1.663855410350726379e+04
125 | 8.800000000000000000e+01,3.000000000000000000e+01,1.033479355708202638e+04
126 | 1.450000000000000000e+02,2.400000000000000000e+01,1.737006687375170077e+04
127 | 1.430000000000000000e+02,2.700000000000000000e+01,3.368803667779298848e+04
128 | 2.070000000000000000e+02,2.500000000000000000e+01,3.580891017923010077e+04
129 | 2.070000000000000000e+02,2.500000000000000000e+01,2.284099273193760746e+04
130 | 2.070000000000000000e+02,2.500000000000000000e+01,2.130646261852014140e+04
131 | 2.880000000000000000e+02,2.800000000000000000e+01,2.306458376041276642e+04
132 | 1.045490196078431353e+02,3.100000000000000000e+01,2.077636972092124779e+03
133 | 1.045490196078431353e+02,3.100000000000000000e+01,8.548625706182301656e+03
134 | 1.100000000000000000e+02,2.800000000000000000e+01,1.160316898665265035e+04
135 | 1.100000000000000000e+02,2.800000000000000000e+01,1.563486537261871672e+04
136 | 1.100000000000000000e+02,2.800000000000000000e+01,4.037102643661016828e+02
137 | 1.100000000000000000e+02,2.800000000000000000e+01,1.266971493965513901e+03
138 | 1.600000000000000000e+02,2.600000000000000000e+01,2.783602640422648255e+04
139 |
--------------------------------------------------------------------------------
/Lab_3/datasets/dataset_1_train_noise_levels.txt:
--------------------------------------------------------------------------------
1 | noise levels
2 | noisy
3 | noisy
4 | noisy
5 | none
6 | noisy
7 | noisy
8 | noisy
9 | noisy
10 | noisy
11 | noisy
12 | noisy
13 | noisy
14 | noisy
15 | noisy
16 | noisy
17 | noisy
18 | noisy
19 | noisy
20 | noisy
21 | noisy
22 | noisy
23 | none
24 | noisy
25 | noisy
26 | noisy
27 | none
28 | noisy
29 | noisy
30 | noisy
31 | noisy
32 | noisy
33 | noisy
34 | noisy
35 | noisy
36 | noisy
37 | noisy
38 | noisy
39 | noisy
40 | noisy
41 | noisy
42 | none
43 | noisy
44 | noisy
45 | noisy
46 | noisy
47 | noisy
48 | noisy
49 | noisy
50 | noisy
51 | none
52 | noisy
53 | noisy
54 | none
55 | none
56 | none
57 | noisy
58 | noisy
59 | noisy
60 | noisy
61 | noisy
62 | noisy
63 | none
64 | noisy
65 | noisy
66 | none
67 | noisy
68 | noisy
69 | noisy
70 | noisy
71 | noisy
72 | noisy
73 | noisy
74 | noisy
75 | noisy
76 | noisy
77 | noisy
78 | none
79 | noisy
80 | none
81 | noisy
82 | noisy
83 | noisy
84 | noisy
85 | noisy
86 | noisy
87 | noisy
88 | noisy
89 | noisy
90 | noisy
91 | noisy
92 | noisy
93 | noisy
94 | noisy
95 | none
96 | none
97 | none
98 | none
99 | noisy
100 | noisy
101 | noisy
102 | noisy
103 | noisy
104 | noisy
105 | noisy
106 | noisy
107 | noisy
108 | noisy
109 | noisy
110 | noisy
111 | noisy
112 | noisy
113 | noisy
114 | noisy
115 | noisy
116 | noisy
117 | noisy
118 | noisy
119 | noisy
120 | none
121 | noisy
122 | noisy
123 | none
124 | noisy
125 | noisy
126 | noisy
127 | noisy
128 | noisy
129 | noisy
130 | noisy
131 | noisy
132 | noisy
133 | noisy
134 | noisy
135 | noisy
136 | none
137 | none
138 | noisy
139 |
--------------------------------------------------------------------------------
/Lab_3/datasets/dataset_3.txt:
--------------------------------------------------------------------------------
1 | x, y
2 | 1.635299999999999948e-02,9.132500000000000062e-01
3 | 7.275700000000000500e-01,3.688600000000000212e-01
4 | 6.277000000000000357e-01,1.407700000000000062e-01
5 | 8.319999999999999618e-01,2.498499999999999888e-01
6 | 1.639200000000000101e-01,1.224699999999999900e+00
7 | 9.827000000000000179e-01,2.722800000000000220e-01
8 | 8.082500000000000240e-01,2.758499999999999841e-01
9 | 6.302799999999999514e-01,3.185600000000000098e-01
10 | 7.236299999999999955e-01,7.496400000000000285e-02
11 | 2.426500000000000046e-01,9.880700000000000038e-01
12 | 6.945099999999999607e-01,1.939800000000000135e-01
13 | 6.074899999999999745e-01,5.935300000000000020e-01
14 | 1.274300000000000085e-02,6.914099999999999691e-01
15 | 9.765200000000000546e-01,2.364100000000000090e-01
16 | 9.132900000000000462e-01,1.079800000000000065e-01
17 | 4.799599999999999977e-01,7.735600000000000254e-01
18 | 6.095199999999999507e-01,3.156200000000000117e-01
19 | 3.016199999999999992e-01,9.202799999999999869e-01
20 | 7.625199999999999756e-01,9.160899999999999599e-02
21 | 3.322599999999999998e-01,7.429299999999999793e-01
22 | 2.432600000000000040e-01,1.087199999999999944e+00
23 | 3.826100000000000056e-01,7.592900000000000205e-01
24 | 5.897199999999999664e-02,9.479899999999999993e-01
25 | 5.920100000000000362e-01,3.933599999999999874e-01
26 | 2.707899999999999752e-01,8.171399999999999775e-01
27 | 1.428000000000000103e-01,1.087299999999999933e+00
28 | 6.501299999999999857e-01,2.551399999999999779e-01
29 | 9.194200000000000150e-01,2.101000000000000090e-01
30 | 9.242299999999999960e-01,2.216700000000000059e-01
31 | 3.260700000000000265e-01,8.585599999999999898e-01
32 | 9.311599999999999877e-01,3.125800000000000245e-01
33 | 4.203899999999999859e-01,6.679199999999999582e-01
34 | 5.889799999999999480e-01,3.559499999999999886e-01
35 | 2.192999999999999949e-01,1.165200000000000014e+00
36 | 9.821900000000000075e-01,3.695399999999999796e-01
37 | 9.801800000000000512e-01,2.518699999999999828e-01
38 | 2.426099999999999923e-01,1.023200000000000109e+00
39 | 7.615699999999999692e-01,2.893800000000000261e-01
40 | 4.026300000000000018e-02,9.309899999999999842e-01
41 | 5.768499999999999739e-01,2.831899999999999973e-01
42 | 7.008299999999999530e-01,2.690000000000000169e-01
43 | 5.301799999999999846e-01,4.121000000000000218e-01
44 | 4.897599999999999731e-01,6.409799999999999942e-01
45 | 2.394399999999999862e-01,1.020000000000000018e+00
46 | 3.801499999999999879e-01,8.233399999999999608e-01
47 | 2.148700000000000054e-01,1.085099999999999953e+00
48 | 5.733800000000000008e-01,4.214300000000000268e-01
49 | 9.769400000000000306e-01,4.892699999999999827e-01
50 | 1.379499999999999893e-01,8.428499999999999881e-01
51 | 1.087000000000000050e-01,1.001900000000000013e+00
52 | 5.995000000000000329e-01,2.868499999999999939e-01
53 | 4.663499999999999868e-01,5.097599999999999909e-01
54 | 9.072799999999999754e-01,8.987299999999999456e-02
55 | 6.884900000000000464e-01,1.395000000000000129e-01
56 | 1.618599999999999900e-02,8.071199999999999486e-01
57 | 1.841599999999999904e-01,1.130800000000000027e+00
58 | 7.980099999999999971e-01,-8.472999999999999629e-03
59 | 8.908199999999999452e-01,1.320500000000000007e-01
60 | 2.855599999999999805e-01,9.491100000000000092e-01
61 | 7.987499999999999600e-01,1.733699999999999963e-01
62 | 8.761900000000000244e-01,3.040200000000000125e-01
63 | 1.892099999999999893e-01,9.575900000000000523e-01
64 | 4.003700000000000037e-01,7.986100000000000421e-01
65 | 6.988799999999999457e-01,2.948200000000000265e-01
66 | 6.508199999999999541e-01,1.186200000000000032e-01
67 | 1.341199999999999892e-01,1.256899999999999906e+00
68 | 7.149999999999999689e-01,2.027400000000000035e-01
69 | 9.013299999999999645e-01,2.118899999999999950e-01
70 | 6.467500000000000471e-01,2.403299999999999881e-01
71 | 1.473099999999999965e-01,1.099699999999999900e+00
72 | 3.206300000000000261e-01,9.785500000000000309e-01
73 | 4.832099999999999729e-01,5.850699999999999790e-01
74 | 7.887199999999999767e-01,1.237199999999999966e-01
75 | 9.593300000000000161e-01,4.681500000000000106e-01
76 | 4.773000000000000020e-01,7.636800000000000255e-01
77 | 5.064699999999999758e-01,6.962699999999999445e-01
78 | 5.812000000000000499e-01,3.717400000000000149e-01
79 | 7.570700000000000207e-01,3.031599999999999920e-02
80 | 7.826800000000000423e-01,2.152699999999999891e-01
81 | 2.237899999999999889e-01,1.054300000000000015e+00
82 | 1.575000000000000011e-01,1.045400000000000107e+00
83 | 5.862500000000000488e-01,4.279000000000000026e-01
84 | 5.190399999999999459e-01,6.183999999999999497e-01
85 | 8.477000000000000091e-01,7.920900000000000163e-02
86 | 5.579600000000000115e-01,4.545799999999999841e-01
87 | 2.564799999999999858e-01,9.348400000000000043e-01
88 | 5.237800000000000233e-01,6.382100000000000550e-01
89 | 2.546100000000000030e-01,1.226799999999999891e+00
90 | 1.405599999999999905e-01,1.059399999999999897e+00
91 | 2.991699999999999915e-02,7.803600000000000536e-01
92 | 6.913799999999999946e-01,1.923499999999999932e-01
93 | 5.725400000000000489e-01,4.625099999999999767e-01
94 | 5.295800000000000507e-01,6.036399999999999544e-01
95 | 1.944599999999999940e-01,9.289199999999999680e-01
96 | 4.531700000000000172e-01,6.905200000000000227e-01
97 | 2.094300000000000050e-01,8.733300000000000507e-01
98 | 4.773000000000000020e-01,6.164300000000000335e-01
99 | 7.245300000000000074e-01,3.006699999999999928e-01
100 | 3.887000000000000177e-02,7.928300000000000347e-01
101 | 6.284300000000000441e-01,3.040499999999999869e-01
102 |
--------------------------------------------------------------------------------
/Lab_3/lab3.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_3/lab3.pdf
--------------------------------------------------------------------------------
/Lab_4/Data_Science_Lab4.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# CS 109A/AC 209A/STAT 121A Data Science: Lab 4\n",
8 | "**Harvard University**
\n",
9 | "**Fall 2016**
\n",
10 | "**Instructors: W. Pan, P. Protopapas, K. Rader**
\n",
11 | "**Due Date: ** Wednesday, October 5th, 2016 at 11:59pm"
12 | ]
13 | },
14 | {
15 | "cell_type": "markdown",
16 | "metadata": {},
17 | "source": [
18 | "Download the `IPython` notebook as well as the data file from Vocareum and complete locally.\n",
19 | "\n",
20 | "To submit your assignment, in Vocareum, upload (using the 'Upload' button on your Jupyter Dashboard) your solution to Vocareum as a single notebook with following file name format:\n",
21 | "\n",
22 | "`last_first_CourseNumber_HW4.ipynb`\n",
23 | "\n",
24 | "where `CourseNumber` is the course in which you're enrolled (CS 109a, Stats 121a, AC 209a). Submit your assignment in Vocareum using the 'Submit' button.\n",
25 | "\n",
26 | "**Avoid editing your file in Vocareum after uploading. If you need to make a change in a solution. Delete your old solution file from Vocareum and upload a new solution. Click submit only ONCE after verifying that you have uploaded the correct file. The assignment will CLOSE after you click the submit button.**\n",
27 | "\n",
28 | "Problems on homework assignments are equally weighted. The Challenge Question is required for AC 209A students and optional for all others. Student who complete the Challenge Problem as optional extra credit will receive +0.5% towards your final grade for each correct solution. "
29 | ]
30 | },
31 | {
32 | "cell_type": "markdown",
33 | "metadata": {},
34 | "source": [
35 | "Import libraries"
36 | ]
37 | },
38 | {
39 | "cell_type": "code",
40 | "execution_count": 2,
41 | "metadata": {
42 | "collapsed": false
43 | },
44 | "outputs": [],
45 | "source": [
46 | "import numpy as np\n",
47 | "import pandas as pd\n",
48 | "from sklearn.linear_model import LinearRegression as Lin_Reg\n",
49 | "from sklearn.linear_model import Ridge as Ridge_Reg\n",
50 | "from sklearn.linear_model import Lasso as Lasso_Reg\n",
51 | "from statsmodels.regression.linear_model import OLS\n",
52 | "import sklearn.preprocessing as Preprocessing\n",
53 | "import itertools as it\n",
54 | "import matplotlib\n",
55 | "import matplotlib.pyplot as plt\n",
56 | "import matplotlib.cm as cmx\n",
57 | "import matplotlib.colors as colors\n",
58 | "import scipy as sp\n",
59 | "from itertools import combinations\n",
60 | "%matplotlib inline"
61 | ]
62 | },
63 | {
64 | "cell_type": "markdown",
65 | "metadata": {},
66 | "source": [
67 | "## Problem 0: Basic Information\n",
68 | "\n",
69 | "Fill in your basic information. \n",
70 | "\n",
71 | "### Part (a): Your name"
72 | ]
73 | },
74 | {
75 | "cell_type": "markdown",
76 | "metadata": {},
77 | "source": [
78 | "[Last, First]"
79 | ]
80 | },
81 | {
82 | "cell_type": "markdown",
83 | "metadata": {},
84 | "source": [
85 | "### Part (b): Course Number"
86 | ]
87 | },
88 | {
89 | "cell_type": "markdown",
90 | "metadata": {},
91 | "source": [
92 | "[CS 109a or STATS 121a or AC 209a]"
93 | ]
94 | },
95 | {
96 | "cell_type": "markdown",
97 | "metadata": {},
98 | "source": [
99 | "### Part (c): Who did you work with?"
100 | ]
101 | },
102 | {
103 | "cell_type": "markdown",
104 | "metadata": {},
105 | "source": [
106 | "[First and Land names of students with whom you have collaborated]"
107 | ]
108 | },
109 | {
110 | "cell_type": "markdown",
111 | "metadata": {},
112 | "source": [
113 | "**All data sets can be found in the ``datasets`` folder and are in comma separated value (CSV) format**"
114 | ]
115 | },
116 | {
117 | "cell_type": "markdown",
118 | "metadata": {},
119 | "source": [
120 | "## Problem 1: Variable selection and regularization\n",
121 | "\n",
122 | "The data set for this problem is provided in ``dataset_1.txt`` and contains 10 predictors and a response variable.\n",
123 | "\n",
124 | "### Part (a): Analyze correlation among predictors\n",
125 | "- By visually inspecting the data set, do find that some of the predictors are correlated amongst themselves?\n",
126 | "\n",
127 | "\n",
128 | "- Compute the cofficient of correlation between each pair of predictors, and visualize the matrix of correlation coefficients using a heat map. Do the predictors fall naturally into groups based on the correlation values?\n",
129 | "\n",
130 | "\n",
131 | "- If you were asked to select a minimal subset of predictors based on the correlation information in order to build a good regression model, how many predictors will you pick, and which ones will you choose? "
132 | ]
133 | },
134 | {
135 | "cell_type": "markdown",
136 | "metadata": {},
137 | "source": [
138 | "### Part (b): Selecting minimal subset of predictors\n",
139 | "\n",
140 | "- Apply the variable selection methods discussed in class to choose a minimal subset of predictors that yield high prediction accuracy:\n",
141 | " \n",
142 | " - Exhaustive search\n",
143 | " \n",
144 | " - Step-wise forward selection **or** Step-wise backward selection \n",
145 | "\n",
146 | " In each method, use the Bayesian Information Criterion (BIC) to choose the subset size.\n",
147 | "\n",
148 | "- Do the chosen subsets match the ones you picked using the correlation matrix you had visualized in Part (a)?\n",
149 | "\n",
150 | "**Note**: You may use the `statsmodels`'s `OLS` module to fit a linear regression model and evaluate BIC. You may **not** use library functions that implement variable selection."
151 | ]
152 | },
153 | {
154 | "cell_type": "markdown",
155 | "metadata": {},
156 | "source": [
157 | "### Part (c): Apply Lasso and Ridge regression\n",
158 | "\n",
159 | "- Apply Lasso regression with regularization parameter $\\lambda = 0.01$ and fit a regression model.\n",
160 | "\n",
161 | " - Identify the predictors that are assigned non-zero coefficients. Do these correspond to the correlation matrix in Part (a)?\n",
162 | "\n",
163 | "\n",
164 | "- Apply Ridge regression with regularization parameter $\\lambda = 0.01$ and fit a regression model.\n",
165 | "\n",
166 | " - Is there a difference between the model parameters you obtain different and those obtained from Lasso regression? If so, explain why.\n",
167 | "\n",
168 | " - Identify the predictors that are assigned non-zero coefficients. Do these correspond to the correlation matrix in Part (a)?\n",
169 | "\n",
170 | "\n",
171 | "- Is there anything peculiar that you observe about the coefficients Ridge regression assigns to the first three predictors? Do you observe the same with Lasso regression? Give an explanation for your observation.\n",
172 | "\n",
173 | "**Note**: You may use the `statsmodels` or `sklearn` to perform Lasso and Ridge regression."
174 | ]
175 | }
176 | ],
177 | "metadata": {
178 | "anaconda-cloud": {},
179 | "kernelspec": {
180 | "display_name": "Python 2",
181 | "language": "python",
182 | "name": "python2"
183 | },
184 | "language_info": {
185 | "codemirror_mode": {
186 | "name": "ipython",
187 | "version": 2
188 | },
189 | "file_extension": ".py",
190 | "mimetype": "text/x-python",
191 | "name": "python",
192 | "nbconvert_exporter": "python",
193 | "pygments_lexer": "ipython2",
194 | "version": "2.7.11"
195 | }
196 | },
197 | "nbformat": 4,
198 | "nbformat_minor": 0
199 | }
200 |
--------------------------------------------------------------------------------
/Lab_4/lab4.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_4/lab4.pdf
--------------------------------------------------------------------------------
/Lab_5/Advanced_Pandas/Advanced_Pandas.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# Merging, Grouping and Sythnesizing Data in Pandas\n",
8 | "# CS 109A/AC 209A/STAT 121A Data Science: Lab 5\n",
9 | "**Harvard University**
\n",
10 | "**Fall 2016**
\n",
11 | "**Instructors: W. Pan, P. Protopapas, K. Rader**
"
12 | ]
13 | },
14 | {
15 | "cell_type": "code",
16 | "execution_count": 2,
17 | "metadata": {
18 | "collapsed": true
19 | },
20 | "outputs": [],
21 | "source": [
22 | "#Import libraries\n",
23 | "import pandas as pd\n",
24 | "import numpy as np\n",
25 | "import matplotlib.pyplot as plt\n",
26 | "%matplotlib inline"
27 | ]
28 | },
29 | {
30 | "cell_type": "markdown",
31 | "metadata": {},
32 | "source": [
33 | "## How to synthesize data from multiple sources\n",
34 | "\n",
35 | "This simple data scraping exercise is designed to show you how to combine data frames. Often in data science you will be bringing together data from different places to answer new and interesting questions.\n",
36 | "\n",
37 | "Your goal here is to make a scatter plot of cheese consumption versus cardiovascular disease rates for countries of the world, however you must first combine these data. Let's start by loading them.\n",
38 | "\n",
39 | "Load `cheese.csv` and `cardio_disease.csv`. Examine your data."
40 | ]
41 | },
42 | {
43 | "cell_type": "markdown",
44 | "metadata": {},
45 | "source": [
46 | "## Joining dataframes and plotting\n",
47 | "\n",
48 | "Pandas has functionality to combine the two data frames and sort them by a key. Read the documentation here for information on how to do this: http://pandas.pydata.org/pandas-docs/stable/merging.html\n",
49 | "\n",
50 | "1. Merge the infromation in the two data frames by country, using the `merge` function. Why won't concatenating the dataframes work?\n",
51 | "```\n",
52 | "pd.merge(df1, df2, ...)\n",
53 | "```\n",
54 | "\n",
55 | "2. Make a scatter plot of cheese consumption versus cardiovascular disease\n",
56 | "\n",
57 | "3. What do you notice in the relationship between these variables?"
58 | ]
59 | },
60 | {
61 | "cell_type": "markdown",
62 | "metadata": {},
63 | "source": [
64 | "## Data scraping issues\n",
65 | "\n",
66 | "What countries included in the merged data frame? How do they compare to the countries in the original frames?\n",
67 | "\n",
68 | "What difficulties do you anticipate when merging dataframes like this? For example, from disparate sources, the same country may be spelled differently. How would you identify and deal with such issues?"
69 | ]
70 | },
71 | {
72 | "cell_type": "markdown",
73 | "metadata": {},
74 | "source": [
75 | "## Grouping Data in Pandas Data Frames\n",
76 | "\n",
77 | "Say we want to split the data frame into two subsets: those countries whose cheese consumption is above the world mean and those countries whose cheese consumption is below the world mean.\n",
78 | "\n",
79 | "We could do this by filtering the data frame and record the two subsets each as a data frame, but later we might have to recombine the data! Instead we can create groups within one data frame using `pandas`' `groupby` functionality.\n",
80 | "\n",
81 | "1. First define two bins of values for the cheese colum to separate the values into those below the mean and those above the mean. Store the end points of your bins in a list:\n",
82 | "```\n",
83 | "[0, cheese_mean, cheese_max]\n",
84 | "```\n",
85 | "\n",
86 | "2. Use `pandas`' `cut` functionality to sort each cheese value into one of the bins:\n",
87 | "```\n",
88 | "pd.cut(cheese_values, bins=[0, cheese_mean, cheese_max])\n",
89 | "```\n",
90 | "\n",
91 | "3. Group the data in your data frame into two groups, those whose cheese assumption falls into the first bin, and those that fall into the second:\n",
92 | "```\n",
93 | "df.groupby(the cut you just made in step 2)\n",
94 | "```\n",
95 | "\n",
96 | "4. Play around with the object returned by `groupby`, try accessing each of the groups, using `get_group`.\n",
97 | "\n",
98 | "5. Now, we want to compute the stats for the mortality column by group. Try applying the `mean` function to the mortality column in the `groupby` object you got from step 4. What does the result look like?\n",
99 | "\n",
100 | "6. If you want to apply a list of functions to the mortality column, you can use the `aggregate` function:\n",
101 | "```\n",
102 | "df['column'].agg([function_1, funciton_2, ...])\n",
103 | "```\n",
104 | "\n",
105 | "7. Use `aggregate` to compute the mean and the std of the mortality column in your grouped dataframe. What does the result look like? Try to access each value in the resuliting structure."
106 | ]
107 | }
108 | ],
109 | "metadata": {
110 | "kernelspec": {
111 | "display_name": "Python 2",
112 | "language": "python",
113 | "name": "python2"
114 | },
115 | "language_info": {
116 | "codemirror_mode": {
117 | "name": "ipython",
118 | "version": 2
119 | },
120 | "file_extension": ".py",
121 | "mimetype": "text/x-python",
122 | "name": "python",
123 | "nbconvert_exporter": "python",
124 | "pygments_lexer": "ipython2",
125 | "version": "2.7.11"
126 | }
127 | },
128 | "nbformat": 4,
129 | "nbformat_minor": 0
130 | }
131 |
--------------------------------------------------------------------------------
/Lab_5/Advanced_Pandas/cardio_disease.csv:
--------------------------------------------------------------------------------
1 | Country,Age-standardized mortality rate by cause (per 100 000 population)
2 | Bahamas,220.0
3 | Bahrain,187.2
4 | Bangladesh,166.2
5 | Barbados,128.1
6 | Belarus,464.2
7 | Belgium,111.1
8 | Belize,190.7
9 | Benin,372.5
10 | Bhutan,194.3
11 | Bolivia (Plurinational State of),269.5
12 | Bosnia and Herzegovina,310.7
13 | Botswana,323.7
14 | Brazil,214.2
15 | Brunei Darussalam,211.1
16 | Bulgaria,406.3
17 | Burkina Faso,373.7
18 | Burundi,311.6
19 | Cote d'Ivoire,336.1
20 | Cabo Verde,249.9
21 | Cambodia,184.7
22 | Cameroon,285.7
23 | Canada,88.6
24 | Central African Republic,244.4
25 | Chad,306.6
26 | Chile,115.1
27 | China,300.0
28 | Colombia,150.2
29 | Comoros,329.6
30 | Congo,334.5
31 | Costa Rica,140.1
32 | Croatia,237.4
33 | Cuba,185.0
34 | Cyprus,137.9
35 | Czech Republic,239.0
36 | Democratic People's Republic of Korea,351.6
37 | Democratic Republic of the Congo,359.6
38 | Denmark,108.3
39 | Djibouti,277.1
40 | Dominican Republic,198.9
41 | Ecuador,149.3
42 | Egypt,445.1
43 | El Salvador,171.0
44 | Equatorial Guinea,357.6
45 | Eritrea,327.3
46 | Estonia,272.1
47 | Ethiopia,161.6
48 | Fiji,372.3
49 | Finland,145.9
50 | France,85.6
51 | Gabon,241.7
52 | Gambia,299.6
53 | Georgia,428.7
54 | Germany,142.7
55 | Ghana,340.6
56 | Greece,175.9
57 | Guatemala,122.9
58 | Guinea,313.4
59 | Guinea-Bissau,370.5
60 | Guyana,544.8
61 | Haiti,384.1
62 | Honduras,200.5
63 | Hungary,293.3
64 | Iceland,103.3
65 | India,306.3
66 | Indonesia,371.0
67 | Iran (Islamic Republic of),350.2
68 | Iraq,420.7
69 | Ireland,118.7
70 | Israel,86.0
71 | Italy,105.5
72 | Jamaica,232.6
73 | Japan,81.6
74 | Jordan,326.4
75 | Kazakhstan,635.5
76 | Kenya,205.0
77 | Kuwait,239.0
78 | Kyrgyzstan,549.4
79 | Lao People's Democratic Republic,346.2
80 | Latvia,361.1
81 | Lebanon,213.8
82 | Lesotho,306.7
83 | Liberia,248.4
84 | Libya,320.4
85 | Lithuania,322.5
86 | Luxembourg,107.9
87 | Madagascar,352.3
88 | Malawi,336.5
89 | Malaysia,295.8
90 | Maldives,244.3
91 | Mali,395.7
92 | Malta,151.8
93 | Mauritania,262.6
94 | Mauritius,207.3
95 | Mexico,148.3
96 | Mongolia,586.7
97 | Montenegro,366.7
98 | Morocco,330.5
99 | Mozambique,213.5
100 | Myanmar,317.8
101 | Namibia,302.9
102 | Nepal,270.6
103 | Netherlands,104.8
104 | New Zealand,103.8
105 | Nicaragua,227.8
106 | Niger,317.7
107 | Nigeria,266.5
108 | Norway,111.5
109 | Oman,244.9
110 | Pakistan,274.2
111 | Panama,151.3
112 | Papua New Guinea,148.5
113 | Paraguay,219.7
114 | Peru,122.6
115 | Philippines,376.9
116 | Poland,253.4
117 | Portugal,113.1
118 | Qatar,157.0
119 | Republic of Korea,92.3
120 | Republic of Moldova,507.7
121 | Romania,363.9
122 | Russian Federation,531.0
123 | Rwanda,261.7
124 | Saudi Arabia,338.1
125 | Senegal,198.6
126 | Serbia,360.0
127 | Sierra Leone,436.0
128 | Singapore,107.7
129 | Slovakia,305.9
130 | Slovenia,141.2
131 | Solomon Islands,256.7
132 | Somalia,213.4
133 | South Africa,298.3
134 | South Sudan,249.9
135 | Spain,96.8
136 | Sri Lanka,271.4
137 | Sudan,225.6
138 | Suriname,155.9
139 | Swaziland,295.8
140 | Sweden,132.0
141 | Switzerland,97.9
142 | Syrian Arab Republic,375.6
143 | Tajikistan,510.3
144 | Thailand,183.8
145 | The former Yugoslav republic of Macedonia,405.6
146 | Timor-Leste,346.6
147 | Togo,307.4
148 | Trinidad and Tobago,278.6
149 | Tunisia,308.3
150 | Turkey,310.3
151 | Turkmenistan,712.1
152 | Uganda,263.8
153 | Ukraine,536.1
154 | United Arab Emirates,297.6
155 | United Kingdom of Great Britain and Northern Ireland,111.8
156 | United Republic of Tanzania,202.9
157 | United States of America,136.0
158 | Uruguay,147.4
159 | Uzbekistan,577.7
160 | Venezuela (Bolivarian Republic of),187.3
161 | Viet Nam,192.6
162 | Yemen,377.0
163 | Zambia,271.7
164 | Zimbabwe,197.1
165 |
--------------------------------------------------------------------------------
/Lab_5/Advanced_Pandas/cheese.csv:
--------------------------------------------------------------------------------
1 | AreaName,Cheese
2 | Afghanistan,23.34
3 | Africa,23.34
4 | Albania,93.51
5 | Algeria,11.88
6 | Americas,145.67
7 | Angola,3.76
8 | Antigua and Barbuda,60.6
9 | Argentina,222.13
10 | Armenia,55.78
11 | Asia,10.76
12 | Australia,217.26
13 | Australia & New Zealand,202.25
14 | Austria,408.13
15 | Azerbaijan,103.12
16 | Bahamas,121.53
17 | Bangladesh,0.23
18 | Barbados,151.62
19 | Belarus,77.09
20 | Belgium,238.59
21 | Belgium-Luxembourg,138.96
22 | Belize,73.92
23 | Benin,0.6
24 | Bermuda,151.59
25 | Bolivia (Plurinational State of),20.6
26 | Bosnia and Herzegovina,75.88
27 | Botswana,55.38
28 | Brazil,8.02
29 | Brunei Darussalam,17.74
30 | Bulgaria,196.95
31 | Burkina Faso,0.25
32 | Cabo Verde,13.49
33 | Cambodia,0.08
34 | Cameroon,0.43
35 | Canada,257.33
36 | Caribbean,27.23
37 | Central African Republic,0.25
38 | Central America,42.95
39 | Central Asia,17.83
40 | Chad,0.09
41 | Chile,78.61
42 | China,4.26
43 | "China, Hong Kong SAR",27.92
44 | "China, Macao SAR",15.02
45 | "China, Taiwan Province of",10.47
46 | "China, mainland",4.06
47 | Colombia,30.49
48 | Congo,1.51
49 | Costa Rica,45.96
50 | Croatia,127.83
51 | Cuba,34.54
52 | Cyprus,124.66
53 | Czech Republic,257.57
54 | Czechoslovakia,33.96
55 | Côte d'Ivoire,0.77
56 | Democratic People's Republic of Korea,
57 | Denmark,399.32
58 | Djibouti,6.21
59 | Dominica,67.39
60 | Dominican Republic,14.61
61 | Eastern Africa,1.71
62 | Eastern Asia,12.21
63 | Eastern Europe,136.24
64 | Ecuador,70.37
65 | Egypt,154.59
66 | El Salvador,49.68
67 | Estonia,185.63
68 | Ethiopia,1.41
69 | Ethiopia PDR,0.18
70 | Europe,260.74
71 | European Union,332.52
72 | Fiji,8.69
73 | Finland,327.67
74 | France,510.65
75 | French Polynesia,116.61
76 | Gabon,9.68
77 | Gambia,2.09
78 | Georgia,2.03
79 | Germany,414.51
80 | Ghana,0.22
81 | Greece,566.74
82 | Grenada,97.3
83 | Guatemala,29.33
84 | Guinea,0.38
85 | Guinea-Bissau,0.41
86 | Guyana,26.81
87 | Haiti,1.92
88 | Honduras,43.38
89 | Hungary,197.17
90 | Iceland,400.28
91 | India,0.03
92 | Indonesia,0.82
93 | Iran (Islamic Republic of),81.78
94 | Iraq,26.64
95 | Ireland,204.17
96 | Israel,381.35
97 | Italy,463.94
98 | Jamaica,32.18
99 | Japan,51.34
100 | Jordan,56.72
101 | Kazakhstan,27.74
102 | Kenya,0.26
103 | Kiribati,1.12
104 | Kuwait,118.2
105 | Kyrgyzstan,6.37
106 | Land Locked Developing Countries,15.49
107 | Lao People's Democratic Republic,0.03
108 | Latvia,129.51
109 | Least Developed Countries,10.8
110 | Lebanon,212.91
111 | Lesotho,3.65
112 | Liberia,0.68
113 | Lithuania,172.46
114 | Low Income Food Deficit Countries,4.8
115 | Luxembourg,140.53
116 | Madagascar,0.37
117 | Malawi,0.11
118 | Malaysia,4.62
119 | Maldives,1.06
120 | Mali,0.24
121 | Malta,260.54
122 | Mauritania,20.09
123 | Mauritius,44.18
124 | Melanesia,20.53
125 | Mexico,41.95
126 | Micronesia,1.12
127 | Middle Africa,1.89
128 | Mongolia,14.07
129 | Montenegro,97.63
130 | Morocco,15.48
131 | Mozambique,0.57
132 | Myanmar,20.86
133 | Namibia,20.41
134 | Nepal,0.03
135 | Net Food Importing Developing Countries,21.96
136 | Netherlands,404.31
137 | Netherlands Antilles,259.9
138 | New Caledonia,118.93
139 | New Zealand,126.91
140 | Nicaragua,45.83
141 | Niger,80.17
142 | Nigeria,1.45
143 | Northern Africa,87.89
144 | Northern America,310.47
145 | Northern Europe,250.42
146 | Norway,326.7
147 | Oceania,187.91
148 | Oman,70.48
149 | Pakistan,0.07
150 | Panama,89.71
151 | Paraguay,3.1
152 | Peru,11.75
153 | Philippines,4.02
154 | Poland,252.87
155 | Polynesia,69.07
156 | Portugal,179.58
157 | Republic of Korea,12.99
158 | Republic of Moldova,33.47
159 | Romania,68.98
160 | Russian Federation,91.98
161 | Rwanda,0.01
162 | Saint Kitts and Nevis,87.25
163 | Saint Lucia,115.11
164 | Saint Vincent and the Grenadines,50.39
165 | Samoa,4.58
166 | Sao Tome and Principe,1.3
167 | Saudi Arabia,48.59
168 | Senegal,2.23
169 | Serbia,12.48
170 | Serbia and Montenegro,21.14
171 | Sierra Leone,0.87
172 | Slovakia,171.08
173 | Slovenia,214.25
174 | Small Island Developing States,25.39
175 | Solomon Islands,0.97
176 | South Africa,20.29
177 | South America,48.01
178 | South-Eastern Asia,3.35
179 | Southern Africa,20.82
180 | Southern Asia,4.11
181 | Southern Europe,299.05
182 | Spain,153.29
183 | Sri Lanka,1.02
184 | Sudan (former),86.67
185 | Suriname,22.74
186 | Swaziland,16.32
187 | Sweden,382.95
188 | Switzerland,379.03
189 | Tajikistan,29.61
190 | Thailand,1.77
191 | The former Yugoslav Republic of Macedonia,62.07
192 | Timor-Leste,0.24
193 | Togo,0.46
194 | Trinidad and Tobago,92.1
195 | Tunisia,10.36
196 | Turkey,47.05
197 | Turkmenistan,11.29
198 | USSR,13.02
199 | Uganda,0.0
200 | Ukraine,51.92
201 | United Arab Emirates,110.99
202 | United Kingdom,212.94
203 | United Republic of Tanzania,3.13
204 | United States of America,316.24
205 | Uruguay,131.15
206 | Uzbekistan,12.32
207 | Vanuatu,5.39
208 | Venezuela (Bolivarian Republic of),112.6
209 | Viet Nam,0.45
210 | Western Africa,5.11
211 | Western Asia,78.34
212 | Western Europe,440.67
213 | World,62.29
214 | Yemen,28.9
215 | Yugoslav SFR,13.68
216 | Zambia,2.43
217 | Zimbabwe,5.71
218 |
--------------------------------------------------------------------------------
/Lab_5/Maps/California_County/CaliforniaCounty.dbf:
--------------------------------------------------------------------------------
1 | p
2 | : A% W STATEFP C COUNTYFP C COUNTYNS C GEOID C NAME C d NAMELSAD C d LSAD C CLASSFP C MTFCC C CSAFP C CBSAFP C METDIVFP C FUNCSTAT C ALAND N AWATER N INTPTLAT C INTPTLON C
061070027731806107Tulare Tulare County 06H1G4020 47300 A 12494707314 37391604+36.2288317-118.7810618 060090167588506009Calaveras Calaveras County 06H1G4020 A 2641820029 43810423+38.1846184-120.5593996 060470027728806047Merced Merced County 06H1G4020 32900 A 5011554680 112760479+37.1948063-120.7228019 060790027730406079San Luis Obispo San Luis Obispo County 06H1G4020 42020 A 8543230300 820974619+35.3852268-120.4475409 060970165724606097Sonoma Sonoma County 06H1G402048842220 A 4081430061 497530414+38.5250258-122.9376050 060410027728506041Marin Marin County 06H1G40204884186041884A 1347585499 797420416+38.0518169-122.7459738 060230168190806023Humboldt Humboldt County 06H1G4020 21700 A 9241033283 1254256391+40.7066731-123.9258181 060510027729006051Mono Mono County 06H1G4020 A 7896837613 214695460+37.9158363-118.8751668 060150168207406015Del Norte Del Norte County 06H1G4020 18860 A 2606493818 578525693+41.7499033-123.9809983 060110167590206011Colusa Colusa County 06H1G4020 A 2980379346 14581041+39.1777385-122.2375629 060010167583906001Alameda Alameda County 06H1G40204884186036084A 1914046027 213184599+37.6481344-121.9132907 060170027727306017El Dorado El Dorado County 06H1G402047240900 A 4423479275 203243214+38.7855320-120.5343981 061010027731506101Sutter Sutter County 06H1G402047249700 A 1560235633 15746971+39.0352571-121.7027576 060310027728006031Kings Kings County 06H1G4020 25260 A 3598582294 5468555+36.0724780-119.8155301 060910027731006091Sierra Sierra County 06H1G4020 A 2468813788 23299119+39.5769252-120.5219926 060350169332406035Lassen Lassen County 06H1G4020 45000 A 11761611012 463440568+40.7210889-120.6299314 060330027728106033Lake Lake County 06H1G4020 17340 A 3254227914 188962271+39.0948019-122.7467569 061030169276706103Tehama Tehama County 06H1G4020 39780 A 7639709840 32276052+40.1261561-122.2322757 060750027730206075San Francisco San Francisco County 06H6G40204884186041884C 121399974 479190304+37.7272391-123.0322294 060030167584006003Alpine Alpine County 06H1G4020 A 1912258488 12557258+38.6176096-119.7989986 060390027728406039Madera Madera County 06H1G402026031460 A 5534991772 41957465+37.2100389-119.7498523 060670027729806067Sacramento Sacramento County 06H1G402047240900 A 2498415674 76077251+38.4500114-121.3404409 060830027730606083Santa Barbara Santa Barbara County 06H1G4020 42060 A 7083840862 2729829247+34.5372477-120.0379149 060630027729606063Plumas Plumas County 06H1G4020 A 6612349181 156395465+39.9951699-120.8295155 060490027728906049Modoc Modoc County 06H1G4020 A 10146978597 739773099+41.5929185-120.7183704 060950027731206095Solano Solano County 06H1G402048846700 A 2128361321 218665858+38.2672255-121.9395940 061110027732006111Ventura Ventura County 06H1G402034837100 A 4773692753 945991577+34.3587415-119.1331432 060870027730806087Santa Cruz Santa Cruz County 06H1G402048842100 A 1152986026 419544681+37.0124883-122.0072050 061150027732206115Yuba Yuba County 06H1G402047249700 A 1636454153 30998579+39.2700256-121.3442802 061090027731906109Tuolumne Tuolumne County 06H1G4020 38020 A 5752110778 138683502+38.0214510-119.9647084 060550027729206055Napa Napa County 06H1G402048834900 A 1938247426 104169243+38.5073511-122.3259947 060930027731106093Siskiyou Siskiyou County 06H1G4020 A 16259596390 179889136+41.5879861-122.5332868 060610027729506061Placer Placer County 06H1G402047240900 A 3644135947 247205404+39.0620324-120.7227181 060210027727506021Glenn Glenn County 06H1G4020 A 3403106731 33750200+39.6025462-122.4016998 061050027731706105Trinity Trinity County 06H1G4020 A 8234245879 73407846+40.6477241-123.1144043 060270180463706027Inyo Inyo County 06H1G4020 13860 A 26368595331 119060673+36.5619770-117.4039269 060690027729906069San Benito San Benito County 06H1G402048841940 A 3596742315 4555039+36.6107024-121.0852960 060530027729106053Monterey Monterey County 06H1G4020 41500 A 8496702808 1270738554+36.2401070-121.3155732 060730027730106073San Diego San Diego County 06H1G4020 41740 A 10895054821 826347910+33.0236041-116.7761174 060430027728606043Mariposa Mariposa County 06H1G4020 A 3752426079 36271389+37.5700335-119.9128599 060570168292706057Nevada Nevada County 06H1G402047246020 A 2480617036 41514869+39.2951907-120.7734456 060450027728706045Mendocino Mendocino County 06H1G4020 46380 A 9081419701 962952585+39.4323876-123.4428811 061130027732106113Yolo Yolo County 06H1G402047240900 A 2628023662 22969141+38.6796077-121.9024305 060250027727706025Imperial Imperial County 06H1G4020 20940 A 10817343904 790233986+33.0408155-115.3553946 060990027731406099Stanislaus Stanislaus County 06H1G4020 33700 A 3871425866 51399034+37.5623842-121.0026557 060290205417606029Kern Kern County 06H1G4020 12540 A 21061565069 79577119+35.3466288-118.7295064 060130167590306013Contra Costa Contra Costa County 06H1G40204884186036084A 1854268998 227485305+37.9194790-121.9515431 060190027727406019Fresno Fresno County 06H1G402026023420 A 15431122239 137815919+36.7610058-119.6550193 060850027730706085Santa Clara Santa Clara County 06H1G402048841940 A 3341311200 36175011+37.2207774-121.6906224 060810027730506081San Mateo San Mateo County 06H1G40204884186041884A 1161372608 757703595+37.4146639-122.3715417 060070167584206007Butte Butte County 06H1G4020 17020 A 4238423210 105325747+39.6659588-121.6019188 060770027730306077San Joaquin San Joaquin County 06H1G4020 44700 A 3603544217 91108670+37.9350336-121.2722369 060050167584106005Amador Amador County 06H1G4020 A 1539962945 29456580+38.4435501-120.6538563 060890168261006089Shasta Shasta County 06H1G4020 39820 A 9778203379 186530836+40.7605215-122.0435495 060650027729706065Riverside Riverside County 06H1G402034840140 A 18664126701 251073450+33.7298275-116.0022389 060370027728306037Los Angeles Los Angeles County 06H1G40203483110031084A 10509870524 1795012008+34.1963983-118.2618616 060590027729406059Orange Orange County 06H1G40203483110042044A 2047561073 407916803+33.6756872-117.7772068 060710027730006071San Bernardino San Bernardino County 06H1G402034840140 A 51947750922 124028339+34.8572198-116.1811967
--------------------------------------------------------------------------------
/Lab_5/Maps/California_County/CaliforniaCounty.shp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_5/Maps/California_County/CaliforniaCounty.shp
--------------------------------------------------------------------------------
/Lab_5/Maps/California_County/CaliforniaCounty.shx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_5/Maps/California_County/CaliforniaCounty.shx
--------------------------------------------------------------------------------
/Lab_5/Maps/California_County/California_County.prj:
--------------------------------------------------------------------------------
1 | GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
--------------------------------------------------------------------------------
/Lab_5/Maps/California_County/California_County.sbn:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_5/Maps/California_County/California_County.sbn
--------------------------------------------------------------------------------
/Lab_5/Maps/California_County/California_County.sbx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_5/Maps/California_County/California_County.sbx
--------------------------------------------------------------------------------
/Lab_5/Maps/Map_Drawing.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# Map Drawing and Geolocation Plotting \n",
8 | "# CS 109A/AC 209A/STAT 121A Data Science: Lab 5\n",
9 | "**Harvard University**
\n",
10 | "**Fall 2016**
\n",
11 | "**Instructors: W. Pan, P. Protopapas, K. Rader**
"
12 | ]
13 | },
14 | {
15 | "cell_type": "code",
16 | "execution_count": 2,
17 | "metadata": {
18 | "collapsed": true
19 | },
20 | "outputs": [],
21 | "source": [
22 | "import pandas as pd\n",
23 | "\n",
24 | "# Import the basemap package\n",
25 | "from mpl_toolkits.basemap import Basemap\n",
26 | "from matplotlib.patches import Polygon"
27 | ]
28 | },
29 | {
30 | "cell_type": "markdown",
31 | "metadata": {},
32 | "source": [
33 | "## How to Plot Data on Maps\n",
34 | "\n",
35 | "This a data visualization exercise that is designed to show you how to draw maps with regional details in `python`. \n",
36 | "\n",
37 | "Your goal is to extract the longitude, latitude information from a data set and visualize the data as points on a map with regional details.\n",
38 | "\n",
39 | "1. Load `WIC.csv`, this is a data set describing authorized WIC service providers. Examine your data.\n",
40 | "\n",
41 | "2. Clean the data set. Form an array of logitudes from the location information, do the same for latitudes. (Use only `.apply` to do the extraction)\n",
42 | "\n",
43 | "3. Create a map of California using `Basemap`. You can follow the basic tutorial [here](https://www.getdatajoy.com/examples/python-plots/plot-data-points-on-a-map). **Hint:** You need to get the longitude, latitude values of a bounding box around the state of California, use Google Map to get these values of the corners of your box.\n",
44 | "\n",
45 | "4. The map you produce from step 3 will be crude. You can add some regional information, like county lines, to your map by plotting \"shape data\". Do this by reading the shape file contained in `California_County`:\n",
46 | "```\n",
47 | "my_map.readshapefile('./California_County/CaliforniaCounty', ...)\n",
48 | "```\n",
49 | "\n",
50 | "5. Plot the `WIC` data points on the final map of California with county lines. "
51 | ]
52 | },
53 | {
54 | "cell_type": "code",
55 | "execution_count": null,
56 | "metadata": {
57 | "collapsed": true
58 | },
59 | "outputs": [],
60 | "source": []
61 | }
62 | ],
63 | "metadata": {
64 | "kernelspec": {
65 | "display_name": "Python 2",
66 | "language": "python",
67 | "name": "python2"
68 | },
69 | "language_info": {
70 | "codemirror_mode": {
71 | "name": "ipython",
72 | "version": 2
73 | },
74 | "file_extension": ".py",
75 | "mimetype": "text/x-python",
76 | "name": "python",
77 | "nbconvert_exporter": "python",
78 | "pygments_lexer": "ipython2",
79 | "version": "2.7.11"
80 | }
81 | },
82 | "nbformat": 4,
83 | "nbformat_minor": 0
84 | }
85 |
--------------------------------------------------------------------------------
/Lab_5/Text Analysis/Text_Analysis.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# Text Analysis \n",
8 | "# CS 109A/AC 209A/STAT 121A Data Science: Lab 5\n",
9 | "**Harvard University**
\n",
10 | "**Fall 2016**
\n",
11 | "**Instructors: W. Pan, P. Protopapas, K. Rader**
"
12 | ]
13 | },
14 | {
15 | "cell_type": "code",
16 | "execution_count": 35,
17 | "metadata": {
18 | "collapsed": true
19 | },
20 | "outputs": [],
21 | "source": [
22 | "import pandas as pd\n",
23 | "from sklearn.feature_extraction.text import CountVectorizer\n",
24 | "from sklearn.neighbors import KNeighborsClassifier as KNN"
25 | ]
26 | },
27 | {
28 | "cell_type": "markdown",
29 | "metadata": {},
30 | "source": [
31 | "## How to Process Textual Data\n",
32 | "\n",
33 | "This exercise is designed to help you transform and model textual data. You may find the tutorial [here](http://scikit-learn.org/stable/modules/feature_extraction.html) helpful.\n",
34 | "\n",
35 | "Your goal is to vectorize a small set of twitter data and predict the polarity (a property of the content of tweet) of tweets using KNN.\n",
36 | "\n",
37 | "1. Load `tweet.csv`, this is a data set containing tweets and their polarity.\n",
38 | "\n",
39 | "2. Using `CountVectorizer`, turn each tweet into a vector of features. Play with the values for `min_df`, `max_df` and `stop_words`.\n",
40 | "\n",
41 | "3. Get the names of the features you produced, using `get_feature_names`.\n",
42 | "\n",
43 | "3. Split the data set into train and test (make sure there are both types of polarity present in train)\n",
44 | "\n",
45 | "4. Use KNN to predict the polarity of the test tweets. How good is your model? What is the effect of your choice of `min_df`, `max_df` and `stop_words` on your model?"
46 | ]
47 | }
48 | ],
49 | "metadata": {
50 | "kernelspec": {
51 | "display_name": "Python 2",
52 | "language": "python",
53 | "name": "python2"
54 | },
55 | "language_info": {
56 | "codemirror_mode": {
57 | "name": "ipython",
58 | "version": 2
59 | },
60 | "file_extension": ".py",
61 | "mimetype": "text/x-python",
62 | "name": "python",
63 | "nbconvert_exporter": "python",
64 | "pygments_lexer": "ipython2",
65 | "version": "2.7.11"
66 | }
67 | },
68 | "nbformat": 4,
69 | "nbformat_minor": 0
70 | }
71 |
--------------------------------------------------------------------------------
/Lab_5/lab5.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_5/lab5.pdf
--------------------------------------------------------------------------------
/Lab_6/datasets/dataset_3_test_1.txt:
--------------------------------------------------------------------------------
1 | 7.300000000000000000e+01,7.100000000000000000e+01,7.100000000000000000e+01,6.800000000000000000e+01,6.400000000000000000e+01,0.000000000000000000e+00
2 | 5.800000000000000000e+01,5.700000000000000000e+01,7.400000000000000000e+01,7.100000000000000000e+01,5.900000000000000000e+01,0.000000000000000000e+00
3 | 6.800000000000000000e+01,6.600000000000000000e+01,7.000000000000000000e+01,7.000000000000000000e+01,6.200000000000000000e+01,0.000000000000000000e+00
4 | 8.000000000000000000e+01,7.400000000000000000e+01,8.200000000000000000e+01,7.700000000000000000e+01,7.400000000000000000e+01,0.000000000000000000e+00
5 | 7.300000000000000000e+01,8.000000000000000000e+01,8.200000000000000000e+01,8.400000000000000000e+01,7.100000000000000000e+01,0.000000000000000000e+00
6 | 5.700000000000000000e+01,4.700000000000000000e+01,6.400000000000000000e+01,7.100000000000000000e+01,6.300000000000000000e+01,0.000000000000000000e+00
7 | 7.000000000000000000e+01,6.000000000000000000e+01,7.500000000000000000e+01,7.800000000000000000e+01,6.900000000000000000e+01,0.000000000000000000e+00
8 | 6.100000000000000000e+01,5.800000000000000000e+01,6.600000000000000000e+01,7.400000000000000000e+01,6.800000000000000000e+01,0.000000000000000000e+00
9 | 6.900000000000000000e+01,8.000000000000000000e+01,6.700000000000000000e+01,6.700000000000000000e+01,6.200000000000000000e+01,0.000000000000000000e+00
10 | 7.900000000000000000e+01,7.800000000000000000e+01,6.600000000000000000e+01,6.300000000000000000e+01,6.900000000000000000e+01,0.000000000000000000e+00
11 | 4.700000000000000000e+01,4.700000000000000000e+01,4.800000000000000000e+01,6.900000000000000000e+01,8.000000000000000000e+01,0.000000000000000000e+00
12 | 7.100000000000000000e+01,7.500000000000000000e+01,7.600000000000000000e+01,7.400000000000000000e+01,7.100000000000000000e+01,0.000000000000000000e+00
13 | 7.500000000000000000e+01,7.900000000000000000e+01,6.500000000000000000e+01,7.400000000000000000e+01,6.300000000000000000e+01,0.000000000000000000e+00
14 | 5.700000000000000000e+01,6.300000000000000000e+01,6.700000000000000000e+01,8.200000000000000000e+01,6.900000000000000000e+01,0.000000000000000000e+00
15 | 7.800000000000000000e+01,7.300000000000000000e+01,6.800000000000000000e+01,7.400000000000000000e+01,6.800000000000000000e+01,0.000000000000000000e+00
16 | 7.100000000000000000e+01,7.600000000000000000e+01,7.400000000000000000e+01,7.900000000000000000e+01,7.100000000000000000e+01,0.000000000000000000e+00
17 | 7.100000000000000000e+01,5.600000000000000000e+01,7.500000000000000000e+01,7.400000000000000000e+01,6.100000000000000000e+01,0.000000000000000000e+00
18 | 7.500000000000000000e+01,7.400000000000000000e+01,6.900000000000000000e+01,7.300000000000000000e+01,6.400000000000000000e+01,0.000000000000000000e+00
19 | 6.500000000000000000e+01,7.700000000000000000e+01,6.400000000000000000e+01,6.500000000000000000e+01,5.600000000000000000e+01,0.000000000000000000e+00
20 | 6.500000000000000000e+01,5.700000000000000000e+01,5.800000000000000000e+01,5.100000000000000000e+01,7.000000000000000000e+01,0.000000000000000000e+00
21 | 5.800000000000000000e+01,6.500000000000000000e+01,7.800000000000000000e+01,7.600000000000000000e+01,6.400000000000000000e+01,0.000000000000000000e+00
22 | 6.400000000000000000e+01,5.500000000000000000e+01,6.500000000000000000e+01,5.700000000000000000e+01,6.400000000000000000e+01,0.000000000000000000e+00
23 | 7.200000000000000000e+01,6.400000000000000000e+01,6.900000000000000000e+01,7.500000000000000000e+01,6.700000000000000000e+01,0.000000000000000000e+00
24 | 6.900000000000000000e+01,7.100000000000000000e+01,7.000000000000000000e+01,7.800000000000000000e+01,6.100000000000000000e+01,0.000000000000000000e+00
25 | 7.000000000000000000e+01,6.900000000000000000e+01,6.600000000000000000e+01,6.600000000000000000e+01,6.600000000000000000e+01,0.000000000000000000e+00
26 | 6.600000000000000000e+01,6.500000000000000000e+01,7.200000000000000000e+01,7.400000000000000000e+01,5.900000000000000000e+01,0.000000000000000000e+00
27 | 6.900000000000000000e+01,5.500000000000000000e+01,7.500000000000000000e+01,7.300000000000000000e+01,6.300000000000000000e+01,0.000000000000000000e+00
28 | 5.500000000000000000e+01,6.200000000000000000e+01,6.400000000000000000e+01,6.200000000000000000e+01,6.400000000000000000e+01,0.000000000000000000e+00
29 | 5.400000000000000000e+01,4.200000000000000000e+01,5.700000000000000000e+01,6.000000000000000000e+01,6.100000000000000000e+01,0.000000000000000000e+00
30 | 5.100000000000000000e+01,4.300000000000000000e+01,6.600000000000000000e+01,6.300000000000000000e+01,5.400000000000000000e+01,0.000000000000000000e+00
31 | 6.100000000000000000e+01,6.600000000000000000e+01,7.000000000000000000e+01,7.400000000000000000e+01,5.900000000000000000e+01,0.000000000000000000e+00
32 | 7.400000000000000000e+01,6.700000000000000000e+01,6.900000000000000000e+01,7.500000000000000000e+01,5.900000000000000000e+01,0.000000000000000000e+00
33 | 6.000000000000000000e+01,5.100000000000000000e+01,7.500000000000000000e+01,6.000000000000000000e+01,6.500000000000000000e+01,0.000000000000000000e+00
34 | 7.300000000000000000e+01,7.600000000000000000e+01,6.800000000000000000e+01,7.400000000000000000e+01,5.600000000000000000e+01,0.000000000000000000e+00
35 | 6.600000000000000000e+01,8.100000000000000000e+01,7.500000000000000000e+01,7.200000000000000000e+01,6.900000000000000000e+01,0.000000000000000000e+00
36 | 7.200000000000000000e+01,7.100000000000000000e+01,7.000000000000000000e+01,7.200000000000000000e+01,6.300000000000000000e+01,0.000000000000000000e+00
37 | 7.100000000000000000e+01,7.100000000000000000e+01,7.100000000000000000e+01,7.200000000000000000e+01,7.700000000000000000e+01,0.000000000000000000e+00
38 | 7.000000000000000000e+01,6.500000000000000000e+01,6.500000000000000000e+01,6.200000000000000000e+01,6.800000000000000000e+01,0.000000000000000000e+00
39 | 5.900000000000000000e+01,7.500000000000000000e+01,7.700000000000000000e+01,8.000000000000000000e+01,6.000000000000000000e+01,0.000000000000000000e+00
40 | 7.000000000000000000e+01,6.600000000000000000e+01,6.100000000000000000e+01,6.600000000000000000e+01,6.100000000000000000e+01,0.000000000000000000e+00
41 | 6.900000000000000000e+01,6.800000000000000000e+01,7.500000000000000000e+01,7.400000000000000000e+01,7.800000000000000000e+01,0.000000000000000000e+00
42 | 7.000000000000000000e+01,6.900000000000000000e+01,6.900000000000000000e+01,6.700000000000000000e+01,6.900000000000000000e+01,0.000000000000000000e+00
43 | 7.000000000000000000e+01,6.900000000000000000e+01,6.000000000000000000e+01,6.200000000000000000e+01,5.800000000000000000e+01,0.000000000000000000e+00
44 | 6.400000000000000000e+01,5.900000000000000000e+01,7.600000000000000000e+01,7.200000000000000000e+01,5.500000000000000000e+01,0.000000000000000000e+00
45 | 7.300000000000000000e+01,6.200000000000000000e+01,6.900000000000000000e+01,7.000000000000000000e+01,7.300000000000000000e+01,0.000000000000000000e+00
46 | 4.200000000000000000e+01,5.100000000000000000e+01,7.200000000000000000e+01,5.600000000000000000e+01,7.200000000000000000e+01,0.000000000000000000e+00
47 | 6.500000000000000000e+01,6.900000000000000000e+01,6.600000000000000000e+01,7.600000000000000000e+01,5.800000000000000000e+01,0.000000000000000000e+00
48 | 6.800000000000000000e+01,6.300000000000000000e+01,6.700000000000000000e+01,6.700000000000000000e+01,6.500000000000000000e+01,0.000000000000000000e+00
49 | 6.800000000000000000e+01,7.400000000000000000e+01,7.600000000000000000e+01,8.400000000000000000e+01,7.200000000000000000e+01,0.000000000000000000e+00
50 | 4.600000000000000000e+01,4.700000000000000000e+01,6.500000000000000000e+01,6.800000000000000000e+01,4.100000000000000000e+01,0.000000000000000000e+00
51 | 7.600000000000000000e+01,5.900000000000000000e+01,8.200000000000000000e+01,7.600000000000000000e+01,8.000000000000000000e+01,0.000000000000000000e+00
52 | 5.700000000000000000e+01,2.900000000000000000e+01,7.100000000000000000e+01,5.100000000000000000e+01,6.500000000000000000e+01,0.000000000000000000e+00
53 | 6.900000000000000000e+01,6.800000000000000000e+01,7.300000000000000000e+01,7.400000000000000000e+01,6.200000000000000000e+01,0.000000000000000000e+00
54 | 3.200000000000000000e+01,4.100000000000000000e+01,7.600000000000000000e+01,3.400000000000000000e+01,6.500000000000000000e+01,0.000000000000000000e+00
55 | 6.700000000000000000e+01,5.900000000000000000e+01,5.400000000000000000e+01,4.800000000000000000e+01,6.300000000000000000e+01,0.000000000000000000e+00
56 | 6.900000000000000000e+01,6.500000000000000000e+01,7.200000000000000000e+01,6.800000000000000000e+01,7.000000000000000000e+01,0.000000000000000000e+00
57 | 3.700000000000000000e+01,2.300000000000000000e+01,7.000000000000000000e+01,6.700000000000000000e+01,5.600000000000000000e+01,0.000000000000000000e+00
58 | 5.800000000000000000e+01,7.000000000000000000e+01,6.200000000000000000e+01,7.300000000000000000e+01,3.400000000000000000e+01,0.000000000000000000e+00
59 | 6.800000000000000000e+01,7.600000000000000000e+01,7.900000000000000000e+01,7.800000000000000000e+01,6.300000000000000000e+01,0.000000000000000000e+00
60 | 6.700000000000000000e+01,7.400000000000000000e+01,7.300000000000000000e+01,7.400000000000000000e+01,5.400000000000000000e+01,0.000000000000000000e+00
61 | 5.900000000000000000e+01,5.500000000000000000e+01,5.100000000000000000e+01,6.500000000000000000e+01,6.800000000000000000e+01,0.000000000000000000e+00
62 | 6.800000000000000000e+01,6.200000000000000000e+01,6.400000000000000000e+01,6.500000000000000000e+01,7.000000000000000000e+01,0.000000000000000000e+00
63 | 6.800000000000000000e+01,4.900000000000000000e+01,6.200000000000000000e+01,5.900000000000000000e+01,6.700000000000000000e+01,0.000000000000000000e+00
64 | 7.100000000000000000e+01,7.500000000000000000e+01,7.800000000000000000e+01,7.800000000000000000e+01,6.800000000000000000e+01,1.000000000000000000e+00
65 | 6.900000000000000000e+01,6.400000000000000000e+01,7.300000000000000000e+01,7.200000000000000000e+01,4.900000000000000000e+01,1.000000000000000000e+00
66 | 6.500000000000000000e+01,6.700000000000000000e+01,6.900000000000000000e+01,7.600000000000000000e+01,6.200000000000000000e+01,1.000000000000000000e+00
67 | 7.200000000000000000e+01,6.100000000000000000e+01,6.400000000000000000e+01,6.600000000000000000e+01,6.400000000000000000e+01,1.000000000000000000e+00
68 |
--------------------------------------------------------------------------------
/Lab_6/datasets/dataset_3_test_2.txt:
--------------------------------------------------------------------------------
1 | 7.300000000000000000e+01,7.100000000000000000e+01,7.100000000000000000e+01,6.800000000000000000e+01,6.400000000000000000e+01,0.000000000000000000e+00
2 | 5.800000000000000000e+01,5.700000000000000000e+01,7.400000000000000000e+01,7.100000000000000000e+01,5.900000000000000000e+01,0.000000000000000000e+00
3 | 6.800000000000000000e+01,6.600000000000000000e+01,7.000000000000000000e+01,7.000000000000000000e+01,6.200000000000000000e+01,0.000000000000000000e+00
4 | 8.000000000000000000e+01,7.400000000000000000e+01,8.200000000000000000e+01,7.700000000000000000e+01,7.400000000000000000e+01,0.000000000000000000e+00
5 | 7.300000000000000000e+01,8.000000000000000000e+01,8.200000000000000000e+01,8.400000000000000000e+01,7.100000000000000000e+01,0.000000000000000000e+00
6 | 5.700000000000000000e+01,4.700000000000000000e+01,6.400000000000000000e+01,7.100000000000000000e+01,6.300000000000000000e+01,0.000000000000000000e+00
7 | 7.000000000000000000e+01,6.000000000000000000e+01,7.500000000000000000e+01,7.800000000000000000e+01,6.900000000000000000e+01,0.000000000000000000e+00
8 | 6.100000000000000000e+01,5.800000000000000000e+01,6.600000000000000000e+01,7.400000000000000000e+01,6.800000000000000000e+01,0.000000000000000000e+00
9 | 6.900000000000000000e+01,8.000000000000000000e+01,6.700000000000000000e+01,6.700000000000000000e+01,6.200000000000000000e+01,0.000000000000000000e+00
10 | 7.900000000000000000e+01,7.800000000000000000e+01,6.600000000000000000e+01,6.300000000000000000e+01,6.900000000000000000e+01,0.000000000000000000e+00
11 | 4.700000000000000000e+01,4.700000000000000000e+01,4.800000000000000000e+01,6.900000000000000000e+01,8.000000000000000000e+01,0.000000000000000000e+00
12 | 7.100000000000000000e+01,7.500000000000000000e+01,7.600000000000000000e+01,7.400000000000000000e+01,7.100000000000000000e+01,0.000000000000000000e+00
13 | 7.500000000000000000e+01,7.900000000000000000e+01,6.500000000000000000e+01,7.400000000000000000e+01,6.300000000000000000e+01,0.000000000000000000e+00
14 | 5.700000000000000000e+01,6.300000000000000000e+01,6.700000000000000000e+01,8.200000000000000000e+01,6.900000000000000000e+01,0.000000000000000000e+00
15 | 7.800000000000000000e+01,7.300000000000000000e+01,6.800000000000000000e+01,7.400000000000000000e+01,6.800000000000000000e+01,0.000000000000000000e+00
16 | 7.100000000000000000e+01,7.600000000000000000e+01,7.400000000000000000e+01,7.900000000000000000e+01,7.100000000000000000e+01,0.000000000000000000e+00
17 | 7.100000000000000000e+01,5.600000000000000000e+01,7.500000000000000000e+01,7.400000000000000000e+01,6.100000000000000000e+01,0.000000000000000000e+00
18 | 7.500000000000000000e+01,7.400000000000000000e+01,6.900000000000000000e+01,7.300000000000000000e+01,6.400000000000000000e+01,0.000000000000000000e+00
19 | 6.500000000000000000e+01,7.700000000000000000e+01,6.400000000000000000e+01,6.500000000000000000e+01,5.600000000000000000e+01,0.000000000000000000e+00
20 | 6.500000000000000000e+01,5.700000000000000000e+01,5.800000000000000000e+01,5.100000000000000000e+01,7.000000000000000000e+01,0.000000000000000000e+00
21 | 5.800000000000000000e+01,6.500000000000000000e+01,7.800000000000000000e+01,7.600000000000000000e+01,6.400000000000000000e+01,0.000000000000000000e+00
22 | 6.400000000000000000e+01,5.500000000000000000e+01,6.500000000000000000e+01,5.700000000000000000e+01,6.400000000000000000e+01,0.000000000000000000e+00
23 | 7.200000000000000000e+01,6.400000000000000000e+01,6.900000000000000000e+01,7.500000000000000000e+01,6.700000000000000000e+01,0.000000000000000000e+00
24 | 6.900000000000000000e+01,7.100000000000000000e+01,7.000000000000000000e+01,7.800000000000000000e+01,6.100000000000000000e+01,0.000000000000000000e+00
25 | 7.000000000000000000e+01,6.900000000000000000e+01,6.600000000000000000e+01,6.600000000000000000e+01,6.600000000000000000e+01,0.000000000000000000e+00
26 | 6.600000000000000000e+01,6.500000000000000000e+01,7.200000000000000000e+01,7.400000000000000000e+01,5.900000000000000000e+01,0.000000000000000000e+00
27 | 6.900000000000000000e+01,5.500000000000000000e+01,7.500000000000000000e+01,7.300000000000000000e+01,6.300000000000000000e+01,0.000000000000000000e+00
28 | 5.500000000000000000e+01,6.200000000000000000e+01,6.400000000000000000e+01,6.200000000000000000e+01,6.400000000000000000e+01,0.000000000000000000e+00
29 | 5.400000000000000000e+01,4.200000000000000000e+01,5.700000000000000000e+01,6.000000000000000000e+01,6.100000000000000000e+01,0.000000000000000000e+00
30 | 5.100000000000000000e+01,4.300000000000000000e+01,6.600000000000000000e+01,6.300000000000000000e+01,5.400000000000000000e+01,0.000000000000000000e+00
31 | 6.100000000000000000e+01,6.600000000000000000e+01,7.000000000000000000e+01,7.400000000000000000e+01,5.900000000000000000e+01,0.000000000000000000e+00
32 | 7.400000000000000000e+01,6.700000000000000000e+01,6.900000000000000000e+01,7.500000000000000000e+01,5.900000000000000000e+01,0.000000000000000000e+00
33 | 6.000000000000000000e+01,5.100000000000000000e+01,7.500000000000000000e+01,6.000000000000000000e+01,6.500000000000000000e+01,0.000000000000000000e+00
34 | 7.300000000000000000e+01,7.600000000000000000e+01,6.800000000000000000e+01,7.400000000000000000e+01,5.600000000000000000e+01,0.000000000000000000e+00
35 | 6.600000000000000000e+01,8.100000000000000000e+01,7.500000000000000000e+01,7.200000000000000000e+01,6.900000000000000000e+01,0.000000000000000000e+00
36 | 7.200000000000000000e+01,7.100000000000000000e+01,7.000000000000000000e+01,7.200000000000000000e+01,6.300000000000000000e+01,0.000000000000000000e+00
37 | 7.100000000000000000e+01,7.100000000000000000e+01,7.100000000000000000e+01,7.200000000000000000e+01,7.700000000000000000e+01,0.000000000000000000e+00
38 | 7.000000000000000000e+01,6.500000000000000000e+01,6.500000000000000000e+01,6.200000000000000000e+01,6.800000000000000000e+01,0.000000000000000000e+00
39 | 5.900000000000000000e+01,7.500000000000000000e+01,7.700000000000000000e+01,8.000000000000000000e+01,6.000000000000000000e+01,0.000000000000000000e+00
40 | 7.000000000000000000e+01,6.600000000000000000e+01,6.100000000000000000e+01,6.600000000000000000e+01,6.100000000000000000e+01,0.000000000000000000e+00
41 | 6.900000000000000000e+01,6.800000000000000000e+01,7.500000000000000000e+01,7.400000000000000000e+01,7.800000000000000000e+01,0.000000000000000000e+00
42 | 7.000000000000000000e+01,6.900000000000000000e+01,6.900000000000000000e+01,6.700000000000000000e+01,6.900000000000000000e+01,0.000000000000000000e+00
43 | 7.000000000000000000e+01,6.900000000000000000e+01,6.000000000000000000e+01,6.200000000000000000e+01,5.800000000000000000e+01,0.000000000000000000e+00
44 | 6.400000000000000000e+01,5.900000000000000000e+01,7.600000000000000000e+01,7.200000000000000000e+01,5.500000000000000000e+01,0.000000000000000000e+00
45 | 7.300000000000000000e+01,6.200000000000000000e+01,6.900000000000000000e+01,7.000000000000000000e+01,7.300000000000000000e+01,0.000000000000000000e+00
46 | 4.200000000000000000e+01,5.100000000000000000e+01,7.200000000000000000e+01,5.600000000000000000e+01,7.200000000000000000e+01,0.000000000000000000e+00
47 | 6.500000000000000000e+01,6.900000000000000000e+01,6.600000000000000000e+01,7.600000000000000000e+01,5.800000000000000000e+01,0.000000000000000000e+00
48 | 7.100000000000000000e+01,7.500000000000000000e+01,7.800000000000000000e+01,7.800000000000000000e+01,6.800000000000000000e+01,1.000000000000000000e+00
49 | 6.900000000000000000e+01,6.400000000000000000e+01,7.300000000000000000e+01,7.200000000000000000e+01,4.900000000000000000e+01,1.000000000000000000e+00
50 | 6.500000000000000000e+01,6.700000000000000000e+01,6.900000000000000000e+01,7.600000000000000000e+01,6.200000000000000000e+01,1.000000000000000000e+00
51 | 7.200000000000000000e+01,6.100000000000000000e+01,6.400000000000000000e+01,6.600000000000000000e+01,6.400000000000000000e+01,1.000000000000000000e+00
52 | 6.100000000000000000e+01,7.600000000000000000e+01,7.100000000000000000e+01,6.800000000000000000e+01,7.700000000000000000e+01,1.000000000000000000e+00
53 | 5.900000000000000000e+01,5.700000000000000000e+01,6.700000000000000000e+01,7.100000000000000000e+01,6.600000000000000000e+01,1.000000000000000000e+00
54 | 6.800000000000000000e+01,6.500000000000000000e+01,7.200000000000000000e+01,7.200000000000000000e+01,4.700000000000000000e+01,1.000000000000000000e+00
55 | 7.400000000000000000e+01,6.900000000000000000e+01,7.500000000000000000e+01,7.000000000000000000e+01,7.000000000000000000e+01,1.000000000000000000e+00
56 | 5.900000000000000000e+01,5.800000000000000000e+01,6.900000000000000000e+01,7.400000000000000000e+01,7.100000000000000000e+01,1.000000000000000000e+00
57 | 6.600000000000000000e+01,6.400000000000000000e+01,6.400000000000000000e+01,6.600000000000000000e+01,6.700000000000000000e+01,1.000000000000000000e+00
58 | 7.600000000000000000e+01,7.200000000000000000e+01,7.300000000000000000e+01,6.900000000000000000e+01,6.700000000000000000e+01,1.000000000000000000e+00
59 | 7.000000000000000000e+01,7.500000000000000000e+01,7.200000000000000000e+01,7.200000000000000000e+01,6.700000000000000000e+01,1.000000000000000000e+00
60 | 6.400000000000000000e+01,6.600000000000000000e+01,6.800000000000000000e+01,7.100000000000000000e+01,6.200000000000000000e+01,1.000000000000000000e+00
61 | 7.500000000000000000e+01,7.300000000000000000e+01,7.200000000000000000e+01,7.700000000000000000e+01,6.800000000000000000e+01,1.000000000000000000e+00
62 | 7.600000000000000000e+01,7.500000000000000000e+01,6.800000000000000000e+01,7.800000000000000000e+01,7.100000000000000000e+01,1.000000000000000000e+00
63 | 7.000000000000000000e+01,7.200000000000000000e+01,7.000000000000000000e+01,7.000000000000000000e+01,6.500000000000000000e+01,1.000000000000000000e+00
64 | 7.100000000000000000e+01,7.100000000000000000e+01,6.900000000000000000e+01,7.100000000000000000e+01,6.500000000000000000e+01,1.000000000000000000e+00
65 | 6.800000000000000000e+01,7.000000000000000000e+01,6.900000000000000000e+01,7.400000000000000000e+01,6.500000000000000000e+01,1.000000000000000000e+00
66 | 7.000000000000000000e+01,6.400000000000000000e+01,6.800000000000000000e+01,6.700000000000000000e+01,7.600000000000000000e+01,1.000000000000000000e+00
67 | 5.900000000000000000e+01,6.800000000000000000e+01,6.900000000000000000e+01,6.700000000000000000e+01,6.900000000000000000e+01,1.000000000000000000e+00
68 | 6.600000000000000000e+01,5.400000000000000000e+01,6.900000000000000000e+01,6.600000000000000000e+01,6.900000000000000000e+01,1.000000000000000000e+00
69 | 6.800000000000000000e+01,7.000000000000000000e+01,6.600000000000000000e+01,7.200000000000000000e+01,6.300000000000000000e+01,1.000000000000000000e+00
70 | 5.900000000000000000e+01,6.200000000000000000e+01,7.200000000000000000e+01,7.400000000000000000e+01,6.600000000000000000e+01,1.000000000000000000e+00
71 | 7.200000000000000000e+01,7.400000000000000000e+01,6.700000000000000000e+01,6.900000000000000000e+01,6.900000000000000000e+01,1.000000000000000000e+00
72 | 5.800000000000000000e+01,6.300000000000000000e+01,8.000000000000000000e+01,7.100000000000000000e+01,7.600000000000000000e+01,1.000000000000000000e+00
73 | 7.400000000000000000e+01,8.100000000000000000e+01,8.000000000000000000e+01,7.800000000000000000e+01,7.000000000000000000e+01,1.000000000000000000e+00
74 | 6.700000000000000000e+01,6.400000000000000000e+01,7.300000000000000000e+01,7.500000000000000000e+01,7.700000000000000000e+01,1.000000000000000000e+00
75 | 6.400000000000000000e+01,7.000000000000000000e+01,7.100000000000000000e+01,6.900000000000000000e+01,7.200000000000000000e+01,1.000000000000000000e+00
76 | 7.600000000000000000e+01,7.300000000000000000e+01,7.400000000000000000e+01,7.600000000000000000e+01,6.000000000000000000e+01,1.000000000000000000e+00
77 | 6.700000000000000000e+01,6.500000000000000000e+01,7.700000000000000000e+01,7.400000000000000000e+01,6.700000000000000000e+01,1.000000000000000000e+00
78 | 6.200000000000000000e+01,7.100000000000000000e+01,7.800000000000000000e+01,8.400000000000000000e+01,6.400000000000000000e+01,1.000000000000000000e+00
79 | 6.700000000000000000e+01,5.700000000000000000e+01,7.300000000000000000e+01,7.800000000000000000e+01,6.300000000000000000e+01,1.000000000000000000e+00
80 | 7.000000000000000000e+01,7.100000000000000000e+01,7.100000000000000000e+01,7.400000000000000000e+01,6.800000000000000000e+01,1.000000000000000000e+00
81 | 6.600000000000000000e+01,6.700000000000000000e+01,6.300000000000000000e+01,7.000000000000000000e+01,6.900000000000000000e+01,1.000000000000000000e+00
82 | 7.200000000000000000e+01,7.000000000000000000e+01,7.500000000000000000e+01,8.000000000000000000e+01,7.300000000000000000e+01,1.000000000000000000e+00
83 | 6.500000000000000000e+01,6.800000000000000000e+01,7.000000000000000000e+01,7.800000000000000000e+01,6.500000000000000000e+01,1.000000000000000000e+00
84 | 6.400000000000000000e+01,5.300000000000000000e+01,7.400000000000000000e+01,7.000000000000000000e+01,6.500000000000000000e+01,1.000000000000000000e+00
85 | 6.800000000000000000e+01,6.400000000000000000e+01,7.400000000000000000e+01,8.000000000000000000e+01,7.600000000000000000e+01,1.000000000000000000e+00
86 | 8.000000000000000000e+01,7.600000000000000000e+01,7.500000000000000000e+01,7.500000000000000000e+01,6.900000000000000000e+01,1.000000000000000000e+00
87 | 6.100000000000000000e+01,6.800000000000000000e+01,6.200000000000000000e+01,7.000000000000000000e+01,7.600000000000000000e+01,1.000000000000000000e+00
88 | 6.200000000000000000e+01,6.700000000000000000e+01,6.800000000000000000e+01,7.000000000000000000e+01,6.500000000000000000e+01,1.000000000000000000e+00
89 | 7.300000000000000000e+01,7.400000000000000000e+01,6.500000000000000000e+01,6.600000000000000000e+01,6.900000000000000000e+01,1.000000000000000000e+00
90 | 6.900000000000000000e+01,7.800000000000000000e+01,7.400000000000000000e+01,7.600000000000000000e+01,7.000000000000000000e+01,1.000000000000000000e+00
91 | 6.400000000000000000e+01,5.800000000000000000e+01,7.000000000000000000e+01,7.800000000000000000e+01,6.600000000000000000e+01,1.000000000000000000e+00
92 | 5.600000000000000000e+01,5.600000000000000000e+01,6.300000000000000000e+01,6.600000000000000000e+01,7.600000000000000000e+01,1.000000000000000000e+00
93 | 6.200000000000000000e+01,6.600000000000000000e+01,6.600000000000000000e+01,6.800000000000000000e+01,7.300000000000000000e+01,1.000000000000000000e+00
94 | 6.300000000000000000e+01,6.100000000000000000e+01,7.500000000000000000e+01,7.200000000000000000e+01,6.800000000000000000e+01,1.000000000000000000e+00
95 |
--------------------------------------------------------------------------------
/Lab_6/lab6_slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_6/lab6_slides.pdf
--------------------------------------------------------------------------------
/Lab_7/datasets/dataset_4_movie_names.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_7/datasets/dataset_4_movie_names.txt
--------------------------------------------------------------------------------
/Lab_7/lab7_slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_7/lab7_slides.pdf
--------------------------------------------------------------------------------
/Lab_8/datasets/dataset_5_description.txt:
--------------------------------------------------------------------------------
1 | Attributes:
2 | X0: Census code (3001; 3123; 3288; 3298; 3420; 3530; 3540; 3585; 3652; 3662; 3817; 3827)
3 | X1: Amount of the given credit (NT dollar): it includes both the individual consumer credit and his/her family (supplementary) credit.
4 | X2: Gender (1 = male; 2 = female).
5 | X3: Education (1 = graduate school; 2 = university; 3 = high school; 4 = others).
6 | X4: Marital status (1 = married; 2 = single; 3 = others).
7 | X5: Age (year).
8 | X6 - X11: History of past payment. We tracked the past monthly payment records (from April to September, 2005) as follows: X6 = the repayment status in September, 2005; X7 = the repayment status in August, 2005; . . .;X11 = the repayment status in April, 2005. The measurement scale for the repayment status is: -1 = pay duly; 1 = payment delay for one month; 2 = payment delay for two months; . . .; 8 = payment delay for eight months; 9 = payment delay for nine months and above.
9 | X12-X17: Amount of bill statement (NT dollar). X12 = amount of bill statement in September, 2005; X13 = amount of bill statement in August, 2005; . . .; X17 = amount of bill statement in April, 2005.
10 | X18-X23: Amount of previous payment (NT dollar). X18 = amount paid in September, 2005; X19 = amount paid in August, 2005; . . .;X23 = amount paid in April, 2005.
11 |
12 | Demographic information in percentage:
13 | Census code Male Female Caucasian African American Asian Hispanic/Latino Other race
3001 51.5 48.5 21.6 3.5 46.1 18.4 10.4
3123 51.3 48.7 40.6 0.8 15.5 34.2 9.0
3288 50.2 49.8 53.6 2.2 19.1 14.6 10.5
3298 50.6 49.4 92.1 4.2 1.1 2.1 0.4
3420 51.7 48.3 91.7 3.5 2.4 2.3 0.1
14 | 3530 50.8 49.2 88.7 4.5 1.7 4.1 1.1
3540 51.5 48.5 89.3 2.6 5.4 0.7 1.9
3585 48.8 51.2 28.0 52.2 6.7 11.8 1.3
3652 48.5 51.5 31.9 24.9 8.6 30.6 3.9
3662 52.4 47.6 86.8 3.4 2.6 5.9 1.3
3817 49.3 50.7 86.7 5.2 4.6 2.6 1.0
15 | 3827 49.5 50.5 13.7 34.1 7.6 37.2 7.4
--------------------------------------------------------------------------------
/Lab_8/lab8_slides.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_8/lab8_slides.pdf
--------------------------------------------------------------------------------
/Lab_9/datasets/dataset_1_test.txt:
--------------------------------------------------------------------------------
1 | 2.802682877701987429e-01,1.171050356965895878e-01,0.000000000000000000e+00
2 | 9.887424438770977542e-01,1.982525747524259696e-01,0.000000000000000000e+00
3 | 7.274746734599567555e-01,3.240331955377390161e-01,0.000000000000000000e+00
4 | 7.709779736613111556e-01,8.905019629775434709e-02,0.000000000000000000e+00
5 | 3.452155323641750151e-01,1.189479411109930496e-01,0.000000000000000000e+00
6 | 4.714098574696790056e-01,5.494968210884080273e-01,1.000000000000000000e+00
7 | 9.411158736336222574e-01,8.160191519243940039e-01,1.000000000000000000e+00
8 | 9.389688839704706247e-01,3.063232255023600192e-01,0.000000000000000000e+00
9 | 1.271599717012774633e-01,5.967453089785957898e-01,1.000000000000000000e+00
10 | 2.637785292800197690e-01,9.139154771651319953e-01,1.000000000000000000e+00
11 | 5.841780001239667008e-01,1.965172183057714017e-01,0.000000000000000000e+00
12 | 6.966211158111946800e-01,3.876390491667194294e-01,0.000000000000000000e+00
13 | 1.844398656469152797e-01,7.853351478166734623e-01,1.000000000000000000e+00
14 | 5.767096604529512449e-01,2.774429798608757380e-02,0.000000000000000000e+00
15 | 4.445709417507092143e-01,7.157470842863542515e-01,1.000000000000000000e+00
16 | 7.130072935469810025e-01,7.698596569927019795e-01,1.000000000000000000e+00
17 | 2.295740287443451821e-01,7.046274991204591887e-01,1.000000000000000000e+00
18 | 7.775879083055335927e-01,7.771029994696446730e-01,1.000000000000000000e+00
19 | 8.689166264320787869e-01,7.487778782768544916e-01,1.000000000000000000e+00
20 | 2.862202083505607231e-01,1.775820739582030239e-01,0.000000000000000000e+00
21 | 9.379131190646037286e-01,1.344267598231390082e-01,0.000000000000000000e+00
22 | 2.405642444115626555e-01,1.390382518468402662e-02,0.000000000000000000e+00
23 | 1.345799453449335603e-01,5.135781212657464234e-01,1.000000000000000000e+00
24 | 9.061733781533665155e-01,5.094801022579837912e-01,0.000000000000000000e+00
25 | 7.483739993410363223e-01,8.578395184395138928e-01,1.000000000000000000e+00
26 | 5.761543540560688514e-01,1.851801941495326842e-01,0.000000000000000000e+00
27 | 3.663424016750204126e-01,8.508505040045016843e-01,1.000000000000000000e+00
28 | 6.477694778943420273e-01,6.392509607999474763e-02,0.000000000000000000e+00
29 | 9.134954904132798204e-01,4.496250050577454971e-01,0.000000000000000000e+00
30 | 4.178362440027157954e-01,5.633761103390351188e-01,1.000000000000000000e+00
31 | 1.014881565460713508e-01,8.725561520610292110e-02,0.000000000000000000e+00
32 | 3.974103292744294302e-01,3.573433465069109083e-03,0.000000000000000000e+00
33 | 8.759400724240312686e-01,1.875814677076481640e-02,0.000000000000000000e+00
34 | 1.988990918294991639e-01,4.295886190564137674e-01,1.000000000000000000e+00
35 | 1.704771334837706931e-01,8.816522357485485628e-01,1.000000000000000000e+00
36 | 9.297370841390666385e-01,4.633097744431629028e-01,0.000000000000000000e+00
37 | 5.356041734976563218e-01,9.537422269448666556e-01,1.000000000000000000e+00
38 | 3.508719013016404764e-01,5.509779053244192593e-01,1.000000000000000000e+00
39 | 3.753814372537498389e-01,1.947943284958592036e-01,0.000000000000000000e+00
40 | 4.146682571066369061e-01,2.913377184329822844e-01,0.000000000000000000e+00
41 | 5.728122877653567535e-01,2.654434715786690990e-01,0.000000000000000000e+00
42 | 8.361857276979363096e-01,1.689475584179390699e-01,0.000000000000000000e+00
43 | 8.451131155747015899e-01,9.885097007841643357e-01,1.000000000000000000e+00
44 | 9.982795301717684033e-01,2.382739078192124271e-01,0.000000000000000000e+00
45 | 8.125176994222678140e-01,1.401841831673873440e-01,0.000000000000000000e+00
46 | 2.930232318194397889e-01,5.240668753003642211e-01,1.000000000000000000e+00
47 | 2.911161184464561291e-01,1.053898641438434369e-01,0.000000000000000000e+00
48 | 4.236489364382932665e-01,1.407413554170169334e-01,0.000000000000000000e+00
49 | 4.502271796173732410e-01,7.079711706189207865e-01,1.000000000000000000e+00
50 | 4.426010959130247668e-01,1.394170932561608067e-01,0.000000000000000000e+00
51 | 9.916711272492545470e-01,4.632129618386249259e-01,0.000000000000000000e+00
52 | 3.138682041025746550e-01,1.349468320823553613e-01,0.000000000000000000e+00
53 | 7.816743571026431026e-01,5.262956850180167123e-02,0.000000000000000000e+00
54 | 5.641078118839660815e-01,2.079750163830276222e-01,0.000000000000000000e+00
55 | 4.367472630267990041e-01,7.765591849971003047e-01,1.000000000000000000e+00
56 | 7.289064751309809465e-01,2.279527949493233008e-01,0.000000000000000000e+00
57 | 7.481850276686758949e-01,3.848698972222829306e-01,0.000000000000000000e+00
58 | 8.555429798971551092e-01,2.001963437921733258e-01,0.000000000000000000e+00
59 | 1.622985985023138733e-01,7.007523466071562401e-01,1.000000000000000000e+00
60 | 3.571349336995607304e-01,5.897819914717638001e-01,1.000000000000000000e+00
61 | 7.055030249067997250e-01,9.846862942141765274e-02,0.000000000000000000e+00
62 | 5.316683919455353902e-01,4.476696205302488352e-02,0.000000000000000000e+00
63 | 6.820678611558009807e-01,3.836291545431914640e-01,0.000000000000000000e+00
64 | 7.231258901913889536e-01,4.170265213641658475e-01,0.000000000000000000e+00
65 | 9.938520114212728851e-01,9.705803133771735425e-01,1.000000000000000000e+00
66 | 1.313946054794438156e-01,3.466300149902640237e-01,1.000000000000000000e+00
67 | 5.691405320556354175e-01,8.051315402557015499e-01,1.000000000000000000e+00
68 | 4.144600551329115090e-01,8.486845142673233866e-01,1.000000000000000000e+00
69 | 1.025003939959090449e-02,6.293597228295821910e-01,1.000000000000000000e+00
70 | 7.902438025940452526e-01,7.623352442240588500e-01,1.000000000000000000e+00
71 | 6.427787092719934314e-01,3.341429798111570371e-01,0.000000000000000000e+00
72 | 6.478406511531121792e-01,1.215615992516877464e-01,0.000000000000000000e+00
73 | 6.365634181845816197e-01,1.852439749130981861e-01,0.000000000000000000e+00
74 | 2.146357463999536419e-01,4.167534401953371104e-01,1.000000000000000000e+00
75 | 9.512937542798095558e-01,1.549355166933520378e-01,0.000000000000000000e+00
76 | 8.423330461034712613e-01,9.261612869249199465e-01,1.000000000000000000e+00
77 | 8.320168996345008727e-01,7.367470562871129003e-01,1.000000000000000000e+00
78 | 2.008423437754454088e-01,3.883341821147591189e-01,1.000000000000000000e+00
79 | 2.046486340378425028e-01,6.192709663506636986e-01,1.000000000000000000e+00
80 | 2.594804044042771096e-01,6.923992458812310291e-01,1.000000000000000000e+00
81 | 7.021622659497585017e-01,1.980956281494338223e-01,0.000000000000000000e+00
82 | 2.085024945255224971e-01,8.673815371565234411e-01,1.000000000000000000e+00
83 | 5.479077800903766615e-01,6.995206197905481371e-01,1.000000000000000000e+00
84 | 4.026379231331473907e-01,4.366698797270299748e-01,1.000000000000000000e+00
85 |
--------------------------------------------------------------------------------
/Lab_9/datasets/dataset_1_train.txt:
--------------------------------------------------------------------------------
1 | 6.784215098218826512e-01,3.327599576169492090e-01,0.000000000000000000e+00
2 | 4.462849674538118538e-01,2.332643588225513653e-01,0.000000000000000000e+00
3 | 5.027787525092214382e-01,9.567475933072475680e-01,1.000000000000000000e+00
4 | 6.152545734642762554e-01,9.536599623823226457e-01,1.000000000000000000e+00
5 | 4.350118605971564634e-02,3.951507584675038043e-01,1.000000000000000000e+00
6 | 1.200397921774140064e-01,8.389025945590006250e-01,1.000000000000000000e+00
7 | 6.942391189527604700e-01,1.397634990477656380e-01,0.000000000000000000e+00
8 | 9.431707226672082500e-01,5.568601662432532962e-01,0.000000000000000000e+00
9 | 6.084421578050496215e-01,8.262498284341579513e-01,1.000000000000000000e+00
10 | 2.208379150614618869e-01,9.184586465896005247e-01,1.000000000000000000e+00
11 | 6.438419341481950164e-01,6.614813267154413534e-01,1.000000000000000000e+00
12 | 9.407954115625158931e-01,2.159161928095915117e-01,0.000000000000000000e+00
13 | 4.197354613068207119e-01,5.401915156671308615e-01,1.000000000000000000e+00
14 | 3.318737125398758536e-01,4.814581623460332249e-01,1.000000000000000000e+00
15 | 3.869003430123681975e-01,8.551196608041905511e-01,1.000000000000000000e+00
16 | 7.306802005261155974e-01,8.034141641594489958e-01,1.000000000000000000e+00
17 |
--------------------------------------------------------------------------------
/Lab_9/datasets/dataset_2_test.txt:
--------------------------------------------------------------------------------
1 | 2.802682877701987429e-01,1.171050356965895878e-01,0.000000000000000000e+00
2 | 9.887424438770977542e-01,1.982525747524259696e-01,0.000000000000000000e+00
3 | 6.784215098218826512e-01,3.327599576169492090e-01,0.000000000000000000e+00
4 | 7.274746734599567555e-01,3.240331955377390161e-01,0.000000000000000000e+00
5 | 7.709779736613111556e-01,8.905019629775434709e-02,0.000000000000000000e+00
6 | 3.452155323641750151e-01,1.189479411109930496e-01,0.000000000000000000e+00
7 | 4.714098574696790056e-01,5.494968210884080273e-01,1.000000000000000000e+00
8 | 9.411158736336222574e-01,8.160191519243940039e-01,1.000000000000000000e+00
9 | 9.389688839704706247e-01,3.063232255023600192e-01,0.000000000000000000e+00
10 | 1.271599717012774633e-01,5.967453089785957898e-01,1.000000000000000000e+00
11 | 2.637785292800197690e-01,9.139154771651319953e-01,1.000000000000000000e+00
12 | 5.841780001239667008e-01,1.965172183057714017e-01,0.000000000000000000e+00
13 | 6.966211158111946800e-01,3.876390491667194294e-01,0.000000000000000000e+00
14 | 1.844398656469152797e-01,7.853351478166734623e-01,1.000000000000000000e+00
15 | 5.767096604529512449e-01,2.774429798608757380e-02,0.000000000000000000e+00
16 | 7.130072935469810025e-01,7.698596569927019795e-01,1.000000000000000000e+00
17 | 4.462849674538118538e-01,2.332643588225513653e-01,1.000000000000000000e+00
18 | 2.295740287443451821e-01,7.046274991204591887e-01,1.000000000000000000e+00
19 | 7.775879083055335927e-01,7.771029994696446730e-01,1.000000000000000000e+00
20 | 8.689166264320787869e-01,7.487778782768544916e-01,1.000000000000000000e+00
21 | 2.862202083505607231e-01,1.775820739582030239e-01,0.000000000000000000e+00
22 | 9.379131190646037286e-01,1.344267598231390082e-01,0.000000000000000000e+00
23 | 2.405642444115626555e-01,1.390382518468402662e-02,0.000000000000000000e+00
24 | 1.345799453449335603e-01,5.135781212657464234e-01,1.000000000000000000e+00
25 | 9.061733781533665155e-01,5.094801022579837912e-01,1.000000000000000000e+00
26 | 7.483739993410363223e-01,8.578395184395138928e-01,1.000000000000000000e+00
27 | 5.761543540560688514e-01,1.851801941495326842e-01,0.000000000000000000e+00
28 | 3.663424016750204126e-01,8.508505040045016843e-01,1.000000000000000000e+00
29 | 6.477694778943420273e-01,6.392509607999474763e-02,0.000000000000000000e+00
30 | 9.134954904132798204e-01,4.496250050577454971e-01,0.000000000000000000e+00
31 | 4.178362440027157954e-01,5.633761103390351188e-01,1.000000000000000000e+00
32 | 3.974103292744294302e-01,3.573433465069109083e-03,0.000000000000000000e+00
33 | 8.759400724240312686e-01,1.875814677076481640e-02,0.000000000000000000e+00
34 | 1.988990918294991639e-01,4.295886190564137674e-01,1.000000000000000000e+00
35 | 1.704771334837706931e-01,8.816522357485485628e-01,1.000000000000000000e+00
36 | 9.297370841390666385e-01,4.633097744431629028e-01,0.000000000000000000e+00
37 | 3.753814372537498389e-01,1.947943284958592036e-01,0.000000000000000000e+00
38 | 4.146682571066369061e-01,2.913377184329822844e-01,0.000000000000000000e+00
39 | 1.200397921774140064e-01,8.389025945590006250e-01,1.000000000000000000e+00
40 | 5.728122877653567535e-01,2.654434715786690990e-01,0.000000000000000000e+00
41 | 8.451131155747015899e-01,9.885097007841643357e-01,1.000000000000000000e+00
42 | 9.982795301717684033e-01,2.382739078192124271e-01,0.000000000000000000e+00
43 | 8.125176994222678140e-01,1.401841831673873440e-01,0.000000000000000000e+00
44 | 6.942391189527604700e-01,1.397634990477656380e-01,0.000000000000000000e+00
45 | 2.930232318194397889e-01,5.240668753003642211e-01,0.000000000000000000e+00
46 | 2.911161184464561291e-01,1.053898641438434369e-01,0.000000000000000000e+00
47 | 9.431707226672082500e-01,5.568601662432532962e-01,0.000000000000000000e+00
48 | 6.084421578050496215e-01,8.262498284341579513e-01,1.000000000000000000e+00
49 | 4.502271796173732410e-01,7.079711706189207865e-01,1.000000000000000000e+00
50 | 4.426010959130247668e-01,1.394170932561608067e-01,0.000000000000000000e+00
51 | 2.208379150614618869e-01,9.184586465896005247e-01,1.000000000000000000e+00
52 | 3.138682041025746550e-01,1.349468320823553613e-01,0.000000000000000000e+00
53 | 7.816743571026431026e-01,5.262956850180167123e-02,0.000000000000000000e+00
54 | 6.438419341481950164e-01,6.614813267154413534e-01,1.000000000000000000e+00
55 | 4.367472630267990041e-01,7.765591849971003047e-01,1.000000000000000000e+00
56 | 7.289064751309809465e-01,2.279527949493233008e-01,0.000000000000000000e+00
57 | 7.481850276686758949e-01,3.848698972222829306e-01,0.000000000000000000e+00
58 | 4.197354613068207119e-01,5.401915156671308615e-01,1.000000000000000000e+00
59 | 8.555429798971551092e-01,2.001963437921733258e-01,1.000000000000000000e+00
60 | 1.622985985023138733e-01,7.007523466071562401e-01,1.000000000000000000e+00
61 | 3.571349336995607304e-01,5.897819914717638001e-01,1.000000000000000000e+00
62 | 7.055030249067997250e-01,9.846862942141765274e-02,0.000000000000000000e+00
63 | 6.820678611558009807e-01,3.836291545431914640e-01,0.000000000000000000e+00
64 | 7.231258901913889536e-01,4.170265213641658475e-01,0.000000000000000000e+00
65 | 4.144600551329115090e-01,8.486845142673233866e-01,0.000000000000000000e+00
66 | 3.318737125398758536e-01,4.814581623460332249e-01,0.000000000000000000e+00
67 | 1.025003939959090449e-02,6.293597228295821910e-01,1.000000000000000000e+00
68 | 7.902438025940452526e-01,7.623352442240588500e-01,1.000000000000000000e+00
69 | 6.427787092719934314e-01,3.341429798111570371e-01,0.000000000000000000e+00
70 | 6.478406511531121792e-01,1.215615992516877464e-01,0.000000000000000000e+00
71 | 6.365634181845816197e-01,1.852439749130981861e-01,0.000000000000000000e+00
72 | 2.146357463999536419e-01,4.167534401953371104e-01,1.000000000000000000e+00
73 | 3.869003430123681975e-01,8.551196608041905511e-01,1.000000000000000000e+00
74 | 7.306802005261155974e-01,8.034141641594489958e-01,1.000000000000000000e+00
75 | 9.512937542798095558e-01,1.549355166933520378e-01,0.000000000000000000e+00
76 | 8.423330461034712613e-01,9.261612869249199465e-01,0.000000000000000000e+00
77 | 8.320168996345008727e-01,7.367470562871129003e-01,1.000000000000000000e+00
78 | 2.594804044042771096e-01,6.923992458812310291e-01,1.000000000000000000e+00
79 | 5.479077800903766615e-01,6.995206197905481371e-01,1.000000000000000000e+00
80 | 4.026379231331473907e-01,4.366698797270299748e-01,1.000000000000000000e+00
81 |
--------------------------------------------------------------------------------
/Lab_9/datasets/dataset_2_train.txt:
--------------------------------------------------------------------------------
1 | 4.445709417507092143e-01,7.157470842863542515e-01,1.000000000000000000e+00
2 | 5.027787525092214382e-01,9.567475933072475680e-01,1.000000000000000000e+00
3 | 6.152545734642762554e-01,9.536599623823226457e-01,1.000000000000000000e+00
4 | 1.014881565460713508e-01,8.725561520610292110e-02,0.000000000000000000e+00
5 | 4.350118605971564634e-02,3.951507584675038043e-01,1.000000000000000000e+00
6 | 5.356041734976563218e-01,9.537422269448666556e-01,0.000000000000000000e+00
7 | 3.508719013016404764e-01,5.509779053244192593e-01,1.000000000000000000e+00
8 | 8.361857276979363096e-01,1.689475584179390699e-01,0.000000000000000000e+00
9 | 4.236489364382932665e-01,1.407413554170169334e-01,1.000000000000000000e+00
10 | 9.916711272492545470e-01,4.632129618386249259e-01,0.000000000000000000e+00
11 | 5.641078118839660815e-01,2.079750163830276222e-01,0.000000000000000000e+00
12 | 9.407954115625158931e-01,2.159161928095915117e-01,0.000000000000000000e+00
13 | 5.316683919455353902e-01,4.476696205302488352e-02,0.000000000000000000e+00
14 | 9.938520114212728851e-01,9.705803133771735425e-01,0.000000000000000000e+00
15 | 1.313946054794438156e-01,3.466300149902640237e-01,1.000000000000000000e+00
16 | 5.691405320556354175e-01,8.051315402557015499e-01,1.000000000000000000e+00
17 | 2.008423437754454088e-01,3.883341821147591189e-01,1.000000000000000000e+00
18 | 2.046486340378425028e-01,6.192709663506636986e-01,1.000000000000000000e+00
19 | 7.021622659497585017e-01,1.980956281494338223e-01,0.000000000000000000e+00
20 | 2.085024945255224971e-01,8.673815371565234411e-01,1.000000000000000000e+00
21 |
--------------------------------------------------------------------------------
/Lab_9/lab9.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/Lab_9/lab9.pdf
--------------------------------------------------------------------------------
/astroid.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cs109Alabs/lab_files/2cfda996b94f9fc9e08103e93c603e2436f3fe95/astroid.gif
--------------------------------------------------------------------------------