In Matplotlib, the ____ method is used to set the labels of the x-axis.

  • set_x_axis
  • set_x_label
  • set_xlabel
  • x_labels
In Matplotlib, you use the set_xlabel method to set the label for the x-axis. This method allows you to specify the label that appears below the x-axis in your plot.

In Matplotlib, the ____ method is used to create a new figure object.

  • create_figure
  • figure
  • new_figure
  • plot
In Matplotlib, the figure method is used to create a new figure object. A figure object is like a canvas where you can add multiple subplots or axes to create complex plots with multiple elements. It is an essential step when working with Matplotlib.

In Matplotlib, the ____ function is used to add text annotations in arbitrary locations of the plot.

  • annotate
  • caption
  • label
  • text
In Matplotlib, the annotate function is used to add text annotations in arbitrary locations of the plot. These annotations can be used to provide additional information about data points, labels, or other details on the plot.

In Matplotlib, how do you add a title to a plot?

  • plt.add_title()
  • plt.plot_title()
  • plt.set_title()
  • plt.title()
In Matplotlib, you add a title to a plot using the plt.title() function. This function takes a string as an argument and sets it as the title of the plot. Titles are essential to provide context and information about the content of the plot.

In machine learning, ____ is a technique used to choose the hyperparameters for a given model.

  • Cross-Validation
  • Feature Engineering
  • Gradient Descent
  • Hyperparameter Tuning
Hyperparameter tuning is the process of selecting the optimal hyperparameters for a machine learning model to achieve the best performance. It is a crucial step in model development.

In Flask, what is the purpose of the route() decorator?

  • It authenticates user access to certain routes
  • It defines the routing logic for the application
  • It defines the schema for the database
  • It specifies the URL for the static files
In Flask, the @app.route() decorator is used to define the routing logic for the application. It associates a URL with a Python function, allowing you to determine what should happen when a user accesses a particular URL.

In Flask, to register a function to run before each request, you would use the ____ decorator.

  • @before_render
  • @before_request
  • @pre_request
  • @request_handler
In Flask, the @before_request decorator is used to register a function that runs before each request to the application. This is often used for tasks like setting up database connections or authentication checks.

In Flask, the ____ object is used to store data that is accessible from all parts of an application.

  • app
  • request
  • route
  • session
In Flask, the session object is used to store data that is accessible across different parts of an application. It allows you to store user-specific data, such as login information or shopping cart contents, across multiple requests.

The ____ statement is used to bring in an entire module into the current namespace.

  • from module import *
  • import all
  • import module
  • module import
In Python, you can use the from module import * statement to bring in all definitions from a module into the current namespace. However, it is generally recommended to use import module or from module import name to import specific functions or classes from a module.

The ____ statement in Python is used to verify if a given logical expression is true and raise an error if it’s false.

  • assert
  • check
  • confirm
  • validate
In Python, the assert statement is used for debugging and testing. It checks whether a given logical expression is true and raises an AssertionError if it's false, helping to catch bugs early.

The ____ sort algorithm repeatedly divides the list into two halves until each sub-list contains a single element.

  • Bubble
  • Insertion
  • Merge
  • Quick
The Merge Sort algorithm repeatedly divides the list into two halves until each sub-list contains a single element and then merges them back together in a sorted manner. It is known for its stable and efficient sorting.

The ____ module in Python provides a way to measure the approximate CPU time used by a process.

  • cpu
  • os
  • sys
  • time
The time module in Python provides functions for working with time, including measuring the approximate CPU time used by a process using functions like time.process_time().