Giter Site home page Giter Site logo

kobra-dev / kobra Goto Github PK

View Code? Open in Web Editor NEW
264.0 264.0 19.0 238.97 MB

Kobra is a visual programming language (like Scratch) for Machine Learning

Home Page: https://studio.kobra.dev

License: Other

JavaScript 0.89% TypeScript 99.09% Shell 0.02%
blockly education javascript kobra machine-learning nextjs react typescript visual-programming-language

kobra's People

Contributors

bobek avatar deepsource-autofix[bot] avatar deepsourcebot avatar dependabot[bot] avatar dragondevelops avatar merlin04 avatar pranavnt avatar renovate-bot avatar sampoder avatar veritem avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

kobra's Issues

Set Theme is not reversible

You cannot switch from Dark theme to light theme. We need to check the theme in componentDidMount before switching.

Data Visualization

We should make it possible to visualize quantitative data in one of the boxes. the user should be able to select the two variables they want to graph. lmk if either of you are interested in working on this @Merlin04 @abstractultra

Add default values for all blocks

"Blockly shouldn't have a
concept of syntax errors" - someone on the Blockly Google Group

We can use shadow blocks to add default values to everything to get as close as possible to being able to guarantee that your code will run and not throw an error no matter what. This also helps with documentation, it shows the user what input types a block accepts.

Exception lookup

We should make a page in the app where you can look up exceptions to see what caused them. The exceptions printed in the console can be links to the page.

Consider switching to pxt-blockly

https://github.com/microsoft/pxt-blockly

pxt-blockly is the fork of Blockly used in PXT/MakeCode. Switching to it would provide us with a lot of PXT's features like a more modern UI and some new blocks, but wouldn't require adopting the entirety of PXT. I am not sure how easy this would be as we use Blockly through a react wrapper but it is something to look into.

Reduce duplication in _block.ts files

I'm finding that there's a lot of duplicate code in the _block.ts files, to make the one for RFRegression I just duplicated the RFClassifier one and changed the names. Any ideas on how we could reduce the amount of duplication?

Block: LinearRegression(X, y)

Block Name: LinearRegression
Block Category: SciKit Learn
Block input: X, y (which the regression in fitted to)
Block Function: fits a linear regression to the dataset

Fix inconsistent indentation width

Some files use 2 spaces to indent but others use 4. We should decide on one to use throughout the project and reformat all of the files.

model.predict(X,y)

Block Name: predict
Block Category: sklearn
Block input: method of model object (what is returned by the LinearRegression function)
Block Function: generates a prediction for a new input based on a previously trained model

Remove the Material UI Icons

Since the beginning of the project, we have been using material UI for all of the components related to the editor,

Material UI is a great library that provides great components and has served us for a really long time and has helped us to be more consistent with our design system, For the sake of the performance of the app, material UI isn't that great.

We need to keep the app as low level as possible to improve the performance and load speed. I think we can try using native CSS instead of a huge library like Material UI which weighs.

If we can remove material UI from the app we shall save more than 3MB of the bundle size, I know this is not what we are focused on right now but we should in the next months.

A good alternative that we can use is tailwindcss since its just low-level CSS abstracted into utility classes.

To make our design system we can use storybooks and this should keep us more consistent.

Disable Dark Mode

Given the dark mode bug that we are running into, we should disable dark mode and only have light mode, and debug this later

Block: pd.read_csv(dataset)

Block Name: pd.read_csv
Block Category: Pandas
Block input: dropdown of datasets we support
Block Function: reads in a csv, and converts it to a dataframe object

logr_create: Data must be a 2D array with at least one element

This code (generated by Blockly):

function listsRepeat(value, n) {
  var array = [];
  for (var i = 0; i < n; i++) {
    array[i] = value;
  }
  return array;
}


highlightBlock('d2tbR+HWxg}g`YwU$}Za');
logr_create((listsRepeat(0, 100)), (listsRepeat(1, 100)));

Produces this error in the console:

EXCEPTION
Block type: logr_create
TypeError: Data must be a 2D array with at least one element

Machine Learning blocks documentation

Add documentation:

  • explaining what each ML algorithm/model is
  • how to use the blocks in general
  • any special parameters a model might have (like k value for KNN)

Modify libraries (DataFrame specifically) to not modify variables

Currently the way that some functions in libraries (like DataFrame.loc) work is that they modify this. When this happens the Blockly variable won't get updated unless we specifically tell it to. In addition, it isn't very clear to the user that the block is modifying the variable.

We need to modify these functions to return a new object (a copy of this) with the transformation/other thing applied to it.

When input dimensions to ML blocks are incorrect throw a useful error

This generated code:

function listsRepeat(value, n) {
  var array = [];
  for (var i = 0; i < n; i++) {
    array[i] = value;
  }
  return array;
}


highlightBlock('DOGb_9%xj{j3ea^7Ssbl');
knn_fit((knn_create((listsRepeat(0, 100)), (listsRepeat(1, 100)))), 0.2);

Produces this error:

EXCEPTION
Block type: knn_fit
TypeError: dataset[i].slice is not a function

Start documentation

  • Choose documentation system (gitbook, GitHub Wiki, markdown files in repo, pages in app, etc)
  • Decide on scope of documentation - will we have examples? Will it explain what each block does?
  • Decide on integration - should the docs be integrated with the app or a completely separate site? If so, how?

Writting Tests

To prevent the stuff from being broken unknowingly for sure this project needs tests. like when someone opens a PR we need tests to run checking if there isn't anything broken or if we do any modification we need to be sure we didn't break anything

Talking about tests we can do unit tests and integration tests.

Loading datasets

Allowing the user to use datasets we collected and potentially their own. @Merlin04 we'll work together on this

Set colors for blocks

Currently there aren't any colors specified for the custom blocks, this should be added to differentiate blocks from different categories and to help them look like the other blocks.

Dark mode

Add option for dark mode. Blockly has a dark theme which can be toggled on and off, we just need to add the button in the UI and add css to set the rest of the UI.

Setup tests

Help us write tests for Kobra. Here is a checklist for all tests we want to integrate into Kobra. If you aren't sure how to write good tests with cypress check this out.

  • Login with email and password
  • Can log in with google
  • Can log in with GitHub
  • Logout works
  • Can create a project
  • Can delete a project
  • Can share a project
  • Can fork a project
  • Can create and Run a model with each ML algorithm supported

Be able to run a fork of another user's project without uploading a new dataset

Is your feature request related to a problem? Please describe.
When you fork a project by another user you can't run the project because the dataset doesn't belong to you!

Describe the solution you'd like
Update database model so users can get access to datasets they haven't uploaded by made public by their owners

Block: dataframe.loc(columnA,columnB,columnC,etc.)

Block Name: loc
Block Category: Pandas
Block input: method of the dataframe object, and takes in as many inputs as the user desires for column names in the dataset
Block Function: selects desired columns from dataframe

Change some shadow blocks to regular blocks

The plus minus mutators don't work with shadow blocks, and their behavior can be confusing for anything more complicated than a simple string or number. We should change shadow blocks that aren't working correctly to regular blocks so they can be mutated and removed if necessary. This would involve adding additional checks for undefined values as it is now possible to pass in an empty value, or alternatively we could replace the shadow blocks with simpler ones but still keep the current shadow blocks as regular blocks connected to the other block.

Default blocks documentation

Documentation for all the Blockly default blocks. Blockly might already have docs somewhere so we might be able to use that.

Console

Add console widget which has run button and output of program, as well as input field. This should also display errors.

Remove dependencies dependency

We have a dependency in our package.json called dependencies, I think this was added by accident. I looked at it and it doesn't appear to be anything harmful but it's not anything we are using either (only one version was ever released and only 7 npm packages depend on it). We should remove it.

Improve CSV parsing in DataFrame

let data: any[] = dataStr.split("\n");

Right now, we use String.split to parse CSVs, which isn't the best way to do it because it doesn't handle escaped values, newlines, or other variations on the CSV format (like TSV). We should use something like Papa Parse (what I use in better-react-spreadsheet) to do parsing for us.

Switch CSS to useStyles

Right now we use regular CSS files to style the components. Material-UI provides a styling system called useStyles that is a lot more flexible and better integrated with JS.

Fix CI

Right now the CI is broken (probably because it has the wrong environment variables).

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: .github/renovate.json
Error type: The renovate configuration file contains some invalid settings
Message: Invalid packageRules[0].schedule: 'Invalid schedule: Failed to parse "Mondaychedule:earlyMonday"'

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.