AILearning
Consider the following hashtag:
#AILearning
- Input data for prediction
- Text
- Image
- Audio
- Video
- Prompt the AI
- Introduce yourself
- Explain the problem
- Give directions for the presentation of the solution
- Specify the expected results
- Continue the discussion until you are satisfied
- Request a report file with the prompt, response, and your analysis, and save it as a .pdf file.
The AI tools we will be discussing in this class.
- OpenAI ChatGPT: https://chatgpt.com/ for Prompt Engineering
- Microsoft CoPilot in RStudio (To be updated.) for Code Completion and Generation
- Google Gemini CLI in RStudio (To be updated.) for Vibe Coding and Agent Coding
- Other AI tools such as Antigravity, VSCode with kilo (To be updated.)
Homework solutions using ChatGPT:
Use these steps to generate solutions to homework problems using ChatGPT or other AI tools. You should include the prompt you used and the response you received. You should also include your own analysis of the response, including any corrections or improvements you made to the solution.
- OpenAI ChatGPT:
Provide the following prompt to ChatGPT or enter each step one at a time.
Introduction
I am a second year MS Student in the MS Statistics program at CSU East Bay. I am in the Stat. 640 Statistical Theory class. I am learning how to use AI tools to help me produce solutions to homework problems. I will be using ChatGPT to help me solve the following problem.
Explain the problem
Using R simulate \(n = 100\) standard normal values, square each value, and plot histograms. Comment on the shape of the distribution.
Specify the expected results
Please produce the solution to this problem by providing R code in a .qmd file. Also produce Python code and execute the code to produce the histogram. Please provide a brief explanation of the shape of the distribution.
Request a report file
The report file should include the prompt, response, and your analysis, and save it as a .pdf file. The report should include a title, class, author, and date.
I should be the author, “Eric Suess.” Any mathematical formulas should be formatted using LaTeX. The report should be well organized and easy to read.
Homework solutions using Microsoft Github Copilot in RStudio:
- Microsoft CoPilot in RStudio for Code Completion and Generation
In RStudio you can connect to Microsoft CoPilot for code completion. This connection allows for a line of code or lines of code to be suggested for approval duing the coding process. This is a great way to learn how to code in R. You can also use CoPilot to generate code for you.
To set up CoPilot in RStudio follow these steps:
- Install the CoPilot extension in RStudio. Go to Tools -> Global Options -> Code -> Completion -> Enable GitHub Copilot.
- Sign in to your GitHub account. You will need a GitHub account to use CoPilot. If you do not have a GitHub account, you can create one for free GitHub.
- Start coding in RStudio. As you type, CoPilot will suggest code completions. You can accept the suggestion by pressing Tab or you can reject the suggestion by pressing Esc.
- To generate code, you can provide a comment that describes the code you want to generate
- Start a new line with # and describe the code you want to generate.
- Press Enter and CoPilot will generate the code for you.
- You can accept the suggestion by pressing Tab or you can reject the suggestion by pressing Esc.
In your R program or in your R Quarto Notebook you should put your instuctions into comments or into the text part of your R Quarto Notebook. Then you can use CoPilot to generate the code for you.
To experience R code generation beyond one line at a time, you can use the CoPilot in your GitHub account or you can use
- Bing Chat.
- Google Gemini.
- OpenAI ChatGPT.
The copy and paste the code into an R Quarto Notebook.
- Google Colab for Code Completion and Generation
You can also use Google Colab to generate R code. First change the Runtime to R. Then you can use the same prompts as you would use in RStudio or in ChatGPT.
You can also use the Code Generation features of Google Colab to generate larger amounts of code at one time.
Homework solutions using Google Gemini cli in RStudio:
- Google Gemini CLI in RStudio (To be updated.) for Vibe Coding and Agent Coding
Agent for Homework solutions:
- Other AI tools such as Antigravity or VSCode with kilo (To be updated.)