Compare commits

...

13 Commits

Author SHA1 Message Date
eslopfer f8f5b8c9e8
Merge ca0881b4c6 into 2f7977a95a 2024-09-19 09:40:14 +03:00
Oumaima Fisaoui 2f7977a95a Chore(AI): Fix sp500 subject and audit 2024-09-09 09:58:11 +01:00
Oumaima Fisaoui 1d34ea0a71 Chore(DPxAI): Fix format 2024-09-06 11:18:31 +01:00
Oumaima Fisaoui 75472c0ed6 Chore(DPxAI): Fix format 2024-09-06 11:18:31 +01:00
Oumaima Fisaoui cccab05477 Chore(DPxAI): Fix format 2024-09-06 11:18:31 +01:00
Oumaima Fisaoui aa54ab1e66 Chore(DPxAI): Fix format 2024-09-06 11:18:31 +01:00
Oumaima Fisaoui 62486ed720 Chore(DPxAI): Fix the accuracy on test set 2024-09-06 11:18:31 +01:00
Oumaima Fisaoui 659074232f Chore(AI): Fix emotions detector 2024-09-06 11:18:31 +01:00
eslopfer ca0881b4c6 chore(happiness_manager): remove wine reference that slipped through 2022-12-29 20:17:44 +00:00
eslopfer 16c745ae9b chore(happiness-manager): fix typos 2022-12-29 20:15:27 +00:00
eslopfer 337ee68d21 chore(happiness_manager): modify subject description and tests to remove references to alcohol 2022-12-29 20:00:40 +00:00
eslopfer 48473b89d4 chore(level-up): fix typo 2022-12-29 18:52:20 +00:00
eslopfer 27d641de15 chore(level-up): modify subject description and tests to remove references to alcohol 2022-12-29 18:50:57 +00:00
7 changed files with 84 additions and 77 deletions

View File

@ -100,52 +100,52 @@ tests.push(async ({ eq, ctx }) => {
}) })
tests.push(async ({ eq, ctx }) => { tests.push(async ({ eq, ctx }) => {
// test when vips answer { drink: 'beer' } // test when vips answer { drink: 'iced-tea' }
// should create a list with 6-packs-beers and potatoes // should create a list with iced-tea-bottles and potatoes
const answers = [ const answers = [
{ answer: 'no', drink: 'beer' }, { answer: 'no', drink: 'beer' },
...ctx.createAnswers(1, { answer: 'yes', drink: 'beer' }), ...ctx.createAnswers(1, { answer: 'yes', drink: 'iced-tea' }),
] ]
await ctx.setAnswersIn({ dir: 'guests', answers }) await ctx.setAnswersIn({ dir: 'guests', answers })
const { data } = await ctx.run('guests', 'happy-beer-list.json') const { data } = await ctx.run('guests', 'happy-iced-tea-list.json')
return eq(data, { potatoes: 1, '6-packs-beers': 1 }) return eq(data, { potatoes: 1, 'iced-tea-bottles': 1 })
}) })
tests.push(async ({ eq, ctx }) => { tests.push(async ({ eq, ctx }) => {
// test when vips answer { drink: 'beer' } // test when vips answer { drink: 'iced-tea' }
// should create a list with 6-packs-beers and potatoes // should create a list with iced-tea-bottles and potatoes
const answers = [ const answers = [
{ answer: 'no', drink: 'beer' }, { answer: 'no', drink: 'iced-tea' },
...ctx.createAnswers(6, { answer: 'yes', drink: 'beer' }), ...ctx.createAnswers(6, { answer: 'yes', drink: 'iced-tea' }),
] ]
await ctx.setAnswersIn({ dir: 'guests', answers }) await ctx.setAnswersIn({ dir: 'guests', answers })
const { data } = await ctx.run('guests', 'happy-beer-pack-list.json') const { data } = await ctx.run('guests', 'happy-iced-tea-bottles-list.json')
return eq(data, { potatoes: 6, '6-packs-beers': 1 }) return eq(data, { potatoes: 6, 'iced-tea-bottles': 1 })
}) })
tests.push(async ({ eq, ctx }) => { tests.push(async ({ eq, ctx }) => {
// test when vips answer { drink: 'wine' } // test when vips answer { drink: 'sparkling-water' }
// should create a list with wine-bottles and potatoes // should create a list with sparkling-water-bottles and potatoes
const answers = [ const answers = [
...ctx.createAnswers(3, { answer: 'no', drink: 'wine' }), ...ctx.createAnswers(3, { answer: 'no', drink: 'sparkling-water' }),
...ctx.createAnswers(5, { answer: 'yes', drink: 'wine' }), ...ctx.createAnswers(5, { answer: 'yes', drink: 'sparkling-water' }),
] ]
await ctx.setAnswersIn({ dir: 'guests', answers }) await ctx.setAnswersIn({ dir: 'guests', answers })
const { data } = await ctx.run('guests', 'happy-wine-list.json') const { data } = await ctx.run('guests', 'happy-sparkling-water-list.json')
return eq(data, { potatoes: 5, 'wine-bottles': 2 }) return eq(data, { potatoes: 5, 'sparkling-water-bottles': 2 })
}) })
tests.push(async ({ eq, ctx }) => { tests.push(async ({ eq, ctx }) => {
// test when vips answer { drink: 'wine' } // test when vips answer { drink: 'sparkling-water' }
// should create a list with wine-bottles and potatoes // should create a list with sparkling-water-bottles and potatoes
const answers = ctx.createAnswers(8, { answer: 'yes', drink: 'wine' }) const answers = ctx.createAnswers(8, { answer: 'yes', drink: 'sparkling-water' })
await ctx.setAnswersIn({ dir: 'guests', answers }) await ctx.setAnswersIn({ dir: 'guests', answers })
const { data } = await ctx.run('guests', 'happy-wine-bottle-list.json') const { data } = await ctx.run('guests', 'happy-sparkling-water-bottles-list.json')
return eq(data, { potatoes: 8, 'wine-bottles': 2 }) return eq(data, { potatoes: 8, 'sparkling-water-bottles': 2 })
}) })
tests.push(async ({ eq, ctx }) => { tests.push(async ({ eq, ctx }) => {
@ -365,12 +365,12 @@ tests.push(async ({ eq, ctx }) => {
}), }),
...ctx.createAnswers(6, { answer: 'yes', food: 'vegan', drink: 'water' }), ...ctx.createAnswers(6, { answer: 'yes', food: 'vegan', drink: 'water' }),
...ctx.createAnswers(2, { answer: 'yes', food: 'veggie', drink: 'water' }), ...ctx.createAnswers(2, { answer: 'yes', food: 'veggie', drink: 'water' }),
...ctx.createAnswers(3, { answer: 'yes', food: 'veggie', drink: 'beer' }), ...ctx.createAnswers(3, { answer: 'yes', food: 'veggie', drink: 'iced-tea' }),
...ctx.createAnswers(11, { answer: 'yes', food: 'fish', drink: 'wine' }), ...ctx.createAnswers(11, { answer: 'yes', food: 'fish', drink: 'sparkling-water' }),
...ctx.createAnswers(4, { ...ctx.createAnswers(4, {
answer: 'yes', answer: 'yes',
food: 'everything', food: 'everything',
drink: 'beer', drink: 'iced-tea',
}), }),
] ]
await ctx.setAnswersIn({ dir: 'guests', answers }) await ctx.setAnswersIn({ dir: 'guests', answers })
@ -388,8 +388,8 @@ tests.push(async ({ eq, ctx }) => {
sardines: 11, sardines: 11,
burgers: 2, burgers: 2,
kebabs: 4, kebabs: 4,
'6-packs-beers': 2, 'iced-tea-bottles': 2,
'wine-bottles': 3, 'sparkling-water-bottles': 3,
'water-bottles': 2, 'water-bottles': 2,
'soft-bottles': 1, 'soft-bottles': 1,
}) })

View File

@ -8,16 +8,16 @@
"code": "equal(shaker.length, 3)" "code": "equal(shaker.length, 3)"
}, },
{ {
"description": "shaker can make a cocktail.", "description": "shaker can make a skinny milkshake.",
"code": "equal(shaker(1, 'strawberry', true), '1 strawberry cocktail')" "code": "equal(shaker(1, 'strawberry', true), '1 skinny strawberry milkshake')"
}, },
{ {
"description": "shaker can make a milkshake.", "description": "shaker can make a milkshake.",
"code": "equal(shaker(1, 'strawberry', false), '1 strawberry milkshake')" "code": "equal(shaker(1, 'strawberry', false), '1 strawberry milkshake')"
}, },
{ {
"description": "shaker can make multiple cocktails.", "description": "shaker can make multiple skinny milkshakes.",
"code": "equal(shaker(7, 'banana', true), '7 banana cocktails')" "code": "equal(shaker(7, 'banana', true), '7 skinny banana milkshakes')"
}, },
{ {
"description": "shaker can make multiple milkshakes.", "description": "shaker can make multiple milkshakes.",
@ -25,6 +25,6 @@
}, },
{ {
"description": "shaker is shakin it right.", "description": "shaker is shakin it right.",
"code": "equal(shaker(1, 'vanilla', true), '1 vanilla cocktail')\nequal(shaker(1, 'mango', true), '1 mango cocktail')\nequal(shaker(2, 'banana', true), '2 banana cocktails')\nequal(shaker(2, 'chocolate', false), '2 chocolate milkshakes')\nequal(shaker(2, 'vanilla', false), '2 vanilla milkshakes')\nequal(shaker(2, 'strawberry', false), '2 strawberry milkshakes')" "code": "equal(shaker(1, 'vanilla', true), '1 skinny vanilla milkshake')\nequal(shaker(1, 'mango', true), '1 skinny mango milkshake')\nequal(shaker(2, 'banana', true), '2 skinny banana milkshakes')\nequal(shaker(2, 'chocolate', false), '2 chocolate milkshakes')\nequal(shaker(2, 'vanilla', false), '2 vanilla milkshakes')\nequal(shaker(2, 'strawberry', false), '2 strawberry milkshakes')"
} }
] ]

View File

@ -1,18 +1,22 @@
## Emotions detection with Deep Learning ## Emotions detection with Deep Learning
Cameras are everywhere. Videos and images have become one of the most interesting data sets for artificial intelligence. Cameras are everywhere. Videos and images have become one of the most interesting data sets for artificial intelligence.
Image processing is a quite broad research area, not just filtering, compression, and enhancement. Besides, we are even interested in the question, “what is in images?”, i.e., content analysis of visual inputs, which is part of the main task of computer vision. Image processing is a quite broad research area, not just filtering, compression, and enhancement.
The study of computer vision could make possible such tasks as 3D reconstruction of scenes, motion capturing, and object recognition, which are crucial for even higher-level intelligence such as image and video understanding, and motion understanding.
For this 2 months project we will
focus on two tasks:
- emotion classification Besides, we are even interested in the question, “what is in images?”, i.e., content analysis of visual inputs, which is part of the main task of computer vision.
- face tracking
The study of computer vision could make possible such tasks as 3D reconstruction of scenes, motion capturing, and object recognition, which are crucial for even higher-level intelligence such as image and video understanding, and motion understanding.
For this project we will focus on two tasks:
- Emotion classification
- Face tracking
With the computing power exponentially increasing the computer vision field has been developing exponentially. This is a key element because the computer power allows using more easily a type of neural networks very powerful on images: With the computing power exponentially increasing the computer vision field has been developing exponentially. This is a key element because the computer power allows using more easily a type of neural networks very powerful on images:
CNN's (Convolutional Neural Networks). Before the CNNs were democratized, the algorithms used relied a lot on human analysis to extract features which obviously time-consuming and not reliable. If you're interested in the "old
school methodology" [this article](https://towardsdatascience.com/classifying-facial-emotions-via-machine-learning-5aac111932d3) explains it. - CNN's (Convolutional Neural Networks). Before the CNNs were democratized, the algorithms used relied a lot on human analysis to extract features which obviously time-consuming and not reliable. If you're interested in the "old school methodology" [this article](https://towardsdatascience.com/classifying-facial-emotions-via-machine-learning-5aac111932d3) explains it.
The history behind this field is fascinating! [Here](https://kapernikov.com/basic-introduction-to-computer-vision/) is a short summary of its history.
- The history behind this field is fascinating! [Here](https://kapernikov.com/basic-introduction-to-computer-vision/) is a short summary of its history.
### Project goal and suggested timeline ### Project goal and suggested timeline
@ -31,15 +35,18 @@ The two steps are detailed below.
### Preliminary: ### Preliminary:
- Take [this course](https://www.coursera.org/learn/convolutional-neural-networks). This course is a reference for many reasons and one of them is the creator: **Andrew Ng**. He explains the basics of CNNs but also some more advanced topics as transfer learning, siamese networks etc ... - Take [this course](https://www.coursera.org/learn/convolutional-neural-networks). This course is a reference for many reasons and one of them is the creator: **Andrew Ng**. He explains the basics of CNNs but also some more advanced topics as transfer learning, siamese networks etc ...
I suggest to focus on Week 1 and 2 and to spend less time on Week 3 and 4. Don't worry the time scoping of such MOOCs are conservative. You can attend the lessons for free! - I suggest to focus on Week 1 and 2 and to spend less time on Week 3 and 4. Don't worry the time scoping of such MOOCs are conservative. You can attend the lessons for free!
- Participate in [this challenge](https://www.kaggle.com/c/digit-recognizer/code). The MNIST dataset is a reference in computer vision. Researchers use it as a benchmark to compare their models. - Participate in [this challenge](https://www.kaggle.com/c/digit-recognizer/code). The MNIST dataset is a reference in computer vision. Researchers use it as a benchmark to compare their models.
Start first with a logistic regression to understand how to handle images in Python. And then train your first CNN on this data set.
- Start first with a logistic regression to understand how to handle images in Python. And then train your first CNN on this data set.
### Face emotions classification ### Face emotions classification
Emotion detection is one of the most researched topics in the modern-day machine learning arena. The ability to accurately detect and identify an emotion opens up numerous doors for Advanced Human Computer Interaction. Emotion detection is one of the most researched topics in the modern-day machine learning arena. The ability to accurately detect and identify an emotion opens up numerous doors for Advanced Human Computer Interaction.
The aim of this project is to detect up to seven distinct facial emotions in real time. This project runs on top of a Convolutional Neural Network (CNN) that is built with the help of Keras whose backend is TensorFlow in Python. The aim of this project is to detect up to seven distinct facial emotions in real time.
This project runs on top of a Convolutional Neural Network (CNN) that is built with the help of Keras whose backend is TensorFlow in Python.
The facial emotions that can be detected and classified by this system are Happy, Sad, Angry, Surprise, Fear, Disgust and Neutral. The facial emotions that can be detected and classified by this system are Happy, Sad, Angry, Surprise, Fear, Disgust and Neutral.
Your goal is to implement a program that takes as input a video stream that contains a person's face and that predicts the emotion of the person. Your goal is to implement a program that takes as input a video stream that contains a person's face and that predicts the emotion of the person.
@ -49,10 +56,10 @@ Your goal is to implement a program that takes as input a video stream that cont
- Download and unzip the [data here](https://assets.01-edu.org/ai-branch/project3/emotions-detector.zip). - Download and unzip the [data here](https://assets.01-edu.org/ai-branch/project3/emotions-detector.zip).
This dataset was provided for this past [Kaggle challenge](https://www.kaggle.com/competitions/challenges-in-representation-learning-facial-expression-recognition-challenge/overview). This dataset was provided for this past [Kaggle challenge](https://www.kaggle.com/competitions/challenges-in-representation-learning-facial-expression-recognition-challenge/overview).
It is possible to find more information about on the challenge page. Train a CNN on the dataset `train.csv`. Here is an [example of architecture](https://www.quora.com/What-is-the-VGG-neural-network) you can implement. It is possible to find more information about on the challenge page. Train a CNN on the dataset `train.csv`. Here is an [example of architecture](https://www.quora.com/What-is-the-VGG-neural-network) you can implement.
**The CNN has to perform more than 70% on the test set**. You can use the `test_with_emotions.csv` file for this. You will see that the CNNs take a lot of time to train. **The CNN has to perform more than 60% on the test set**. You can use the `test_with_emotions.csv` file for this. You will see that the CNNs take a lot of time to train.
You don't want to overfit the neural network. I strongly suggest to use early stopping, callbacks and to monitor the training using the `TensorBoard`. You don't want to overfit the neural network. I strongly suggest to use early stopping, callbacks and to monitor the training using the `TensorBoard`.
You have to save the trained model in `my_own_model.pkl` and to explain the chosen architecture in `my_own_model_architecture.txt`. Use `model.summary())` to print the architecture. You have to save the trained model in `final_emotion_model.keras` and to explain the chosen architecture in `final_emotion_model_arch.txt`. Use `model.summary())` to print the architecture.
It is also expected that you explain the iterations and how you end up choosing your final architecture. Save a screenshot of the `TensorBoard` while the model's training in `tensorboard.png` and save a plot with the learning curves showing the model training and stopping BEFORE the model starts overfitting in `learning_curves.png`. It is also expected that you explain the iterations and how you end up choosing your final architecture. Save a screenshot of the `TensorBoard` while the model's training in `tensorboard.png` and save a plot with the learning curves showing the model training and stopping BEFORE the model starts overfitting in `learning_curves.png`.
- Optional: Use a pre-trained CNN to improve the accuracy. You will find some huge CNN's architecture that perform well. The issue is that it is expensive to train them from scratch. - Optional: Use a pre-trained CNN to improve the accuracy. You will find some huge CNN's architecture that perform well. The issue is that it is expensive to train them from scratch.
@ -86,13 +93,10 @@ project
├── environment.yml ├── environment.yml
├── README.md ├── README.md
├── results ├── results
│   ├── hack_cnn
│   │   ├── hacked_image.png
│   │   └── input_image.png
│   ├── model │   ├── model
│   │   ├── learning_curves.png │   │   ├── learning_curves.png
│   │   ├── my_own_model_architecture.txt │   │   ├── final_emotion_model_arch.txt
│   │   ├── my_own_model.pkl │   │   ├── final_emotion_model.keras
│   │   ├── pre_trained_model_architecture.txt │   │   ├── pre_trained_model_architecture.txt
│   │   └── pre_trained_model.pkl │   │   └── pre_trained_model.pkl
│   └── preprocessing_test │   └── preprocessing_test
@ -101,7 +105,7 @@ project
│   ├── image_n.png │   ├── image_n.png
│   └── input_video.mp4 │   └── input_video.mp4
└── scripts └── scripts
├── hack_the_cnn.py |__ validation_loss_accuracy.py
├── predict_live_stream.py ├── predict_live_stream.py
├── predict.py ├── predict.py
├── preprocess.py ├── preprocess.py
@ -114,7 +118,7 @@ project
```prompt ```prompt
python ./scripts/predict.py python ./scripts/predict.py
Accuracy on test set: 72% Accuracy on test set: 62%
``` ```

View File

@ -24,12 +24,12 @@
###### Does the text document explain why the architecture was chosen, and what were the previous iterations? ###### Does the text document explain why the architecture was chosen, and what were the previous iterations?
###### Does the following command `python ./scripts/predict.py` run without any error and returns an accuracy greater than 70%? ###### Does the following command `python ./scripts/predict.py` run without any error and returns an accuracy greater than 60%?
```prompt ```prompt
python ./scripts/predict.py python ./scripts/predict.py
Accuracy on test set: 72% Accuracy on test set: 62%
``` ```

View File

@ -1,10 +1,12 @@
## Financial strategies on the SP500 ## Financial strategies on the SP500
In this project we will apply machine to finance. You are a Quant/Data Scientist and your goal is to create a financial strategy based on a signal outputted by a machine learning model that over-performs the [SP500](https://en.wikipedia.org/wiki/S%26P_500). In this project, you'll apply machine learning to finance. Your goal as a Quant/Data Scientist is to create a financial strategy that uses a signal generated by a machine learning model to outperform the [SP500](https://en.wikipedia.org/wiki/S%26P_500).
The Standard & Poor's 500 Index is a collection of stocks intended to reflect the overall return characteristics of the stock market as a whole. The stocks that make up the S&P 500 are selected by market capitalization, liquidity, and industry. Companies to be included in the S&P are selected by the S&P 500 Index Committee, which consists of a group of analysts employed by Standard & Poor's. The S&P 500 Index is a collection of 500 stocks that represent the overall performance of the U.S. stock market. The stocks in the S&P 500 are chosen based on factors like market value, liquidity, and industry. These selections are made by the S&P 500 Index Committee, which is a group of analysts from Standard & Poor's.
The S&P 500 Index originally began in 1926 as the "composite index" comprised of only 90 stocks. According to historical records, the average annual return since its inception in 1926 through 2018 is approximately 10%11%. The average annual return since adopting 500 stocks into the index in 1957 through 2018 is roughly 8%.
As a Quant Researcher, you may beat the SP500 one year or few years. The real challenge though is to beat the SP500 consistently over decades. That's what most hedge funds in the world are trying to do. The S&P 500 started in 1926 with only 90 stocks and has grown to include 500 stocks since 1957. Historically, the average annual return of the S&P 500 has been about 10-11% since 1926, and around 8% since 1957.
As a Quantitative Researcher, your challenge is to develop a strategy that can consistently outperform the S&P 500, not just in one year, but over many years. This is a difficult task and is the primary goal of many hedge funds around the world.
The project is divided in parts: The project is divided in parts:
@ -199,4 +201,5 @@ Note: `features_engineering.py` can be used in `gridsearch.py`
### Files for this project ### Files for this project
You can find the data required for this project in this [link](https://assets.01-edu.org/ai-branch/project4/project04-20221031T173034Z-001.zip) You can find the data required for this project in this :
[link](https://assets.01-edu.org/ai-branch/project4/project04-20221031T173034Z-001.zip)

View File

@ -7,21 +7,21 @@
As you're smart, you asked every guest of the party to precise in their answer As you're smart, you asked every guest of the party to precise in their answer
the kind of drink they would enjoy and the kind of food they would die for. the kind of drink they would enjoy and the kind of food they would die for.
Create a `happiness-manager.mjs` script that sort, who wants to drink what and Create a `happiness-manager.mjs` script that sorts, who wants to drink what and
who wants to eat what and integrate that in your barbecue's shopping list! who wants to eat what and integrate that in your barbecue's shopping list!
> note that you must only consider **vips** guests, those that answerd `'yes'` > note that you must only consider as **VIP** guests, those that answered `'yes'`
The script must: The script must:
- Take a directory as first argument (the `guest` directory) - Take a directory as first argument (the `guest` directory)
- Take a file `.json` as second argument: - Take a file `.json` as second argument:
- If the file already exists, it will add the informations to it. If some elements already exist in the original file, it will be replaced by new values. - If the file already exists, it will add the information to it. If some elements already exist in the original file, it will be replaced by new values.
- If it doesn't, the script must handle the creation of the file. - If it doesn't, the script must handle the creation of the file.
- Handle case when no one answered yes to the invitation: - Handle the case when no one answered yes to the invitation:
- `No one is coming.` has to appear in console. - `No one is coming.` has to appear in the console.
- No file is updated/created. - No file is updated/created.
- Handle cases when answers contains no "food" information, or no "drink" - Handle cases when answers contain no "food" information, or no "drink"
information information
- Handle cases when no one has chosen a category (for example: no one chose to - Handle cases when no one has chosen a category (for example: no one chose to
drink softs). This category should not appear in the final list. drink softs). This category should not appear in the final list.
@ -29,24 +29,24 @@ The script must:
You have to handle the info like this: You have to handle the info like this:
- Drinks: - Drinks:
- Beers: 1 pack / 6 vips (rounded up). Expected key: `6-packs-beers`. - Iced tea: 1 pack / 6 VIPs (rounded up). Expected key: `iced-tea-bottles`.
- Water, wine, softs: 1 bottle / 4 vips in each category (rounded up). - Water, sparkling water, softs: 1 bottle / 4 VIPs in each category (rounded up).
Expected keys: `wine-bottles`, `water-bottles`, `soft-bottles`. Expected keys: `sparkling-water-bottles`, `water-bottles`, `soft-bottles`.
- Food: - Food:
- Veggies and vegans: 1 eggplant, 1 courgette, 3 mushrooms and 1 hummus / 3 - Veggies and vegans: 1 eggplant, 1 courgette, 3 mushrooms and 1 hummus / 3
vips in these categories put together. Expected keys: `eggplants`, VIPs in these categories put together. Expected keys: `eggplants`,
`mushrooms`, `hummus`, `courgettes`. `mushrooms`, `hummus`, `courgettes`.
- Carnivores: 1 burger per person. Expected key: `burgers`. - Carnivores: 1 burger per person. Expected key: `burgers`.
- Fish lovers: 1 sardine per person. Expected key: `sardines`. - Fish lovers: 1 sardine per person. Expected key: `sardines`.
- Omnivores: 1 chicken+shrimps+pepper kebab / person. Expected key: `kebabs`. - Omnivores: 1 chicken+shrimps+pepper kebab / person. Expected key: `kebabs`.
- Bonus: you'll add 1 potatoe per person (all categories put together). - Bonus: you'll add 1 potato per person (all categories put together).
Expected key: `potatoes`. Expected key: `potatoes`.
The infos have to be formated like this in the `.json` file: The info has to be formated like this in the `.json` file:
```js ```js
{ {
"key": 1 // according to actual number associated to the elem "key": 1 // according to actual number associated to the element
} }
``` ```

View File

@ -27,24 +27,24 @@ the string `happy` or not. The possibilities are becoming limitless...
### Instructions ### Instructions
As Rick's robot, you are continuing your training to add yourself new ... skills As Rick's robot, you are continuing your training to add yourself new ... skills
(I could have said funtions). You want now to become a robot bartender. (I could have said functions). You want now to become a robot barista.
Define the function `shaker` which will take as arguments: Define the function `shaker` which will take as arguments:
- `quantity`, which will be variable of type `Number` - `quantity`, which will be variable of type `Number`
- `fruit`, which will be a `String` - `fruit`, which will be a `String`
- `alcohol`, which will be a `Boolean` - `diet`, which will be a `Boolean`
`shaker` must return a `String`. Look at the examples below to understand how `shaker` must return a `String`. Look at the examples below to understand how
`shaker` must mix its ingredients: `shaker` must mix its ingredients:
```js ```js
console.log(shaker(1, 'strawberry', true)) console.log(shaker(1, 'strawberry', true))
//'1 strawberry cocktail' //'1 skinny strawberry milkshake'
console.log(shaker(2, 'chocolate', false)) console.log(shaker(2, 'chocolate', false))
//'2 chocolate milkshakes' //'2 chocolate milkshakes'
console.log(shaker(2, 'strawberry', true)) console.log(shaker(2, 'strawberry', true))
//'2 strawberry cocktails' //'2 skinny strawberry milkshakes'
console.log(shaker(1, 'chocolate', false)) console.log(shaker(1, 'chocolate', false))
//'1 chocolate milkshake' //'1 chocolate milkshake'
``` ```