dmlc / xgboost

Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library, for Python, R, Java, Scala, C++ and more. Runs on single machine, Hadoop, Spark, Dask, Flink and DataFlow
https://xgboost.readthedocs.io/en/stable/
Apache License 2.0
26.12k stars 8.7k forks source link

Missing plot in Quantile Regression example? #9815

Open williamhobbs opened 9 months ago

williamhobbs commented 9 months ago

Should the quantile regression example in the docs here:

https://xgboost.readthedocs.io/en/latest/python/examples/quantile_regression.html

include a plot?

It looks like changing "--plot" to "plot" here might fix that.

https://github.com/dmlc/xgboost/blob/34a261669614e63c8095df1a01842e5920330b30/demo/guide-python/quantile_regression.py#L121C1-L129C24

Also, to get the code to run, I changed args = parser.parse_args() to args, unknown = parser.parse_known_args() based on this https://stackoverflow.com/a/55329134.

trivialfis commented 9 months ago

Use:

python quantile_regression.py --plot
trivialfis commented 9 months ago

Feel free to reopen if there are further issues.

williamhobbs commented 9 months ago

Thanks. I assumed that a plot should have shown up on the readthedocs page, but I now see that it is not typical for the example pages to include plots/outputs.

trivialfis commented 9 months ago

Unfortunately we are still sticking with plain text in the source code repo instead of jupyter. There might be a way for sphinx to generate the plot during document build.

williamhobbs commented 9 months ago

Gotcha. That makes sense.

There might be a way for sphinx to generate the plot during document build.

I think that is what is done with https://github.com/pvlib/pvlib-python.

For example, I think this page https://pvlib-python.readthedocs.io/en/stable/gallery/solar-position/plot_sunpath_diagrams.html is generated from https://github.com/pvlib/pvlib-python/blob/main/docs/examples/solar-position/plot_sunpath_diagrams.py. But I don't know much about documentation best practices, and I know almost nothing about sphinx.

trivialfis commented 9 months ago

Thank you for the references! Reopening as a reminder to include plots in documents.