Message Boards Message Boards

GROUPS:

[WSG20] New Daily Study Group begins Monday, June 22

Posted 4 months ago
3533 Views
|
80 Replies
|
80 Total Likes
|

Our newest Daily Study Group offers a jump-start on earning Wolfram certifications and covers topics including Wolfram Notebooks, image processing and multiparadigm data science. Sign up at: https://wolfr.am/NpiuhRsg

80 Replies

Hello Jamie!

Woohoo! :D

Way to go Jamie, A fine Scottish name that!

Jonathan from Glasgow Scotland.

Hello, this is my first study group. I am interested in practice and learning new features rather than certification. That said, I have a question: sometimes I'll have schedule conflicts (other meetings) that will prevent me from attending. Is there a way to catch up later?

Chris from Richmond, VA, USA

Hi Chris, Sure you will definitely be able to catch up with access to the recordings and other study materials. We usually send out links to a collection of resources used during the sessions at the end of the week, that should help you catch up.

This week's topic: Introduction to Notebooks.

See you there :)

Posted 4 months ago

What types of certificates does the newest Daily Study Group offer?

The current Study Group which begins today will offer a certificate of completion to participants and also provide a jump start on earning course certifications for Introduction to Notebooks, Multiparadigm Data Science, and Introduction to Image Processing.

And wasn't it Knock out!

I hope I sleep tonight I'm febrile with anticipation.

I first got mathematica 10 - years ago but gave up on it because there was so much that it offered and like a blind man I kept stumbling. Last week I requested a trial of 12.1 but my desk old mac's OS couldn't cope...time for a new mac me thinks!

Thanks to those involved in this.

Jonathan

Hi Jonathan!

You don't have to wait to get a new computer. You can start with the Elementary Introduction to the Wolfram Language Interactive course and start coding in the cloud right now.

Have fun! :D

Thanks Lori I will,

Already a benifit for this course who knows what next

Jonathan.

I've just watched the AI presentation,

This is incredible I'm away of to the repository now...I may br some time!

Posted 4 months ago

Audio lost in video lecture!

@Sam Garwood, you might need to refresh your browser. Please submit a Question in the webinar interface to let us know how it's going.

After looking at the notebooks for this week's study group's topics, I'm really excited. These are exactly type of topics that I was hoping would become a Study group deep-dive.

Where can I get those notebooks?

The download link is included in your reminder email for the study group from Wolfram Virtual Events. You will also find them in the "Lesson Notebook" tab alongside each lecture in the course "Introduction to Notebooks"

Hi Abrita, I've really enjoyed your lectures sofar. I joined a week late and therefore didn't get the first reminder email with the download link to the notebooks for the first week. I know I can just paste examples from the "Lessons Notebooks" tab in "Intro to Notebooks" course as I work examples from last week's videos, but I'd like to have the mathematica-native versions of those notebooks for posterity if possible. Can you send me either that first reminder email or the link to last weeks notebooks contained within? Thanks! Nate

@Nathaniel Herman, here is a download link containing the Week 1 materials, including notebooks and Q&A transcripts: https://wolfr.am/NE3MscfP

Hello everyone. I want to know about the class of today. I am watching that they are talking about "introduction to notebooks". My question is: Today, all those videos were exposed? Thanks (i'm sorry but my english is terrible)

Hello @diego esteban gutierrez valencia, the video lessons from today were:

These videos can be watched from the interactive course Introduction to Notebooks. You can check your progress in this course by clicking on the Course Certificate icon in the toolbar. A certificate of course completion is available.

Hello everyone:

I see the notebooks attached in the reminder email. How can I load them?

Regards,

Rch

Hi Roberto, If you do not already have a Wolfram product like Mathematica or Wolfram Desktop, please consider getting a trial version of Wolfram | One which will provide you a download for the "Wolfram Desktop". You can open the notebooks in the Wolfram Desktop.

Posted 4 months ago

How do you found out about other study groups

Today's lecture videos:

And a daily challenge for you:

Post a snippet of code showing the cell expression for the style definition from a stylesheet, that will change the appearance of the CodeText style in a notebook as follows:

  • Background color: light purple
  • Font family: source serif pro
  • Font color: darker brown
  • Font slant: Italic
Posted 4 months ago
Cell[StyleData["CodeText"],
 FontFamily->"Source Serif Pro",
 FontSize->15,
 FontWeight->"Regular",
 FontSlant->"Italic",
 PrivateFontOptions->{"FontPostScriptName"->"Automatic"},
 FontColor->RGBColor[0.4, 0.267, 0.133],
 Background->RGBColor[0.94, 0.88, 0.94]]
CellPrint@
 Cell[StyleData["CodeText"], FontFamily -> "Source Serif Pro", 
  FontSlant -> "Italic", FontColor -> Darker[Brown], 
  Background -> LightPurple]

enter image description here

Posted 4 months ago

Cell[BoxData[ StyleBox[ RowBox[{"StyleData", "[", "\"\<CodeText\>\"", "]"}], FontColor->RGBColor[0.13713282978561075`, 0.09901579308766308, 0.06050202182040131], Background->RGBColor[0.94, 0.88, 0.94]]], "Input", FontFamily->"Source Serif Pro", FontWeight->"Regular", FontSlant->"Italic"]

Hi Jamie!

After my attention wavering yesterday, I'm not to bothered about presentation but do see that It brings clarity to long notebooks, I found today remarkable so much scope with so few commands! Thanks to the team.

Introduction to Notebooks course lecture videos covered on June 24:

Posted 4 months ago

Hello,

In Quiz 3, the code about DialogInput[] contains wrong type of quotation marks. One must change them back into standard ones (the one on the keyboard).

Thanks for the feedback. We will work on getting it fixed.

Today's challenge:

Share a snippet of code that will create a DockedCell for a notebook that will show the date and time when the notebook was last saved.

Hints: DockedCells, NotebookEventActions, EventHandler

This was a GOOOOD problem to work out!

Posted 4 months ago

Hello, the code below doesn't work properly, but I can't find how to "catch" the Save and force an update... :(

SetOptions[EvaluationNotebook[], DockedCells -> Cell[EventHandler[ DateString[], {{"MenuCommand", "Save"} :> (DateString[])}], "DockedCell"]]

Hello, Ildiko, below code can catch and handle the notebook save event:

this=EvaluationNotebook[];
 k = 0; SetOptions[this, 
 NotebookEventActions -> {{"MenuCommand", "Save"} :> k++}];

then you can interactively check value of k after save the notebook again and again,

Posted 4 months ago

Thank you! Unfortunately, I still don't see how to proceed. I guess, my issue is that I don't understand how these events are evaluated. When I added a Print[] after the k++, I could see the value changing, yet, I don't know how to pass now that changed value to a DockedCells definition. It seems to me as if everything related to the choosing of Save button (that is all the consequences) should be in one single command, right after detecting that event.

ok, here is the code can do the job:

this = EvaluationNotebook[];
k = "unsaved"; SetOptions[this, 
 DockedCells -> Cell[BoxData[ToBoxes[Dynamic[k]]], "DockedCell"]];
SetOptions[this, 
  NotebookEventActions -> {{"MenuCommand", 
      "Save"} :> (k = DateString[]), PassEventsDown -> True}];

Some key concepts including Dynamic[], event passing, docked cells expression acceptance...

Posted 4 months ago

Thank you! I tried to work with Dynamic, but ... I'll take note of this. Thanks again.

First daily challenge with dark gray background and white text because I love dark mode!

CellPrint[
 Cell[StyleData["CodeText"], FontFamily -> "Source Serif Pro", 
  FontSlant -> "Italic", FontColor -> White, 
  Background -> Darker@Gray]]

enter image description here

Introduction to Notebooks course lecture videos covered on June 25:

Daily Challenge:

Use Grid and its Background option to make a 64 square checker board. If that's too easy for you, share with us a unique grid you have created by playing with its different options.

CheckerBoard

Posted 4 months ago

Partition[ Flatten[Table[{{Red, Black}, {Black, Red}}, {4}, {4}], {2, 3}] // Flatten, 8] // ArrayPlot

Posted 4 months ago

Hi Sam,

A shorter way to generate the matrix

ConstantArray[{{Red, Black}, {Black, Red}}, {4, 4}] // ArrayFlatten // ArrayPlot
Posted 4 months ago

Hi Rohit, thank you, that's my experience with new languages: it starts with comprehension, but in the end it's always about the vocabulary...

I shall check out ConstantArray

Posted 4 months ago

I guess, there are more elegant solutions, but...it does the job...

Grid[Table[, {8}, {8}], Frame -> All, Background -> {{}, {}, Flatten[Table[ If[Mod[i + j, 2] == 0, {i, j} -> Red, {i, j} -> Black], {i, 1, 8}, {j, 1, 8}]]}]

Sure there are more efficient ways... but this one works just fine:

background[i, j] := If[EvenQ[i + j], Red, Black]; color = Flatten[Table[{i, j} -> background[i, j], {i, 8}, {j, 8}]]; Grid[Table[[Placeholder], {8}, {8}], Frame -> All, Background -> {None, None, color}]

Went a little crazy, Enjoy! (Edited to add color data for the last three grids.)

Grid[Table[
  Graphics[{Opacity[0], RegularPolygon[4]}, ImageSize -> 20], {i, 
   9}, {j, 9}], 
 Background -> {Automatic, Automatic, 
   Flatten@Table[{i, j} -> 
      If[EvenQ[Plus[i, j]], Darker@Red, Gray], {i, 9}, {j, 9}]}, 
 Spacings -> {1, 1}]

Red and gray checkerboard

Dotted borders:

Grid[Table[
  Graphics[{Opacity[0], RegularPolygon[4]}, ImageSize -> 20], {i, 
   8}, {j, 8}], 
 Background -> {Automatic, Automatic, 
   Flatten@Table[{i, j} -> 
      If[EvenQ[Plus[i, j]], Darker@Red, Darker@Gray], {i, 8}, {j, 
      8}]}, Frame -> All, FrameStyle -> Directive[Thick, Dotted]]

Dotted borders:

Red gray plaid:

Grid[Table[
  Graphics[{Opacity[0], RegularPolygon[4]}, ImageSize -> 20], {i, 
   7}, {j, 7}], 
 Background -> {Automatic, Automatic, 
   Flatten@Table[{i, j} -> 
      If[OddQ[i] && OddQ[j], Darker@Red, Gray], {i, 8}, {j, 8}]}]

Red gray plaid

Red, white, gray check:

Grid[Table[ Graphics[{Opacity[0], RegularPolygon[4]}, ImageSize -> 20], {i, 7}, {j, 7}], Background -> {Automatic, Automatic, Flatten@Table[{i, j} -> Which[OddQ[i] && OddQ[j], Darker@Red, EvenQ[i] && EvenQ[j], Gray], {i, 8}, {j, 8}]}]

Red, white, gray check:

four-color plaid:

Grid[Table[
  Graphics[{Opacity[0], RegularPolygon[6]}, ImageSize -> 20], {i, 
   7}, {j, 7}], 
 Background -> {Automatic, Automatic, 
   Flatten@Table[{i, j} -> 
      Which[OddQ[i] && OddQ[j], Darker@Red, EvenQ[i] && OddQ[j], Gray,
        OddQ[i] && EvenQ[j], Blend[{Darker@Red, Yellow}]], {i, 8}, {j,
       8}]}]

four-color plaid

Raspberry diagonal:

slants05 = 
 Table[RotateRight[
   Table[Blend[{Darker@Red, White, Darker@Magenta}, n], {n, 0, 1, 
     1/7}], Floor[Sqrt[(2 j)^2]]], {j, 0, 7}];
Grid[Table[
      Graphics[{Opacity[0], RegularPolygon[4]}, ImageSize -> 20], {i, 
       8}, {j, 8}], 
     Background -> {Automatic, Automatic, 
   Flatten@Table[{i, j} -> slants05[[i, j]], {i, 8}, {j, 8}]}]

Raspberry diagonal:

Strange offset:

slants06 = 
 Table[RotateRight[
   Table[Darker@Blend[{Red, Gray, White, Gray, Red}, n], {n, 0, 1, 
     1/12}], (-3)^j], {j, 0, 13}];
Grid[Table[
      Graphics[{Opacity[0], RegularPolygon[4]}, ImageSize -> 20], {i, 
       13}, {j, 13}], 
     Background -> {Automatic, Automatic, 
       Flatten@Table[{i, j} -> slants06[[i, j]], {i, 13}, {j, 13}]}]

Strange offset:

Sideways wavy:

slants07 = 
 Table[RotateRight[
   Table[Blend[{Red, Orange, Darker@Red, Orange, Red}, n], {n, 0, 1, 
     1/24}], Mod[j^2, 10]], {j, 0, 24}] ;   
Grid[Table[
      Graphics[{Opacity[0], RegularPolygon[4]}, ImageSize -> 10], {i, 
       24}, {j, 24}], 
     Background -> {Automatic, Automatic, 
       Flatten@Table[{i, j} -> slants07[[i, j]], {i, 24}, {j, 24}]}]

sideways wavy

Attended this morning lecture on Notebooks. They made mention of a quiz that was reporteded announced in the earlier email reminder. I don't see that - probably because I registered minutes before ;-) Could you announce the quiz location here? or send it to me privately? Thanks.

@paulerickson we will email you the link to the quiz along with all the other links to recordings, related resources etc. on Sunday. Look out for an email from "Wolfram Virtual Events" (domain gotowebinar.com)

Posted 4 months ago

A bit off topic, but the easiest way, in my opinion, is not to use Grid at all for this but ArrayPlot

ArrayPlot[Table[Mod[i + j, 2], {i, 8}, {j, 8}], Frame -> False, 
 ColorRules -> {0 -> Red, 1 -> Black}]

then the result is also "scalable".

Absolutely - TMTOWTDI :) ArrayPlot would be another way.

Grid[Table[Style[1, Opacity[0]], {8}, {8}], Frame -> All, 
     Background -> {{}, {}, 
       Flatten@Table[
         If[EvenQ[i + j], {i, j} -> Red, {i, j} -> Black], {i, 8}, {j, 
          8}]}]

enter image description here

Another code, the same result:

Grid[Table[Style[1, Opacity[0]], {8}, {8}], Frame -> All, 
 Background -> {{}, {}, 
   If[EvenQ[Total[#]], # -> Red, # -> Black] & /@ 
    Flatten[Array[List, {8, 8}], 1]}]

EUREKA! This only sets the docked cell at the "CMD+S" or menu SAVE action:

SetOptions[InputNotebook[], 
 NotebookEventActions -> {{"MenuCommand", "Save"} :> 
    SetOptions[InputNotebook[], 
     DockedCells -> Cell[DateString[], "DockedCell"]]}]

THIS sets the docked cell AND SAVES the CURRENT document. Formatting comes from the edited stylesheet::

nb = InputNotebook[];
SetOptions[nb, 
NotebookEventActions -> {{"MenuCommand", 
"Save"} :> (SetOptions[nb, 
DockedCells -> Cell[DateString[], "DockedCell"]];
NotebookSave[nb])}]

enter image description here

nice and compact, this is cheaper than using dynamic[], cheers! one point is about event passing, to save the document twice is more expensive than pass the event down stream to the default event handler.

ok, if you don't pass the event down, you save the doc yourself, that also the same thing. this part of code always the first guy in the handlers queue.

Posted 4 months ago

Thank you, Vincent!

You can see from my first chunk of code that the document wasn't actually saved. I found the fix in the "Possible Issues" section for "NotebookEventActions". SO, ALWAYS check the POSSIBLE ISSUES sections. Several of my solutions have come from these respective sections of the documentation.

Hope to "see" you for future challenges :-D

Hello, I wanted to know if 6 quizzes of the notebook module are valid for certification, I did it but it does not appear to me that I have taken them. Regards,

Hi @Roberto Chang, Could you please email wolfram-u@wolfram.com with your Wolfram ID so we can investigate this further? Thanks

Dear all,

Can anyone tell me how to plot a number of PredictorFunction simultaneously? Thanks in advance. Best

Thank you. It is interesting to see that it works without specifying the domain variable. Would "randomforest[x_]:= Predict[data,Method-> "RandomForest"]" work, as well? (I will check later by myself)

Best wishes,

Hello, I have a question about the certificate. I answered everything and I watched the videos, but I can't download the certificate. At each test it shows me that the test is passed. But in the Course Certificate writes that I have no progress. If you can answer me what is the problem? Thank you. Respectfully,

Hi Diana, Could you please email wolfram-u@wolfram.com with the name of the course and the Wolfram ID you used to complete the quizzes.

Hi Abrita, I was not able to properly download "creatures.mx" data. Can you tell me where and how to download separately? Thanks in advance. Best wishes,

You can get the legendary creatures data from this notebook:

Hi Abrita, How can I assign (if it is possible) labels (or strings) to "Classes" in the ClusterClassify function? And how can I generate labeled data table or list after using ClusterClassify function conveniently?

ClusterClassify will return numerical indices for each cluster-based class. You could just replace the index number with a label.

SeedRandom[1234];
colors = RandomColor[20];
c = ClusterClassify[colors, 3]
c[colors]
% /. {1-> "Class A",2-> "Class B", 3 -> "Class C"}

Hi, Abrita,

I got the following error message when evaluating the cell:

breastCancerData = Import[FileNameJoin[{NotebookDirectory[], "data", "breast-cancer-wisconsin.data"}]]; Import::nffil: File C:\Users\Thereds\Documents\Wolfram Mathematica\Wolfram Univ Study Group 2020\Multiparadigm Data Science\data\breast-cancer-wisconsin.data not found during Import.

What is the problem? Do I need to change the directory or the property of "breast-cancer-wisconsin.data"?

Sorry. The data file was not included with the notebook in the download link we provided. You can get the data file from the location https://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/breast-cancer-wisconsin.data

So just use the following instead of the code in the notebook:

breastCancerData = Import["https://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/breast-cancer-wisconsin.data"]

Thank you for this information and above!

Posted 4 months ago

The problem with ClusterClassify that showed up during todays session looks like a bug introduced in 12.1 and present in 12.1.1 as well. Works fine on 12.0

$Version
(* 12.0.0 for Mac OS X x86 (64-bit) (April 7, 2019) *)

breastCancerData = 
  Import["https://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/breast-cancer-wisconsin.data"];

cc = ClusterClassify[breastCancerData[[All, 2 ;; -2]]]

enter image description here

$Version
(* 12.1.0 for Mac OS X x86 (64-bit) (March 14, 2020) *)

cc = ClusterClassify[breastCancerData[[All, 2 ;; -2]]]

enter image description here

Thanks for sharing this @Rohit Namjoshi

Posted 4 months ago

Abrita, For Quiz 2 Problem 8, it appears that the auto grader considers an incorrect answer (as per the documentation) as correct. Can you please confirm. Rajeev

Posted 4 months ago

@Abrita Chakravarty I agree with @rjehanathan the answer to Question 8 in Quiz 2 for Week 2 Section about Machine Learning is not correct. I tried it with an example to confirm. The only way to get 100% score is by accepting the incorrect answer.

Thanks. We are working on setting it right.

Hi Abrita,

I have a number of questions about the topic of Anomaly Detection:

  1. The Boston Homes Dataset has a number of properties (with multiple column head or names of variables). If we generate AnomalyDetection function without specifying the variable, what kind of anomaly are we detecting? If I want to control a particular variable and want to detect anomaly within the values of that variable (e.g., "RM" or "DIS"), what should I do?

  2. Is "FinancialData["SP500"] available?

  3. What's the proper format of "anomaly" to avoid the following error message? ("anomalies = FindAnomalies[pdata, AcceptanceThreshold -> 0.001`]; FindAnomalies::mlbddata: The data is not formatted correctly.)

  4. What does SynthesizeMissingValues do in the numerical example? Is it taking a kind of moving average? What if the data is binary (e.g., Yes or No, or 0 or 1)? What kinds of Method is this function using in each case, and why?

This is just a silly example for fun.

Posted 4 months ago

Just want to confirm this forum page will deal with queries from all three weeks of the current study group right?

Yes, sure.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract