load_wireless_data

load_wireless_data#

QuadratiK.datasets.load_wireless_data(desc: bool = False, return_X_y: bool = False, as_dataframe: bool = True, scaled: bool = False) tuple[str, DataFrame, DataFrame] | tuple[str, DataFrame] | tuple[str, ndarray] | tuple[DataFrame, DataFrame] | tuple[ndarray, ndarray] | DataFrame | ndarray#

The wireless data frame has 2000 rows and 8 columns. The first 7 variables report the measurements of the Wi-Fi signal strength received from 7 Wi-Fi routers in an office location in Pittsburgh (USA). The last column indicates the class labels.

The function load_wireless_data loads a wireless localization dataset.

Read more in the User Guide.

Parameters#

descboolean, optional

If set to True, the function will return the description along with the data. If set to False, the description will not be included. Defaults to False.

return_X_yboolean, optional

Determines whether the function should return the data as separate arrays (X and y). Defaults to False.

as_dataframeboolean, optional

Determines whether the function should return the data as a pandas DataFrame (True) or as a numpy array (False). Defaults to True.

scaledboolean, optional

Determines whether or not the data should be scaled. If set to True, the data will be divided by its Euclidean norm along each row. Defaults to False.

Returns#

  • If desc=True, return_X_y=True, as_dataframe=True:

    Returns a tuple containing: (str, pd.DataFrame, pd.DataFrame)

    • fdescrstr

      The description of the dataset.

    • Xpd.DataFrame

      A DataFrame with the features.

    • ypd.DataFrame

      A DataFrame with the class labels.

  • If desc=True, return_X_y=True, as_dataframe=False:

    Returns a tuple containing: (str, np.ndarray, np.ndarray)

    • fdescrstr

      The description of the dataset.

    • Xnp.ndarray

      A numpy array with the features .

    • ynp.ndarray

      A numpy array with the class labels .

  • If desc=True, return_X_y=False, as_dataframe=True:

    Returns a tuple containing: (str, pd.DataFrame)

    • fdescrstr

      The description of the dataset.

    • data_dfpd.DataFrame

      A DataFrame containing the entire dataset.

  • If desc=True, return_X_y=False, as_dataframe=False:

    Returns a tuple containing: (str, np.ndarray)

    • fdescrstr

      The description of the dataset.

    • datanp.ndarray

      A numpy array containing the entire dataset.

  • If desc=False, return_X_y=True, as_dataframe=True:

    Returns a tuple containing: (pd.DataFrame, pd.DataFrame)

    • Xpd.DataFrame

      A DataFrame with the features.

    • ypd.DataFrame

      A DataFrame with the class labels.

  • If desc=False, return_X_y=True, as_dataframe=False:

    Returns a tuple containing: (np.ndarray, np.ndarray)

    • Xnp.ndarray

      A numpy array with the features.

    • ynp.ndarray

      A numpy array with the class labels.

  • If desc=False, return_X_y=False, as_dataframe=True:

    Returns: pd.DataFrame

    • data_dfpd.DataFrame

      A DataFrame containing the entire dataset.

  • If desc=False, return_X_y=False, as_dataframe=False:

    Returns: np.ndarray

    • datanp.ndarray

      A numpy array containing the entire dataset.

References#

Rohra, J.G., Perumal, B., Narayanan, S.J., Thakur, P., Bhatt, R.B. (2017). User Localization in an Indoor Environment Using Fuzzy Hybrid of Particle Swarm Optimization & Gravitational Search Algorithm with Neural Networks. In: Deep, K., et al. Proceedings of Sixth International Conference on Soft Computing for Problem Solving. Advances in Intelligent Systems and Computing, vol 546. Springer, Singapore. https://doi.org/10.1007/978-981-10-3322-3_27.

Source#

Bhatt, R. (2017). Wireless Indoor Localization. UCI Machine Learning Repository. https://doi.org/10.24432/C51880.

Examples#

from QuadratiK.datasets import load_wireless_data
X, y = load_wireless_data(return_X_y=True)
print(X.head())
    WS1   WS2   WS3   WS4   WS5   WS6   WS7
0 -64.0 -56.0 -61.0 -66.0 -71.0 -82.0 -81.0
1 -68.0 -57.0 -61.0 -65.0 -71.0 -85.0 -85.0
2 -63.0 -60.0 -60.0 -67.0 -76.0 -85.0 -84.0
3 -61.0 -60.0 -68.0 -62.0 -77.0 -90.0 -80.0
4 -63.0 -65.0 -60.0 -63.0 -77.0 -81.0 -87.0