generated from byui-cse/byuids-portfolio
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8c7cb3
commit 11ebe8d
Showing
3 changed files
with
482 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,159 @@ | ||
### Paste in a template | ||
--- | ||
title: "Client Report - Late Flights & Missing Data (JSON)" | ||
subtitle: "Course DS 250" | ||
author: "[STUDENT NAME]" | ||
format: | ||
html: | ||
self-contained: true | ||
page-layout: full | ||
title-block-banner: true | ||
toc: true | ||
toc-depth: 3 | ||
toc-location: body | ||
number-sections: false | ||
html-math-method: katex | ||
code-fold: true | ||
code-summary: "Show the code" | ||
code-overflow: wrap | ||
code-copy: hover | ||
code-tools: | ||
source: false | ||
toggle: true | ||
caption: See code | ||
execute: | ||
warning: false | ||
|
||
--- | ||
|
||
```{python} | ||
import pandas as pd | ||
import numpy as np | ||
import sqlite3 | ||
from lets_plot import * | ||
LetsPlot.setup_html(isolated_frame=True) | ||
``` | ||
|
||
|
||
```{python} | ||
# Learn morea about Code Cells: https://quarto.org/docs/reference/cells/cells-jupyter.html | ||
# Include and execute your code here | ||
sqlite_file = 'lahmansbaseballdb.sqlite' | ||
# this file must be in the same location as your .qmd or .py file | ||
con = sqlite3.connect(sqlite_file) | ||
``` | ||
|
||
## Elevator pitch | ||
_A SHORT (2-3 SENTENCES) PARAGRAPH THAT `DESCRIBES KEY INSIGHTS` TAKEN FROM METRICS IN THE PROJECT RESULTS THINK TOP OR MOST IMPORTANT RESULTS._ (Note: this is not a summary of the project, but a summary of the results.) | ||
|
||
_A Client has requested this analysis and this is your one shot of what you would say to your boss in a 2 min elevator ride before he takes your report and hands it to the client._ | ||
|
||
## QUESTION|TASK 1 | ||
|
||
__Write an SQL query to create a new dataframe about baseball players who attended BYU-Idaho. The new table should contain five columns: playerID, schoolID, salary, and the yearID/teamID associated with each salary. Order the table by salary (highest to lowest) and print out the table in your report.__ | ||
|
||
_type your results and analysis here_ | ||
|
||
```{python} | ||
# Include and execute your code here | ||
``` | ||
|
||
|
||
## QUESTION|TASK 2 | ||
|
||
__This three-part question requires you to calculate batting average (number of hits divided by the number of at-bats)__ | ||
a. Write an SQL query that provides playerID, yearID, and batting average for players with at least 1 at bat that year. Sort the table from highest batting average to lowest, and then by playerid alphabetically. Show the top 5 results in your report. | ||
a. Use the same query as above, but only include players with at least 10 at bats that year. Print the top 5 results. | ||
a. Now calculate the batting average for players over their entire careers (all years combined). Only include players with at least 100 at bats, and print the top 5 results. | ||
|
||
_type your results and analysis here_ | ||
|
||
```{python} | ||
# Include and execute your code here | ||
``` | ||
|
||
```{python} | ||
# Include and execute your code here | ||
``` | ||
|
||
```{python} | ||
# Include and execute your code here | ||
``` | ||
|
||
|
||
## QUESTION|TASK 3 | ||
|
||
__Pick any two baseball teams and compare them using a metric of your choice (average salary, home runs, number of wins, etc). Write an SQL query to get the data you need, then make a graph using Lets-Plot to visualize the comparison. What do you learn?__ | ||
|
||
_type your results and analysis here_ | ||
|
||
```{python} | ||
# Include and execute your code here | ||
``` | ||
|
||
--- | ||
|
||
## STRETCH QUESTION|TASK 1 | ||
|
||
__Advanced Salary Distribution by Position (with Case Statement):__ | ||
|
||
* Write an SQL query that provides a summary table showing the average salary for players in each position (e.g., pitcher, catcher, outfielder) across all years. Include the following columns: | ||
|
||
* position | ||
* average_salary | ||
* total_players | ||
* highest_salary | ||
|
||
* The highest_salary column should display the highest salary ever earned by a player in that position. If no player in that position has a recorded salary, display “N/A” for the highest salary. | ||
|
||
* Additionally, create a new column called salary_category using a case statement: | ||
|
||
* If the average salary is above $1 million, categorize it as “High Salary.” | ||
* If the average salary is between $500,000 and $1 million, categorize it as “Medium Salary.” | ||
* Otherwise, categorize it as “Low Salary.” | ||
|
||
* Order the table by average salary in descending order. | ||
* Print the top 10 rows of this summary table. | ||
|
||
_type your results and analysis here_ | ||
|
||
```{python} | ||
# Include and execute your code here | ||
``` | ||
|
||
|
||
## STRETCH QUESTION|TASK 2 | ||
|
||
__Advanced Career Longevity and Performance (with Subqueries):__ | ||
|
||
* Calculate the average career length (in years) for players who have played at least one game. Then, identify the top 10 players with the longest careers (based on the number of years they played). Include their: | ||
|
||
* playerID | ||
* first_name | ||
* last_name | ||
* career_length | ||
|
||
* The career_length should be calculated as the difference between the maximum and minimum yearID for each player. | ||
|
||
_type your results and analysis here_ | ||
|
||
```{python} | ||
# Include and execute your code here | ||
``` | ||
|
||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,142 @@ | ||
### Paste in a template | ||
--- | ||
title: "Client Report - Can You Predict That?" | ||
subtitle: "Course DS 250" | ||
author: "[STUDENT NAME]" | ||
format: | ||
html: | ||
self-contained: true | ||
page-layout: full | ||
title-block-banner: true | ||
toc: true | ||
toc-depth: 3 | ||
toc-location: body | ||
number-sections: false | ||
html-math-method: katex | ||
code-fold: true | ||
code-summary: "Show the code" | ||
code-overflow: wrap | ||
code-copy: hover | ||
code-tools: | ||
source: false | ||
toggle: true | ||
caption: See code | ||
execute: | ||
warning: false | ||
|
||
--- | ||
|
||
```{python} | ||
import pandas as pd | ||
import numpy as np | ||
from lets_plot import * | ||
# add the additional libraries you need to import for ML here | ||
LetsPlot.setup_html(isolated_frame=True) | ||
``` | ||
|
||
|
||
```{python} | ||
# Learn morea about Code Cells: https://quarto.org/docs/reference/cells/cells-jupyter.html | ||
# Include and execute your code here | ||
# import your data here using pandas and the URL | ||
``` | ||
|
||
## Elevator pitch | ||
_A SHORT (2-3 SENTENCES) PARAGRAPH THAT `DESCRIBES KEY INSIGHTS` TAKEN FROM METRICS IN THE PROJECT RESULTS THINK TOP OR MOST IMPORTANT RESULTS._ (Note: this is not a summary of the project, but a summary of the results.) | ||
|
||
_A Client has requested this analysis and this is your one shot of what you would say to your boss in a 2 min elevator ride before he takes your report and hands it to the client._ | ||
|
||
## QUESTION|TASK 1 | ||
|
||
__Create 2-3 charts that evaluate potential relationships between the home variables and `before1980`.__ Explain what you learn from the charts that could help a machine learning algorithm. | ||
|
||
_type your results and analysis here_ | ||
|
||
```{python} | ||
# Include and execute your code here | ||
``` | ||
|
||
|
||
## QUESTION|TASK 2 | ||
|
||
__Build a classification model labeling houses as being built “before 1980” or “during or after 1980”.__ Your goal is to reach or exceed 90% accuracy. Explain your final model choice (algorithm, tuning parameters, etc) and describe what other models you tried. | ||
|
||
_type your results and analysis here_ | ||
|
||
```{python} | ||
# Include and execute your code here | ||
``` | ||
|
||
|
||
## QUESTION|TASK 3 | ||
|
||
__Justify your classification model by discussing the most important features selected by your model.__ This discussion should include a feature importance chart and a description of the features. | ||
|
||
_type your results and analysis here_ | ||
|
||
```{python} | ||
# Include and execute your code here | ||
``` | ||
|
||
|
||
## QUESTION|TASK 4 | ||
|
||
__Describe the quality of your classification model using 2-3 different evaluation metrics.__ You also need to explain how to interpret each of the evaluation metrics you use. | ||
|
||
_type your results and analysis here_ | ||
|
||
```{python} | ||
# Include and execute your code here | ||
``` | ||
|
||
--- | ||
|
||
## STRETCH QUESTION|TASK 1 | ||
|
||
__Repeat the classification model using 3 different algorithms.__ Display their Feature Importance, and Decision Matrix. Explian the differences between the models and which one you would recommend to the Client. | ||
|
||
_type your results and analysis here_ | ||
|
||
```{python} | ||
# Include and execute your code here | ||
``` | ||
|
||
|
||
## STRETCH QUESTION|TASK 2 | ||
|
||
__Join the `dwellings_neighborhoods_ml.csv` data to the `dwelling_ml.csv` on the `parcel` column to create a new dataset. Duplicate the code for the stretch question above and update it to use this data.__ Explain the differences and if this changes the model you recomend to the Client. | ||
|
||
_type your results and analysis here_ | ||
|
||
```{python} | ||
# Include and execute your code here | ||
``` | ||
|
||
|
||
## STRETCH QUESTION|TASK 3 | ||
|
||
__Can you build a model that predicts the year a house was built?__ Explain the model and the evaluation metrics you would use to determine if the model is good. | ||
|
||
_type your results and analysis here_ | ||
|
||
```{python} | ||
# Include and execute your code here | ||
``` | ||
|
||
--- |
Oops, something went wrong.