Git Product home page Git Product logo

bias-by-us's Introduction

Bias by Us

Netlify Status Production Build License: MIT Contributor Covenant

Overview

Bias by Us is one of ACM Teach LA's learning labs, a set of interactive online web modules designed to make learning easier. This specific learning lab is focused on bias in machine learning: we teach students about different ways that machine learning models can become biased/discriminatory through 3 individual case studies, including feedback loops in personalized advertising.

This project was written with React.js. We also make use of react-router, anime.js, (insert more libraries...). It was bootstrapped with Create React App. It is deployed with Netlify.

(This project is currently in the works. More updates will be coming soon!)

Development Setup

We'll use a really common Node.js project workflow!

First, let's clone our repository, and install all of our node dependencies:

git clone https://github.com/uclaacm/bias-by-us.git
cd bias-by-us
npm install
npm install react-scripts

To start our app, you just need to run npm start within the website folder!

cd website
npm start

And to build our project for production (with CRA's webpack bundling and all that goodness),

cd website
npm run build

Contribution Workflow

Want to make a change? Great! Here are the steps:

  1. Make sure your main branch is updated with other peoples' changes.
    git checkout main
    git pull
    
  2. Make a new branch of this repository. main is a protected branch, so you cannot push to it. a. For branch naming, follow this convention: <issue-number>_<change-you-made> (e.g. 43_animate_checkmark).
    git checkout -b <your-branch-name>
    
  3. Implement your code changes for your feature: Beep boop away! Before pushing, make sure that your app builds with 'npm run build', without any errors.
  4. Update your local branch with changes from main branch.
    git merge main
    
  5. Once you're ready, stage and commit your changes.
    git commit -am <your-message>
    
  6. Move your local branch changes to remote repository.
    git push --set-upstream origin <your-branch-name>
    
  7. Make a pull request with your changes, and let someone on your project team know. a. Netlify has a neat feature called "Deploy Previews" that give you a link to preview your changes; see the blog post for more info!
  8. If your code passes code review, then we can squash and merge it into main. Congratulations! If you'd like, it's now safe to delete your branch.

Licensing & Attribution

This project and its code are licensed under the MIT License. You're free to use them however you wish, though we'd love to hear from you if you found this useful!

bias-by-us's People

Contributors

anikamalayappan avatar charlenehuang1 avatar doubleiis02 avatar matthewcn56 avatar mattxwang avatar megang33 avatar nareha avatar nkerr23 avatar rahulkhanna14 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bias-by-us's Issues

Implementing Multiple Pages Through React Router

Right now, the React Router only accepts one page. We should separate the Navbar at the top and wrap everything else inside a Router to support multiple pages, along with adjusting the CSS appropriately for different sections as necessary!

Fix slideshow arrow colors in Facebook Conclusion - Bug

In the conclusion frame of the Facebook Ads case study, the blue arrows to navigate between the cards work as intended, but we'd like for the arrows to turn gray if they shouldn't be clicked. Specifically, the left arrow should be gray on the 1st card (can't go left of the first) and the right arrow should be gray on the 3rd card (can't go right on the last).

(In the below image, right arrow should be gray since we shouldn't be able to click it)

image

The relevant code is in website/src/components/posts/Facebook/conclusion/ConclusionGraphic.js. There seems to already be some pre-existing code that tries to achieve this, but it currently does not work.

implement barebones for shape sorting speedrun activity

in a fixed (short) amount of time, user is told to group the image that pops up, either as a "triangle" or "rectangle" (or some other types of shapes). At first, the two groups are heavily associated with a certain color (many triangles are green and many rectangles are red, for example). Later, we introduce new colors that could confuse the user: a green rectangle, a red triangle, a blue rectangle etc. Once the time limit ends, the user is given statistics on how they did

Implement a "Scrolling-Bar/Numeric Bar" that changes position based on numeric value

In the College App case study, our interactive essay activity has users change certain words in a given essay to output a "score", denoting how male or female leaning the overall essay is. Since this "score" is ambiguous, we'd like to change it to be a scrolling/sliding bar, that changes position based on the numerical score.

The current version looks like:
sample1

We'd like the final version to be something like:

sample2

where the circle in the middle slides left and right based on the numeric score.


You could implement this using react useEffects/hooks, or alternatively, there's likely some React library that could be used for this.

Organize css files

organize content inside css files so that classes are in relevant css files instead of being kind of all over the place...

ex: .progress-button and related classes are in mainContent.css, while `.progress-bar' is in AppMain.css

Add first draft of Graph (historical grad enrollment of women) for College App Case Study

Add a new frame/box in the College App case study section, and have it contain the graph shown here:

graph1

The source of this graph is
(http://cockrell.utexas.edu/media/xt-adaptive-images/1600/images/wep-stats/HistoricalGrad.jpg)

We'd like to not use an image of the graph, but rather the graph library that was used for the Facebook gender graph (refer to website/src/components/posts/Facebook/genderGraph). Go through the Facebook graph and understand how it's implemented, then implement this graph using the given data in an identical way.

It's OK if the first iteration of the graph doesn't look exactly like the origin, if some of the CSS/styling is off, etc. Think of this as a first draft.

Adjust `adReducer` to prevent race conditions

  • Change the increment case to pick 100 to 1000 ads, and sort at the end of the increment case.
  • rn, making sorting a separate action type leads to race conditions and there's no guarantee that our dispatches will finish running sequentially

"White" button in algorithm activity is hard to see

Clicking on the "white" button is hard to see, especially compared to clicking "black". Maybe we can make the phone app's background a more prominent yellow so that the white will contrast more? or we can make the "white" button have a grey background onclick instead of white.

Word Similarity Graph - Visual Aide

In the college admissions case study, the essay activity's corresponding graph currently looks like this:
image

Besides the overlapping labels, it's very unclear what the graph is trying to show. Go deeper into how the graph is implemented via the machine learning model data, and

  • Add an x-axis, y-axis label (He similarity vs She similarity)
  • Draw a faint dotted line on the graph following y=x, so its easy to see which points lean more "He" vs "She"
  • (Optional) Find a way to address the overlapping labels. One possibility is to do something similar to this where the labels float above. Or, to hide labels when they overlap and only display upon hovering. Or even, change the original words in the essay so that the various options don't all have the same he/she score. While this is mostly optional (for now, eventually we'd need a change here), at least try to propose a way to fix the issue.

College App Case study background styling + introduction text

  1. In the College App case study, change the first frame to the introduction frame shown in this picture, with the corresponding text:

bg1

This is present in the Figma (on slack channel), and you should be able to directly copy/paste from there. Make sure to get the styling, etc. right including bold/underlined text.

  1. Change the background color of this case-study page to the yellow shown in the image above. The exact hue should be on the Figma.

Prevent Changes to `genderInput` and `raceInput` within ProfileCreator when the Generate Profile button has been pressed

Right now, the user can change the displayed gender/race on the screen within ProfileCreator without actually changing the dataset used to calculate ads displayed. To prevent this from happening, we should gray out the gender and race buttons when the generate profile has been pressed, disabling changes, and only enable changes again once "Reset Profile" has been pressed. (So change depending on the value of profileCreated.)

Improve Performance By Memoizing `windowDimensions` logic

In its current state, our logic for determining whether or not the progress bar on the left should display is causing the entire CaseStudyFacebook component to re-render multiple times even when we don't have to change the display state of the bar due to state changes within our custom hook for window dimensions.

memoizationProfiler

By memoizing whether or not we should change the progress bar by turning it into separate state variable, we can prevent unnecessary re-renders and improve webpage performance.

memoizationGoal

implement button mechanic for essay activity

A word in the “essay” should be highlighted. Clicking on either of the three buttons will change the essay so that the highlighted portion now contains the word inside the button.

Begin development of matching game for College Apps case study

We'd like to implement a new game for our College Apps case study section, where users are presented one-by-one with images of shapes, and need to group them as either a "triangle" or "rectangle". At first, the two groups are heavily associated with a certain color (many triangles are green and many rectangles are red, for example). Later, we introduce new colors that could confuse the user: a green rectangle, a red triangle, a blue rectangle etc. Once the time limit ends, the user is given statistics on how they did.

For now - add a new frame to the college app case study section and title it as shown.

game1

Now, add two buttons named Group 1, Group 2 on bottom left/bottom right as shown here:

game2

The above is the eventual vision of this. For now, just display some text in the middle instead of an image. Have it so that if the user clicks Group 1, the score increments by 10, otherwise if they click Group 2, it decrements by 5. The text doesn't need to change or anything yet.

Expanding Upon Landing Page Navigation

Within the Landing Page, separate brief explanations of each case study into individual posts, and provide a <Link> from within each post (maybe within the title?) to let the user navigate to separate case studies from brief summaries on the Landing Page in addition to the current Navbar in place.

Touching Up The Navbar

We can make the Navbar prettier by flipping the direction of the arrow depending on whether or not the Navbar is open and signifying to the user somehow (other than a color change, maybe a small dot or something?) which page they are currently on.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.