Skip to content

Instantly share code, notes, and snippets.

View mGalarnyk's full-sized avatar

Michael Galarnyk mGalarnyk

View GitHub Profile
@mGalarnyk
mGalarnyk / project1.md
Last active April 11, 2026 01:19
The Data Scientist's Toolbox Project John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera

The Data Scientist's Toolbox Project (JHU) Coursera

A image video link walkthrough of the project + answers is available at the end of this quiz.

github repo for rest of specialization: Data Science Coursera

Part 1

The Course Project for this course is pretty straightforward. Now that you’ve learned about the basic tools found in the data scientist’s toolbox, we want to make sure that you’ve assembled those tools and are ready to begin using them. This easy project is your chance to demonstrate that you’ve done the basic software setup (R, RStudio, and Github) that will get you through the rest of the Data Science Specialization.

  1. Install R
@mGalarnyk
mGalarnyk / assignment1.md
Last active December 1, 2025 11:17
R Programming Programming Assignment 1 (Week 2) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera

R Programming Project 1

github repo for rest of specialization: Data Science Coursera

For this first programming assignment you will write three functions that are meant to interact with dataset that accompanies this assignment. The dataset is contained in a zip file specdata.zip that you can download from the Coursera web site.

Although this is a programming assignment, you will be assessed using a separate quiz.

The zip file containing the data can be downloaded here: specdata.zip [2.4MB]

@mGalarnyk
mGalarnyk / quiz3.md
Last active December 1, 2025 10:56
R Programming Quiz 3 (Week 3) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera

R Programming Quiz 3

github repo for rest of specialization: Data Science Coursera

Question 1

Take a look at the 'iris' dataset that comes with R. The data can be loaded with the code:

library(datasets)
@mGalarnyk
mGalarnyk / machineLearningWeek1Quiz2.md
Last active November 24, 2025 11:14
Machine Learning (Stanford) Coursera (Week 1, Quiz 2) for the github repo: https://github.com/mGalarnyk/datasciencecoursera/tree/master/Stanford_Machine_Learning

Machine Learning Week 1 Quiz 2 (Linear Regression with One Variable) Stanford Coursera

Github repo for the Course: Stanford Machine Learning (Coursera)

Question 1

Consider the problem of predicting how well a student does in her second year of college/university, given how well she did in her first year.

Specifically, let x be equal to the number of "A" grades (including A-. A and A+ grades) that a student receives in their first year of college (freshmen year). We would like to predict the value of y, which we define as the number of "A" grades they get in their second year (sophomore year).

@mGalarnyk
mGalarnyk / quiz1.md
Last active October 25, 2025 06:36
R Programming Quiz 1 (Week 1) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera

R Programming Quiz 1 (JHU) Coursera

github repo for rest of specialization: Data Science Coursera

Question 1

R was developed by statisticians working at...

Answer

The University of Auckland

@mGalarnyk
mGalarnyk / assignment3.md
Last active October 25, 2025 06:35
R Programming Programming Assignment 3 (Week 4) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera
@mGalarnyk
mGalarnyk / changingTreeMethod.py
Last active July 17, 2025 03:12
Speeding up XGBoost model training by changing tree_method
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from xgboost import XGBClassifier
import time
# create synthetic dataset
X, y = make_classification(n_samples=100000, n_features=1000, n_informative=50, n_redundant=0, random_state=1)
# split data into training and test sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.50, random_state=1)
@mGalarnyk
mGalarnyk / machineLearningWeek1Quiz1.md
Last active June 3, 2025 11:49
Machine Learning (Stanford) Coursera (Week 1, Quiz 1) for the github repo: https://github.com/mGalarnyk/datasciencecoursera/tree/master/Stanford_Machine_Learning

Machine Learning Week 1 Quiz 1 (Introduction) Stanford Coursera

Github repo for the Course: Stanford Machine Learning (Coursera)

Question 1

A computer program is said to learn from experience E with

respect to some task T and some performance measure P if its

# 1. Register an application with the Github API here https://github.com/settings/applications.
# Access the API to get information on your instructors repositories (hint: this is the url you want "https://api.github.com/users/jtleek/repos").
# Use this data to find the time that the datasharing repo was created. What time was it created?
# see https://medium.com/@GalarnykMichael/accessing-data-from-github-api-using-r-3633fb62cb08#.z0z07ph5h for more details.
#install.packages("jsonlite")
library(jsonlite)
#install.packages("httpuv")
library(httpuv)
#install.packages("httr")
@mGalarnyk
mGalarnyk / quiz4.md
Created March 7, 2017 18:15
Getting and Cleaning Data Quiz 4 (Week 4) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera/tree/master/3_Getting_and_Cleaning_Data

Getting and Cleaning Data Quiz 4 (JHU) Coursera

Question 1

The American Community Survey distributes downloadable data about United States communities. Download the 2006 microdata survey about housing for the state of Idaho using download.file() from here:

https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06hid.csv

and load the data into R. The code book, describing the variable names is here: