Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine Portfolio Notebook. #160

Merged
merged 9 commits into from
Jul 8, 2021
Merged

Refine Portfolio Notebook. #160

merged 9 commits into from
Jul 8, 2021

Conversation

jonpsy
Copy link
Member

@jonpsy jonpsy commented Jun 25, 2021

No description provided.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jonpsy
Copy link
Member Author

jonpsy commented Jun 26, 2021

moead-evolution

@zoq @coatless Evolution process. Queried every 2 generations till generation 30. It looks like the algorithm peaks within 30 generations only! Looks so cool, doesn't it? 😎

@zoq
Copy link
Member

zoq commented Jun 27, 2021

Agreed this looks really nice, btw. we could create a gif inside the notebook as well, I did something similar in https://github.com/mlpack/examples/blob/master/pima_indians_diabetes_clustering_with_kmeans/pima-indians-diabetes-kmeans-cpp.ipynb

Also, should we keep the NSGA notebook as well, just to show NSGA2?

@jonpsy
Copy link
Member Author

jonpsy commented Jun 27, 2021

Brilliant idea! Sure I can. To take this one step further, it'd be nice if we could put them side by side. NSGA-II and MOEAD, how's that sound?

@jonpsy
Copy link
Member Author

jonpsy commented Jun 27, 2021

I guess we can modify Scatter a bit*

@zoq
Copy link
Member

zoq commented Jun 27, 2021

Brilliant idea! Sure I can. To take this one step further, it'd be nice if we could put them side by side. NSGA-II and MOEAD, how's that sound?

Great idea, even better.

@zoq
Copy link
Member

zoq commented Jun 27, 2021

I guess we can modify Scatter a bit*

I think it should work right away if you have the correct format, but feel free to modify it.

@jonpsy
Copy link
Member Author

jonpsy commented Jun 27, 2021

We still haven't established the cause for the poor performance of the notebook. Especially since MOEAD, even with 300 population and 500 generations knocks off within 0.8 seconds in an Intel i5-8250U @ 1.7 GHz CPU. How's the progress with OpenBLAS (if I remember correctly) to the repository, @zoq ? I think it still wouldn't be much of a boost.

My guess is that it's spending a lot of time before actually calling Optimize. What do you think?

@jonpsy
Copy link
Member Author

jonpsy commented Jun 30, 2021

Fixed lag. The entire notebook runs within 1 minute with beautiful plots. @zoq please review.

Copy link
Member

@zoq zoq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a really minor style comment, the rest looks great to me.

@jonpsy
Copy link
Member Author

jonpsy commented Jun 30, 2021

I was thinking of creating gif util and use it here actually. So that, on two subplots you can see them evolving side by side.

@jonpsy
Copy link
Member Author

jonpsy commented Jul 6, 2021

@zoq I think this is ready.

portfolio_optimization/portfolio-optimization-cpp.ipynb Outdated Show resolved Hide resolved
"cell_type": "markdown",
"metadata": {},
"source": [
"In this section, we will create a helper class which will generate the CSV file for us based on the parameters provided in previous section. This class would also define the objective functions in question, namely: Return and Volatility. Ideally, we would want to maximize the returns and reduce the volatility. Since our implementation of algorithm works on minimization of all objectives, we have appended negative sign to the returns objective which converts it into a minimization problem."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only generate the csv file if the cell above was run, I think it would be useful to be clear about that.

Copy link
Member

@zoq zoq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more comments from my side, thanks!

@jonpsy jonpsy changed the title Remove NSGA-II use MOEAD in Portfolio Refine Portfolio Notebook. Jul 8, 2021
Copy link

@mlpack-bot mlpack-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second approval provided automatically after 24 hours. 👍

@zoq zoq merged commit fdc843b into mlpack:master Jul 8, 2021
@zoq
Copy link
Member

zoq commented Jul 8, 2021

Thanks!

@jonpsy jonpsy deleted the moead branch July 9, 2021 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants