Skip to content

Commit

Permalink
halfway done
Browse files Browse the repository at this point in the history
  • Loading branch information
rugantio committed May 29, 2018
1 parent 2b6d7e7 commit ddcfe3d
Show file tree
Hide file tree
Showing 32 changed files with 23,410 additions and 93 deletions.
2 changes: 1 addition & 1 deletion class03_Basic-Data-Manipulation.ipynb
Expand Up @@ -205,7 +205,7 @@
"outputs": [],
"source": [
"# check the population in the US\n",
"print int(dataset['00000']['POP010210']) == 308745538"
"print(int(dataset['00000']['POP010210'])) == 308745538"
]
},
{
Expand Down
71 changes: 16 additions & 55 deletions class03b_Pandas-Data-Manipulation.ipynb
Expand Up @@ -18,9 +18,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
Expand All @@ -43,9 +41,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"dataset_fname = \"data/DataSet.txt\"\n",
Expand All @@ -70,9 +66,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# YOUR CODE HERE"
Expand All @@ -99,9 +93,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# YOUR CODE HERE"
Expand All @@ -110,9 +102,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# to check\n",
Expand Down Expand Up @@ -145,9 +135,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# YOUR CODE HERE"
Expand All @@ -156,9 +144,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"print (counties_count_by_state['36'])"
Expand All @@ -174,9 +160,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"def county_fips_for_state(state_fips):\n",
Expand All @@ -186,9 +170,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# check for NY\n",
Expand All @@ -205,9 +187,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"dataset = pd.read_csv(dataset_fname, dtype={'fips': str}).set_index('fips')"
Expand All @@ -216,9 +196,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# check the population in the US\n",
Expand All @@ -235,9 +213,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# YOUR CODE HERE"
Expand All @@ -253,9 +229,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"int(dataset.ix['36000']['POP010210']) # total 2010 population of NY"
Expand All @@ -264,9 +238,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# YOUR CODE HERE"
Expand All @@ -282,22 +254,11 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"# YOUR CODE HERE"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -316,7 +277,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
"version": "3.6.5"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion class04_Numpy.ipynb
Expand Up @@ -1294,7 +1294,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
"version": "3.6.5"
}
},
"nbformat": 4,
Expand Down
6 changes: 2 additions & 4 deletions class05_Plotting.ipynb
Expand Up @@ -192,9 +192,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd"
Expand Down Expand Up @@ -269,7 +267,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
"version": "3.6.5"
}
},
"nbformat": 4,
Expand Down
22 changes: 6 additions & 16 deletions class06_Scikit-Learn.ipynb
Expand Up @@ -138,9 +138,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"from sklearn.datasets import load_iris\n",
Expand Down Expand Up @@ -244,9 +242,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"from sklearn import datasets"
Expand All @@ -273,9 +269,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"from sklearn.linear_model import LinearRegression"
Expand Down Expand Up @@ -317,9 +311,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"x = np.array([0, 1, 2])\n",
Expand Down Expand Up @@ -450,9 +442,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"from sklearn.svm import SVC"
Expand Down Expand Up @@ -1084,7 +1074,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
"version": "3.6.5"
}
},
"nbformat": 4,
Expand Down
29 changes: 15 additions & 14 deletions class07_Linear-Regression.ipynb
Expand Up @@ -230,9 +230,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"import sklearn"
Expand All @@ -250,9 +248,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"from sklearn.linear_model import LinearRegression\n",
Expand Down Expand Up @@ -298,9 +294,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"from sklearn.linear_model import Lasso\n",
Expand Down Expand Up @@ -460,8 +454,8 @@
"# Predict the test values using the model\n",
"predY = model.predict(testX)\n",
"\n",
"print mae(testY, predY)\n",
"print rmse(testY, predY)"
"print(mae(testY, predY))\n",
"print(rmse(testY, predY))"
]
},
{
Expand Down Expand Up @@ -513,9 +507,16 @@
"# Predict the test values using the model\n",
"predY = model.predict(testX)\n",
"\n",
"print mae(testY, predY)\n",
"print rmse(testY, predY)"
"print(mae(testY, predY))\n",
"print(rmse(testY, predY))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -534,7 +535,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
"version": "3.6.5"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion class08_Logistic-Regression.ipynb
Expand Up @@ -259,7 +259,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
"version": "3.6.5"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion class10_Cross-Validation.ipynb
Expand Up @@ -242,7 +242,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
"version": "3.6.5"
}
},
"nbformat": 4,
Expand Down

0 comments on commit ddcfe3d

Please sign in to comment.