From a3ffd69a0412dbe1da7a2f788dcf060ce7c83391 Mon Sep 17 00:00:00 2001 From: Caroline DE POURTALES <cdepourt@montana.irit.fr> Date: Mon, 27 Jun 2022 11:15:50 +0200 Subject: [PATCH] assets --- assets/course_data_format.html | 6 +++--- assets/course_decision_tree.html | 8 +++++--- assets/course_random_forest.html | 16 ++++++++++++++++ assets/typography.css | 4 ++++ callbacks.py | 24 ++++++++++++++++++++---- 5 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 assets/course_random_forest.html diff --git a/assets/course_data_format.html b/assets/course_data_format.html index 59a3085..a717f14 100644 --- a/assets/course_data_format.html +++ b/assets/course_data_format.html @@ -11,7 +11,7 @@ <h2> An option to add information on model </h2> <h3> Why ? </h3> -<p> There is a switch button, you can use it when you want to attach the csv you trained your model on or a feature mapping. This is useful when the values are categorical. +<p> There is a switch button, you can use it when you want to attach the data (csv) you trained your model on or a feature mapping (txt). This is useful when the values are categorical. </p> <h3> How ? </h3> @@ -22,11 +22,11 @@ If you decide to upload the feature mapping, it is a .txt file. <h2> What kind of model can I upload ? </h2> -<p> You can only import .pkl models.</p> +<p> You can only import .pkl models. But it works with joblib and pickle libraries. </p> <h2> What should the format of the instance be ? </h2> -<p> You can either upload a .txt file containing hte instance with the format : feature1=value1,feature2=value2,... where feature1, feature2 are the names of the columns. +<p> You can either upload a .txt file containing the instance with the format : feature1=value1,feature2=value2,... where feature1, feature2 are the names of the columns. But you can also upload a json of your instance.</p> diff --git a/assets/course_decision_tree.html b/assets/course_decision_tree.html index b07a373..f20dff9 100644 --- a/assets/course_decision_tree.html +++ b/assets/course_decision_tree.html @@ -2,13 +2,15 @@ <html lang="en"> <head> <meta charset="UTF-8"> - <title>What kinf of model, data, or instance can I upload ?</title> + <title>Decision Tree</title> </head> <body> -<h1> What library am I able to use on the platform ?</h1> - +<h2> What library am I able to use on the platform ?</h2> <p> Only models from scikit-learn are allowed.</p> +<h2> Do I have to upload data ?</h2> +You have to upload data or feature mapping when you have categorical data. + </body> </html> \ No newline at end of file diff --git a/assets/course_random_forest.html b/assets/course_random_forest.html new file mode 100644 index 0000000..d71522e --- /dev/null +++ b/assets/course_random_forest.html @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>Random Forest</title> +</head> +<body> + +<h2> What library am I able to use on the platform ?</h2> +<p> You can upload RandomForestClassifier from sklearn library or RF2001 models (from Aniti's team).</p> + +<h2> Do I have to upload data ?</h2> +You need to upload the dataset your machine learning model trained on. + +</body> +</html> \ No newline at end of file diff --git a/assets/typography.css b/assets/typography.css index d7e5154..6fdf27a 100644 --- a/assets/typography.css +++ b/assets/typography.css @@ -2,6 +2,10 @@ body { font-family: sans-serif; } +H1 { + font-family:Georgia, 'Times New Roman', Times, serif; +} + H4 { font-size: 20px; text-decoration-line:underline; diff --git a/callbacks.py b/callbacks.py index 906b09c..8213b61 100644 --- a/callbacks.py +++ b/callbacks.py @@ -29,12 +29,28 @@ def register_callbacks(app): page_list = ['home', 'course', 'application'] # For home directory - page_home = dbc.Row([]) + welcome_message = html.Div(html.Iframe( + src=app.get_asset_url("welcome.html"), + style={"height": "1067px", "width": "100%"}, + )) + page_home = dbc.Row([welcome_message]) # For course directory + course_data_format = html.Div(html.Iframe( + src=app.get_asset_url("course_data_format.html"), + style={"height": "1067px", "width": "100%"}, + )) + course_decision_tree = html.Iframe( + src="assets/course_decision_tree.html", + style={"height": "1067px", "width": "100%"}, + ) + course_random_forest = html.Iframe( + src="assets/course_random_forest.html", + style={"height": "1067px", "width": "100%"}, + ) main_course = dcc.Tabs(children=[ - dcc.Tab(label='Data format', children=[]), - dcc.Tab(label='Course Decision Tree', children=[]), - dcc.Tab(label='Course Random Forest', children=[])]) + dcc.Tab(label='Data format', children=[course_data_format]), + dcc.Tab(label='Course Decision Tree', children=[course_decision_tree]), + dcc.Tab(label='Course Random Forest', children=[course_random_forest])]) page_course = dbc.Row([main_course]) # For the application -- GitLab