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

Mobility model alpha parameter regression from data #15

Merged
merged 9 commits into from
Oct 11, 2024

Conversation

tanzim10
Copy link
Contributor

@tanzim10 tanzim10 commented Oct 1, 2024

Summary

This pull request updates are aimed at refining the parameter regression functionality and enhancing the RADP library's mobility model handling as per previous PR changes. Key changes include the transformation of the parameter regression class into callable API service functions, updates to the mobility helper functions within the RADP library, and the introduction of a notebook that demonstrates these new features.

Changes Made

  • Mobility Model Parameter Regression:

    • Given UE track data, this PR provides an API to regress parameter alpha
  • RADP Library Enhancements:

    • Helper methods to simulate and plot UE tracks
  • Mobility Notebook:

    • Created a new Jupyter notebook dedicated to demonstrating the usage and effectiveness of the updated mobility functions.
    • Integrated examples showing how to use the new mobility model parameter regression, for the parameter alpha.

Unit Test

  • Added new unit tests for the param_regression.py

Copy link
Collaborator

@paulvarkey paulvarkey left a comment

Choose a reason for hiding this comment

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

Approving with comments.

return ue_tracks_generation


def plot_ue_tracks(df) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def plot_ue_tracks(df) -> None:
def plot_ue_tracks(df: pd.DataFrame) -> None:

start_idx = end_idx


def plot_ue_tracks_side_by_side(df1, df2):
Copy link
Collaborator

Choose a reason for hiding this comment

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

type hints

plt.show()


def plot_ue_tracks_on_axis(df, ax, title):
Copy link
Collaborator

Choose a reason for hiding this comment

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

type hints

return group


def preprocess_ue_data(df):
Copy link
Collaborator

Choose a reason for hiding this comment

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

type hints

return df


def get_predicted_alpha(data, alpha0):
Copy link
Collaborator

Choose a reason for hiding this comment

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

type hints

return np.array([v_t_next, theta_t_next])


def residual_vector(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def residual_vector(
def _residual_vector(

return t_array, t_next_array, velocity_mean, variance, rng


def next(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def next(
def _next(

)


class TestParameterFunctions(unittest.TestCase):
Copy link
Collaborator

Choose a reason for hiding this comment

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

test for actual values, since rng (and seed) is under user control

@@ -0,0 +1,340 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. generate alpha0 closer to cell where it is first used
  2. update params with re-computed alpha1

@@ -5,3 +5,4 @@ pyarrow==13.0.0
scikit-learn==1.2.1
torch==2.0.0
torchvision==0.15.1
scipy
Copy link
Collaborator

Choose a reason for hiding this comment

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

see if you can find the actual installed version and freeze that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used scipy==1.10.1

@tanzim10
Copy link
Contributor Author

tanzim10 commented Oct 4, 2024

Updated the codes according to the PR review comments.

@tanzim10
Copy link
Contributor Author

tanzim10 commented Oct 4, 2024

In the last commit, we added the seed value as a user input to maintain the reproducibility of the predicted alpha.

return df


def get_predicted_alpha(data: pd.DataFrame, alpha0: float,seed: int) -> float:
Copy link
Collaborator

Choose a reason for hiding this comment

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

"""This is the main API entry point for alpha prediction, given UE tracks.

@param data : provide columns
"""

@paulvarkey paulvarkey changed the title Refactor Param Regression to API Service and Update RADP Library Functions Mobility model alpha parameter regression from data Oct 11, 2024
@paulvarkey paulvarkey merged commit 188a31b into lf-connectivity:main Oct 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants