Add some information about the album below, the author, or any other background context. Make it a few sentences long so folks can pick up some informative tidbits. Then, link them off to some social networking sites or contact information.
Aliro Ed is a software for users who are not familiar with machine learning. Users can experience machine learning tasks on Raspberry Pi 4 with Aliro Ed.
+ Users can download the raspberry pi image from the Aliro Ed website.
+ Users can easily install and run Aliro Ed on Raspberry Pi 4 using this image.
+ Aliro Ed and the Raspberry Pi image provided in this website, are developed by the AI Research Center at the Computational Biomedicine Department Cedars-Sinai Medical Center, Los Angeles, CA, USA. Please click following button to download Aliro Ed.
Add some information about the album below, the author, or any other background context. Make it a few sentences long so folks can pick up some informative tidbits. Then, link them off to some social networking sites or contact information.
Welcome to the Aliro Ed. Aliro Ed is for users who are not familiar with machine learning. Users can experience machine learning tasks on Raspberry Pi 4 with Aliro Ed. If internet is available, Users can download the raspberry pi image from the Aliro Ed website.
+ Users can easily install and run Aliro Ed on Raspberry Pi 4 using this image. Aliro Ed and the Raspberry Pi image provided in this website, are developed by the AI Research Center at the Computational Biomedicine Department Cedars-Sinai Medical Center, Los Angeles, CA, USA.
+
+ If you have any questions, please contact us at AISupport@csmc.edu.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Using various kinds of features together
+
In this data set, we have two different features petal-length on X axis and sepal-length on Y axis.
+
+
Using various kinds of features together allows for more nuance.
+
So visualizing petal-length and sepal-length in a scatterplot helps us distinguish three different species of iris flowers.
+
+
+ The dataset suggests that, among the three species, the Iris-setosa has the smallest petal-length and sepal-length,
+ the Iris-versicolor has the medium petal-length and sepal-length,
+ and the Iris-virginica has the largest petal-length and sepal-length.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Drawing boundaries
+
You can visualize your petal-length and sepal-length observations as the boundaries of regions in your scatterplot.
+ Dots plotted in the three regions would be in the three species of iris flowers, respectively.
+
Identifying boundaries in data using math is the essence of statistical learning.
+
The boundaries are called decision boundaries.
+
Visualizing decision boundaries in two dimensions and three dimensions could give us a better understanding of the given data set.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
This card explains some intuition using scatterplot.
Add some information about the album below, the author, or any other background context. Make it a few sentences long so folks can pick up some informative tidbits. Then, link them off to some social networking sites or contact information.
Consider the situation where you want to decide if a dot belongs in
+ Class_1 (Iris-setosa) or Class_2 (Iris-versicolor), or Class_3 (Iris-virginica).
+
+ Assigning a class to a data point is called classification task in machine learning terms.
+
+
+
+
+
In the left chart, the dots are the data points. The color of the dots represents the class of the data point.
+ In this example, our task is to classify the data points into one of the three classes.
+ Now, let's click the red button to project the data points on the Y axis.
+ In the current chart, dots are projected on the sepal-length axis, which is Y axis.
+ Can we find points on the Y axis that separate the dots into three classes?
+ What about the X axis? Can we find points on the X axis that separate the dots into three classes?
+ Each of the sepal-length and petal-length can be used to classify the data points into the three classes.
+
+
+
+ Can we do better classify the data points into the three classes using only both of the two features? Let's move to the next page.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Using various kinds of features together
+
In this data set, we have two different features petal-length on X axis and sepal-length on Y axis.
+
+
Using various kinds of features together allows for more nuance.
+
So visualizing petal-length and sepal-length in a scatterplot helps us distinguish three different species of iris flowers.
+
+
+ The dataset suggests that, among the three species, the Iris-setosa has the smallest petal-length and sepal-length,
+ the Iris-versicolor has the medium petal-length and sepal-length,
+ and the Iris-virginica has the largest petal-length and sepal-length.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Drawing boundaries
+
You can visualize your petal-length and sepal-length observations as the boundaries of regions in your scatterplot.
+ Dots plotted in the three regions would be in the three species of iris flowers, respectively.
+
Identifying boundaries in data using math is the essence of statistical learning.
+
The boundaries are called decision boundaries.
+
Visualizing decision boundaries in two dimensions and three dimensions could give us a better understanding of the given data set.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
This card explains some intuition using scatterplot.
Add some information about the album below, the author, or any other background context. Make it a few sentences long so folks can pick up some informative tidbits. Then, link them off to some social networking sites or contact information.
Let's transform our visualiztion into a histogram to see how frequently each species appears at each sepal-length. Please click the transformmation button.
+
Class_1 (Iris-setosa) has the lowest average of sepal-length, Class_2 (Iris-versicolor) has the second lowest average of sepal-length, and Class_3 (Iris-virginica) has the highest average of sepal-length.
+
Please click the Y axis. It will show an example to put boundaries
+
Please click the Y axis. It will show an example to put boundaries to distinguish classes of iris flowers. Then please click the Different boundaries button. It will show an example to put different boundaries to distinguish classes of iris flowers.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Adding nuance
+
Adding another dimension allows for more nuance. For example, New York apartments can be extremely expensive per square foot.
+
So visualizing elevation and price per square foot in a scatterplot helps us distinguish lower-elevation homes.
+
The data suggests that, among homes at or below 73 meters, those that cost more than $19,116.7 per square meter are in New York City.
+
Dimensions in a data set are called features, predictors, or variables. 1
You can visualize your elevation (>73 m) and price per square foot (>$19,116.7) observations as the boundaries of regions in your scatterplot. Homes plotted in the green and blue regions would be in San Francisco and New York, respectively.
+
Identifying boundaries in data using math is the essence of statistical learning.
+
Of course, you’ll need additional information to distinguish homes with lower elevations and lower per-square-foot prices.
Add some information about the album below, the author, or any other background context. Make it a few sentences long so folks can pick up some informative tidbits. Then, link them off to some social networking sites or contact information.
+ In this example, we are going to use the iris data set to build a decision tree.
+ The iris data set contains 100 samples of three different species of iris flowers.
+ There are four features in the dataset: sepal length, sepal width, petal length, and petal width.
+ And we are going to use decision tree to distinguish three different species of iris flowers with four features.
+
+
+
+ If petal-length is less than 2.45, 33% of data point is setosa.
+ 67% of data point has petal-length greater than 2.45.
+ Let's look at the second split.
+
+
+
+
+
+ 46% of data point has petal-width greather than 1.75.
+ 93% of data point in the thrid split has petal-length greater than 4.85.
+ The number of setosa is 0.
+ The number of versicolor is 0.
+ The number of virginica is 43.
+
+ 7% of data point has petal-length less than 4.85.
+ The number of setosa is 0.
+ The number of versicolor is 1.
+ The number of virginica is 2.
+
+ 11% of data point has petal-length greather than 4.95.
+ The number of setosa is 0.
+ The number of versicolor is 2.
+ The number of virginica is 4.
+
+ 89% of data point in the third split has petal-length less than 4.95.
+ The number of setosa is 0.
+ The number of versicolor is 47.
+ The number of virginica is 1.
+
+
You can visualize your elevation (>73 m) and price per square foot (>$19,116.7) observations as the boundaries of regions in your scatterplot. Homes plotted in the green and blue regions would be in San Francisco and New York, respectively.
+
Identifying boundaries in data using math is the essence of statistical learning.
+
Of course, you’ll need additional information to distinguish homes with lower elevations and lower per-square-foot prices.
Add some information about the album below, the author, or any other background context. Make it a few sentences long so folks can pick up some informative tidbits. Then, link them off to some social networking sites or contact information.
Something short and leading about the collection below—its contents, the creator, etc. Make it short and sweet, but not too short so folks don’t simply skip over it entirely.
Add some information about the album below, the author, or any other background context. Make it a few sentences long so folks can pick up some informative tidbits. Then, link them off to some social networking sites or contact information.
Add some information about the album below, the author, or any other background context. Make it a few sentences long so folks can pick up some informative tidbits. Then, link them off to some social networking sites or contact information.
Let’s say you had to determine whether a dot is in
+ Class_1 or in Class_2 or in Class_3. In machine learning terms, categorizing data points is a classification task.
+
Since San Francisco is relatively hilly, the elevation of a home may be a good way to distinguish the two cities.
+
Based on the home-elevation data to the right, you could argue that a home above 73 meters should be classified as one in San Francisco.
You can visualize your elevation (>73 m) and price per square foot (>$19,116.7) observations as the boundaries of regions in your scatterplot. Homes plotted in the green and blue regions would be in San Francisco and New York, respectively.
+
Identifying boundaries in data using math is the essence of statistical learning.
+
Of course, you’ll need additional information to distinguish homes with lower elevations and lower per-square-foot prices.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/intropage/workingFiles/scatterplot_d3v4v6.html b/intropage/workingFiles/scatterplot_d3v4v6.html
new file mode 100644
index 000000000..93db295b2
--- /dev/null
+++ b/intropage/workingFiles/scatterplot_d3v4v6.html
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lab/webapp/src/components/BarChart/index.jsx b/lab/webapp/src/components/BarChart/index.jsx
index 225a629aa..1121d09d6 100644
--- a/lab/webapp/src/components/BarChart/index.jsx
+++ b/lab/webapp/src/components/BarChart/index.jsx
@@ -117,10 +117,25 @@ look here - https://github.com/c3js/c3/issues/493#issuecomment-456686654
var chart = c3.generate({
bindto: `.${chartKey}`,
-
+ // data: {
+ // columns: [
+
+ // expList
+ // ],
+
+
+ // color: function(color, d){
+ // var lst = ['#ffebee', '#ffcdd2', '#ef9a9a', '#e57373', '#ef5350', '#f44336', '#1b5e20', '#388e3c', '#4caf50', '#81c784', '#a5d6a7', '#c8e6c9']
+ // return(lst[d.index]);
+ // },
+
+ // type: 'bar',
+
+ // },
data: {
-
+ // json: [{label: "<-10", val:0},{label: "<-8",val:0},{label: "<-6",val:3},{label: "<-4",val:1},{label: "<-2",val:15},{label: "<0",val:40},{label: "<2",val:82},{label: "<4",val:68},{label: "<6",val:7},{label: "<8",val:6},{label: "<10",val:3},{label: ">10",val:1}],
+
json: tempjson,
diff --git a/lab/webapp/src/components/Builder/components/ParameterOptions/index.jsx b/lab/webapp/src/components/Builder/components/ParameterOptions/index.jsx
index 700b951b3..932b76794 100644
--- a/lab/webapp/src/components/Builder/components/ParameterOptions/index.jsx
+++ b/lab/webapp/src/components/Builder/components/ParameterOptions/index.jsx
@@ -42,7 +42,7 @@ function ParameterOptions({
function openTrueOrFalse_param_popup()
{
- if (sessionStorage.getItem("param-popup") == "true"){
+ if (localStorage.getItem("param-popup") == "true"){
return false;
}
else{
@@ -132,9 +132,9 @@ function ParameterOptions({
document.getElementById("param-popup").style.cssText += ';display:none !important;';
- sessionStorage.setItem("param-popup", "true");
+ localStorage.setItem("param-popup", "true");
// show the local storage on the console
- console.log("param-popup", sessionStorage.getItem("param-popup"));
+ console.log("param-popup", localStorage.getItem("param-popup"));
// get class name content under id aiTooglePopup
diff --git a/lab/webapp/src/components/Builder/index.jsx b/lab/webapp/src/components/Builder/index.jsx
index 0df32e4b5..6dc871c30 100644
--- a/lab/webapp/src/components/Builder/index.jsx
+++ b/lab/webapp/src/components/Builder/index.jsx
@@ -153,7 +153,6 @@ class Builder extends Component {
// onClick={this.handleSubmitExperiment}
onClick={() => {
localStorage.setItem("algorithm-popup", "true");
-
// param-popup
localStorage.setItem("param-popup", "true");
diff --git a/lab/webapp/src/components/Datasets/components/DatasetCard/components/DatasetActions/index.jsx b/lab/webapp/src/components/Datasets/components/DatasetCard/components/DatasetActions/index.jsx
index d8e015187..c612be0f0 100644
--- a/lab/webapp/src/components/Datasets/components/DatasetCard/components/DatasetActions/index.jsx
+++ b/lab/webapp/src/components/Datasets/components/DatasetCard/components/DatasetActions/index.jsx
@@ -43,9 +43,9 @@ function DatasetActions({ dataset, recommender, toggleAI }) {
// buildNewExpPopup
- sessionStorage.setItem("addNewPopup", "true");
- sessionStorage.setItem('aiTooglePopup', 'true');
- sessionStorage.setItem('buildNewExpPopup', 'true');
+ localStorage.setItem("addNewPopup", "true");
+ localStorage.setItem('aiTooglePopup', 'true');
+ localStorage.setItem('buildNewExpPopup', 'true');
};
diff --git a/lab/webapp/src/components/Datasets/components/DatasetCard/index.jsx b/lab/webapp/src/components/Datasets/components/DatasetCard/index.jsx
index f4b4eb392..c861fc013 100644
--- a/lab/webapp/src/components/Datasets/components/DatasetCard/index.jsx
+++ b/lab/webapp/src/components/Datasets/components/DatasetCard/index.jsx
@@ -61,10 +61,10 @@ const DatasetCard = ({ dataset, recommender, toggleAI }) => {
function openTrueOrFalse_aiTooglePopup(){
- if (sessionStorage.getItem("aiTooglePopup") == "true" ){
+ if (localStorage.getItem("aiTooglePopup") == "true" ){
return false;
}
- // if sessionStorage does not have aiTooglePopup
+ // if localStorage does not have aiTooglePopup
// document.getElementById("addNewPopup").style.cssText include "display: none;"
@@ -78,10 +78,10 @@ const DatasetCard = ({ dataset, recommender, toggleAI }) => {
function openTrueOrFalse_buildNewExpPopup(){
- if (sessionStorage.getItem("buildNewExpPopup") == "true" ){
+ if (localStorage.getItem("buildNewExpPopup") == "true" ){
return false
}
- // if sessionStorage does not have buildNewExpPopup
+ // if localStorage does not have buildNewExpPopup
else {
return true;
}
@@ -145,9 +145,9 @@ const DatasetCard = ({ dataset, recommender, toggleAI }) => {
// document.getElementById("buildNewExpPopup").style.cssText += ';display:block !important;';
// save flag to local storage to avoid showing the popup again
- sessionStorage.setItem("aiTooglePopup", "true");
+ localStorage.setItem("aiTooglePopup", "true");
// show the local storage on the console
- console.log("aiTooglePopup", sessionStorage.getItem("aiTooglePopup"));
+ console.log("aiTooglePopup", localStorage.getItem("aiTooglePopup"));
@@ -194,9 +194,9 @@ const DatasetCard = ({ dataset, recommender, toggleAI }) => {
content="Build New Experiment"
onClick = { () =>
{
- sessionStorage.setItem("addNewPopup", "true");
- sessionStorage.setItem('aiTooglePopup', 'true');
- sessionStorage.setItem('buildNewExpPopup', 'true');
+ localStorage.setItem("addNewPopup", "true");
+ localStorage.setItem('aiTooglePopup', 'true');
+ localStorage.setItem('buildNewExpPopup', 'true');
}
}
@@ -241,16 +241,16 @@ const DatasetCard = ({ dataset, recommender, toggleAI }) => {
// save flag to local storage to avoid showing the popup again
- sessionStorage.setItem("buildNewExpPopup", "true");
+ localStorage.setItem("buildNewExpPopup", "true");
- // sessionStorage.setItem("aiTooglePopup", "true");
+ // localStorage.setItem("aiTooglePopup", "true");
- // sessionStorage.setItem("addNewPopup", "true");
+ // localStorage.setItem("addNewPopup", "true");
// show the local storage on the console
- console.log("buildNewExpPopup", sessionStorage.getItem("buildNewExpPopup"));
+ console.log("buildNewExpPopup", localStorage.getItem("buildNewExpPopup"));
diff --git a/lab/webapp/src/components/Datasets/index.jsx b/lab/webapp/src/components/Datasets/index.jsx
index 80f0b456d..0c5b6cdec 100644
--- a/lab/webapp/src/components/Datasets/index.jsx
+++ b/lab/webapp/src/components/Datasets/index.jsx
@@ -122,7 +122,7 @@ class Datasets extends Component {
return (
- {/* */}
+ {/**/}
diff --git a/lab/webapp/src/components/DonutChart/index.jsx b/lab/webapp/src/components/DonutChart/index.jsx
index 39abb8c92..8443b28da 100644
--- a/lab/webapp/src/components/DonutChart/index.jsx
+++ b/lab/webapp/src/components/DonutChart/index.jsx
@@ -34,8 +34,8 @@ import d3 from 'd3';
// working version
class DonutChart extends Component {
componentDidMount() {
- const { expList, chartKey, chartColor, min, max, dataname } = this.props;
- expList && dataname && this.renderChart(expList, chartKey, chartColor, min, max, dataname);
+ const { expList, chartKey, chartColor, min, max } = this.props;
+ expList && this.renderChart(expList, chartKey, chartColor, min, max);
}
/*
colors: {
@@ -48,7 +48,7 @@ use anonymous function to 'disable' interaction
look here - https://github.com/c3js/c3/issues/493#issuecomment-456686654
*/
- renderChart(expList, chartKey, chartColor, min, max, dataname) {
+ renderChart(expList, chartKey, chartColor, min, max) {
// window.console.log('exp list: ');
window.console.log('expList: ', expList);
// print d3 version
@@ -56,122 +56,17 @@ look here - https://github.com/c3js/c3/issues/493#issuecomment-456686654
// print c3 version
window.console.log('c3 version: ', c3.version);
- window.console.log('dataname', dataname);
-
// for each row in expList, get the key value pair
const data = expList.map((exp) =>
{
-
if (exp[0].includes('class') === false) {
- // window.console.log('exp[0]: ', exp[0]);
- // exp[0] = `class_${exp[0]}`;
-
-
-
-
-
- // get class_and_file from session storage
- const class_and_file = localStorage.getItem('class_and_file')
-
- // split class_and_file with *
- const class_and_file_split_star = class_and_file.split('*')
-
- // remove elements which has null
+ window.console.log('exp[0]: ', exp[0]);
+ exp[0] = `class_${exp[0]}`;
-
- // find element which has dataname
- const class_and_file_split_star_find = class_and_file_split_star.find((element) => element.includes(dataname))
-
-
- console.log("class_and_file_split_star_find", class_and_file_split_star_find)
-
-
-
-
- const class_and_file_split = class_and_file_split_star_find.split('&')
-
- window.console.log('class_and_file_split-donut: ', class_and_file_split);
- console.log('class_and_file_split[1]', class_and_file_split[1])
-
- if (class_and_file_split[1] === dataname) {
- // exp[0] = class_and_file_split[1];
- console.log("class_and_file_split[1] === dataname ");
-
- // calculate the length of class_and_file_split
- const class_and_file_split_length = class_and_file_split.length
- // get the last element of class_and_file_split
- const dataname_from_session_storage = class_and_file_split[class_and_file_split_length - 1]
- console.log('dataname_from_session_storage: ', dataname_from_session_storage)
-
- // console.log('dataname in ', dataname)
-
- const class_and_file_split_without_last_element = class_and_file_split.slice(0, class_and_file_split_length - 1)
- console.log('class_and_file_split_without_last_element',class_and_file_split_without_last_element)
-
- // slipt class_and_file_split_without_last_element with ,
- const class_and_file_split_without_last_element_split = class_and_file_split_without_last_element.join(',').split(',')
-
- // console.log('class_and_file_split_without_last_element_split',class_and_file_split_without_last_element_split)
-
- console.log('class_and_file_split_without_last_element_split',class_and_file_split_without_last_element_split)
-
- // make key value pair using class_and_file_split_without_last_element_split
-
-
- // class_and_file_split_without_last_element_split
- for (let i = 0; i < class_and_file_split_without_last_element_split.length; i++) {
-
-
- // exp[0] to string
- const exp0 = exp[0].toString()
- // console.log('exp0', exp0)
-
- // class_and_file_split_without_last_element_split[i]
- // console.log('class_and_file_split_without_last_element_split[i]', class_and_file_split_without_last_element_split[i])
-
-
-
- console.log('class_and_file_split_without_last_element_split[i] and exp0:', class_and_file_split_without_last_element_split[i], exp0)
-
- // spilit class_and_file_split_without_last_element_split[i] with :
- const class_and_file_split_without_last_element_split_split = class_and_file_split_without_last_element_split[i].split(':')
-
- console.log('class_and_file_split_without_last_element_split_split', class_and_file_split_without_last_element_split_split)
-
- console.log('class_and_file_split_without_last_element_split_split[0]', class_and_file_split_without_last_element_split_split[0])
-
- // remove any space in class_and_file_split_without_last_element_split_split[0]
- const class_and_file_split_without_last_element_split_split_0 = class_and_file_split_without_last_element_split_split[0].replace(/\s/g, '')
-
- // if (class_and_file_split_without_last_element_split[i].includes(exp0)) {
- if (class_and_file_split_without_last_element_split_split_0 === exp0) {
-
- console.log('class_and_file_split_without_last_element_split_split_0 === exp0:', class_and_file_split_without_last_element_split_split_0, exp0)
-
-
- // split with :
- // const class_and_file_split_without_last_element_split_split = class_and_file_split_without_last_element_split[i].split(':')
- // console.log('class_and_file_split_without_last_element_split_split',class_and_file_split_without_last_element_split_split)
- // console.log('class_and_file_split_without_last_element_split_split[1]',class_and_file_split_without_last_element_split_split[1])
-
- // class_and_file_split_without_last_element_split_split[1]
- exp[0] = `class_${class_and_file_split_without_last_element_split_split[1]}`;
- }
- }
-
- }
-
-
-
}
-
-
-
-
-
});
@@ -245,7 +140,7 @@ look here - https://github.com/c3js/c3/issues/493#issuecomment-456686654
render() {
return (
-
+
);
}
}
diff --git a/lab/webapp/src/components/FileUpload/index.js b/lab/webapp/src/components/FileUpload/index.js
index b2feba3fa..77be8bbb8 100644
--- a/lab/webapp/src/components/FileUpload/index.js
+++ b/lab/webapp/src/components/FileUpload/index.js
@@ -93,15 +93,9 @@ class FileUpload extends Component {
this.handleCatFeaturesUserTextBlur = this.handleCatFeaturesUserTextBlur.bind(this);
this.handleCatFeaturesUserTextAccept = this.handleCatFeaturesUserTextAccept.bind(this);
this.handleCatFeaturesUserTextCancel = this.handleCatFeaturesUserTextCancel.bind(this);
-
this.handleOrdinalFeaturesUserTextAccept = this.handleOrdinalFeaturesUserTextAccept.bind(this);
this.handleOrdinalFeaturesUserTextCancel = this.handleOrdinalFeaturesUserTextCancel.bind(this);
this.handleOrdinalFeaturesUserTextOnChange = this.handleOrdinalFeaturesUserTextOnChange.bind(this);
-
- this.handleclassUserTextAccept = this.handleclassUserTextAccept.bind(this);
- this.handleclassUserTextCancel = this.handleclassUserTextCancel.bind(this);
- this.handleclassUserTextOnChange = this.handleclassUserTextOnChange.bind(this);
-
this.handlePredictionType = this.handlePredictionType.bind(this);
this.getHeaderRowCells = this.getHeaderRowCells.bind(this);
this.getDataTablePreview = this.getDataTablePreview.bind(this);
@@ -121,7 +115,6 @@ class FileUpload extends Component {
this.ordinalFeaturesObjectToUserText = this.ordinalFeaturesObjectToUserText.bind(this);
this.validateFeatureName = this.validateFeatureName.bind(this);
this.getUserFeatureTypeControls = this.getUserFeatureTypeControls.bind(this);
- this.getUserFeatureClassControls = this.getUserFeatureClassControls.bind(this);
this.getUserDatasetOptions = this.getUserDatasetOptions.bind(this);
this.getFeatureType = this.getFeatureType.bind(this);
this.getFeatureIndex = this.getFeatureIndex.bind(this);
@@ -135,7 +128,6 @@ class FileUpload extends Component {
this.getElapsedTime = this.getElapsedTime.bind(this);
this.getOridinalRankingDialog = this.getOridinalRankingDialog.bind(this);
this.getOrdinalFeaturesUserTextModal = this.getOrdinalFeaturesUserTextModal.bind(this);
- this.getClassUserTextModal = this.getClassUserTextModal.bind(this);
this.getCatFeaturesUserTextModal = this.getCatFeaturesUserTextModal.bind(this);
this.handleKeyDown = this.handleKeyDown.bind(this);
this.enableKeyDownHandler = this.enableKeyDownHandler.bind(this);
@@ -170,25 +162,6 @@ class FileUpload extends Component {
2) or, in the Dataset Preview table below: use the dropdown boxes to specify ordinal features, then rank them
using the drag-and-drop list of unique categories.);
-
-
- // this.classHelpText = (
Class~~~~~. Ordinal features have a discrete number of categories,
- // and the categories have a logical order (rank). Some examples include size ("small",
- // "medium", "large"), or rank results ("first", "second", "third").
- //
- // You can specify these features and their rank in two ways:
- // 1) In the text input box opened by the button to the left, using the format described in the box
- // 2) or, in the Dataset Preview table below: use the dropdown boxes to specify ordinal features, then rank them
- // using the drag-and-drop list of unique categories.
);
-
-
- this.classHelpText = (
Class has a discrete number of categories in the dataset, and the categories can be written with natural language to help users to understand the data. For example, if the dataset has 3 classes such as 0,1, and2, and each class represents tiger, dog, and cat, the classes can be named as "tiger", "dog", and "cat".
-
- You can name the classes in the below way:
- 1) In the text input box opened by the button to the left, using the format described in the box
-
-
);
-
//Debug
this.isDevBuild = (!process.env.NODE_ENV || process.env.NODE_ENV === 'development');
this.timingPrevTimeMsec = new Date().getTime();
@@ -540,13 +513,6 @@ class FileUpload extends Component {
* Must be kept in sync with ordinalFeaturesObject */
ordinalFeaturesUserText: '',
ordinalFeaturesUserTextModalOpen: false,
-
-
- classUserText: '',
- classUserTextModalOpen: false,
-
-
- // oridinal
/** {object} Object used as dictionary to track the features designated as ordinal by user via dataset preview UI.
* key: feature name from dataPreview
* value: string-array holding possibly-ordered unique values for the feature.
@@ -555,21 +521,15 @@ class FileUpload extends Component {
* Using objects as dictionary: https://pietschsoft.com/post/2015/09/05/javascript-basics-how-to-create-a-dictionary-with-keyvalue-pairs
*/
ordinalFeaturesObject: {},
- classObject: {},
/** Holds previous versions of ordinal feature value orderings, so that they can be restored if
* user has defined them, then changed feature type, then goes back to type ordinal.
*/
ordinalFeaturesObjectPrev: {},
- classObjectPrev: {},
-
/** {string} The ordinal feature that is currently being ranked by sortable list, when sortable list is active. */
ordinalFeatureToRank: undefined,
- classToRank: undefined,
/** {array} Array of unique (and possibly sorted) values for the ordinal feature currently being ranked. This gets
* modified while user is ranking the values, and then stored to state if user finalizes changes. */
ordinalFeatureToRankValues: [],
- classToRankValues: [],
-
allFeaturesMenuOpen: false,
predictionType: this.defaultPredictionType,
/** {string} Used in unit testing to test state retrieval */
@@ -617,7 +577,6 @@ class FileUpload extends Component {
if(event.keyCode === 27 ) {
this.handleOrdinalRankCancel();
this.handleOrdinalFeaturesUserTextCancel();
- this.
this.handleCatFeaturesUserTextCancel();
}
}
@@ -764,72 +723,6 @@ handleCatFeaturesUserTextCancel() {
});
}
-
-
-
-
-
-
-
-
-/** Handler for accepting button to accept class user text element.
- * Examine and validate the contents.
- * If valid, ingest the text and update the ordinal features.
- * If invalid, show an error message.
- * @param {Event} e - DOM Event from user interacting with UI text field
- * @returns {void} - no return value
- */
-// handleOrdinalFeaturesUserTextAccept(e) {
- handleclassUserTextAccept(e) {
- //Validate the whole text
- // let result = this.ordinalFeaturesUserTextValidate();
- let result = this.classUserTextValidate();
- if( result.success ) {
- // this.ordinalFeaturesUserTextIngest();
- this.classUserTextIngest();
- // this.setState({ordinalFeaturesUserTextModalOpen: false})
- this.setState({classUserTextModalOpen: false})
- }
- else {
- //On error, the modal window showing the text input will stay open, so user
- // must either cancel or correct the error
- // this.showErrorModal("Error in Ordinal Feature text entry", result.message);
- this.showErrorModal("Error in Class text entry", result.message);
- // console.log("Error validating ordinal feature user text: " + result.message);
- console.log("Error validating class text: " + result.message);
- }
-}
-
-/** Handle cancel but for ordinal user text modal.
- * Resets ordinalFeaturesUserText to state from ordinalFeaturesObject */
-// handleOrdinalFeaturesUserTextCancel() {
-handleclassUserTextCancel() {
- // console.log("cancel button clicked");
- this.setState({
- // ordinalFeaturesUserText: this.ordinalFeaturesObjectToUserText(),
- classUserText: this.classUserTextObjectToUserText(),
- // ordinalFeaturesUserTextModalOpen: false,
- classUserTextModalOpen: false,
- })
-}
-
-/** Handle text change in the class user text input.
- * Simply stores the current value for use if user accepts the input. */
-// handleOrdinalFeaturesUserTextOnChange(e) {
-handleclassUserTextOnChange(e) {
- this.setState({
- // ordinalFeaturesUserText: e.target.value,
- classUserText: e.target.value,
- });
-}
-
-
-
-
-
-
-
-
handlePredictionType(e, data) {
this.setState({
predictionType: data.value,
@@ -1067,48 +960,13 @@ handleclassUserTextOnChange(e) {
const { uploadDataset } = this.props;
// only attempt upload if there is a selected file with a filename
if(this.state.selectedFile && this.state.selectedFile.name) {
-
-
-
-
-
- // console.log("localStorage.getItem('class')) ",localStorage.getItem('class'))
- // // if "class" is not in the session storage
- // if(!localStorage.getItem('class')) {
-
- // this.showErrorModal("Error with class name", "Please write a class name for your dataset");
-
- // this.setState({uploadButtonDisabled:false});
- // }
-
-
-
-
-
-
let data = this.generateFileData(); // should be FormData
-
-
- var class_name_log = true
- if (localStorage.getItem('class')===null) {
- console.log("localStorage.getItem('class')",localStorage.getItem('class'))
- class_name_log = false
- }
-
-
// if trying to create FormData results in error, don't attempt upload
if (data.errorResp) {
this.showErrorModal("Error with file metadata", data.errorResp);
//Reenable upload button since this error messge is blocking
this.setState({uploadButtonDisabled:false});
- } else if(class_name_log===false){
-
- console.log("class_name_log in else if",class_name_log)
- this.showErrorModal("Error with class name", "Please write a class name for your dataset");
- this.setState({uploadButtonDisabled:false});
-
- }
- else {
+ } else {
// after uploading a dataset request new list of datasets to update the page
uploadDataset(data).then(stuff => {
//window.console.log('FileUpload props after download', this.props);
@@ -1116,99 +974,18 @@ handleclassUserTextOnChange(e) {
let resp = this.props.dataset.fileUploadResp;
let errorRespObj = this.props.dataset.fileUploadError;
- console.log("resp",resp)
- console.log("errorRespObj",errorRespObj)
-
- console.log("localStorage.getItem('class')",localStorage.getItem('class'))
- console.log("uploadButtonDisabled",this.state.uploadButtonDisabled)
-
-
- // var class_name_log = true
- // if (localStorage.getItem('class')===null) {
- // console.log("localStorage.getItem('class')",localStorage.getItem('class'))
- // class_name_log = false
- // }
-
// if no error message and successful upload (indicated by presence of dataset_id)
// 'refresh' page when upload response from server is not an error and
// redirect to dataset page, when error occurs set component state
// to display popup containing server/error response
-
- // circling
- // if (!errorRespObj && resp.dataset_id)
-
- //
- if (!errorRespObj && resp.dataset_id && class_name_log)
- {
-
- console.log("errorRespObj",errorRespObj)
- console.log("resp.dataset_id",resp.dataset_id)
- console.log("class_name_log",class_name_log)
-
-
+ if (!errorRespObj && resp.dataset_id) {
this.props.fetchDatasets();
window.location = '#/datasets';
this.setState({uploadButtonDisabled:false});
-
-
- localStorage.removeItem("selectedFile_name");
- localStorage.setItem("selectedFile_name", this.state.selectedFile.name);
-
- // get class from selectedFile_name
- let class_string = localStorage.getItem("class");
-
-
-
- // combine class and this.state.selectedFile.name
- // let class_and_file = class_string + "&" + this.state.selectedFile.name;
-
- let class_and_file = class_string + "&" + this.state.selectedFile.name;
-
- // if "class_and_file" is in localStorage, get the value
- if (localStorage.getItem("class_and_file")) {
- console.log("class_and_file is in localStorage");
- let value = localStorage.getItem("class_and_file");
- value = value +"*"+class_and_file
- localStorage.setItem("class_and_file", value);
-
- // remove "class" from localStorage
- localStorage.removeItem("class");
-
- } else {
- // store class_and_file in localStorage
- localStorage.setItem("class_and_file", class_and_file);
- localStorage.removeItem("class");
- }
-
-
-
-
- }
- // else if (!localStorage.getItem('class')) {
-
- // this.showErrorModal("Error with class name", "Please write a class name for your dataset");
-
- // this.setState({uploadButtonDisabled:false});
- // }
-
- // if there is no 'class' in localStorage,
- // make the Upload dataset button disabled
- // console.log(localStorage.getItem('class'));
- // else if (true) {
- // console.log("localStorage.getItem('class')",localStorage.getItem('class'))
- // console.log("uploadButtonDisabled",this.state.uploadButtonDisabled)
- // this.setState({uploadButtonDisabled:true});
- // }
-
- else
- {
-
+ } else {
this.showErrorModal("Error Uploading Data", errorRespObj.errorResp.error || "Something went wrong");
this.setState({uploadButtonDisabled:false});
-
}
-
-
});
}
@@ -1532,20 +1309,6 @@ handleclassUserTextOnChange(e) {
return result;
}
-
- /** From state, convert the lists of unique values for classes into a string with
- * the ordinal feature name and its values, one per line.
- * @returns {string} - multi-line string with one ordinal feature and its unique values, comma-separated, per line
- */
- classUserTextObjectToUserText() {
- let result = "";
- for(var feature in this.state.classUserTextObject) {
- let values = this.state.classUserTextObject[feature];
- result += feature + ',' + values.join() + '\n';
- }
- return result;
- }
-
/** Parse a single line of user text for specifying ordinal features.
* Expects a comma-separated string of 2 or more field, with format
* ,,,...
@@ -1564,33 +1327,6 @@ handleclassUserTextOnChange(e) {
return {feature: feature, values: values}
}
-
- /** Parse a single line of user text for specifying ordinal features.
- * Expects a comma-separated string of 2 or more field, with format
- * ,,,...
- * Leading and trailing whitespace is removed on the whole line and for each comma-separated item
- * Does not do any validation
- * @param {string} line - single line of user text for ordinal feature specification
- * @returns {object} - {feature: , values: }
- */
- classUserTextParse(line) {
- // let feature = line.split(",")[0].trim();
- // let values = line.split(",").slice(1);
- // line is class_0:A,class_1:B,class_2:C
- let feature = line.split(":")[0].trim();
- let values = line.split(":")[1].split(",");
- //Remove leading and trailing white space from each element
- values = values.map(function (el) {
- return el.trim();
- });
- return {feature: feature, values: values}
- }
-
-
-
-
-
-
/** Take a SINGLE-line string for a SINGLE feature, of the format used in the UI box for a user to specify an ordinal feature and
* the order of its unique values, and check whether it's valid. The contained feature name must exist and the specifed
* unqiue values must all exactly match (regardless of order) the unqiue values for the feature in the data.
@@ -1625,69 +1361,6 @@ handleclassUserTextOnChange(e) {
return {success: true, message: ""}
}
-
-
-
-
-
-
-
- /** Take a SINGLE-line string for a SINGLE feature, of the format used in the UI box for a user to specify class and
- * the order of its unique values, and check whether it's valid. The contained feature name must exist and the specifed
- * unqiue values must all exactly match (regardless of order) the unqiue values for the feature in the data.
- * @param {string} string - the string holding the user's specification
- * @returns {object} - {success:[true|false], message:
- */
- // ordinalFeatureUserTextLineValidate(string) {
- classFeatureUserTextLineValidate(string) {
- // console.log(string)
- if( string.length === 0 ) {
- return {success: true, message: ""}
- }
- //Parse the line
- // let ordObj = this.ordinalFeaturesUserTextParse(string);
- let ordObj = this.classUserTextParse(string);
- //Make sure feature name is valid
- // if( !this.validateFeatureName(ordObj.feature) ) {
- // return {success: false, message: "Feature '" + ordObj.feature + "' was not found in the data."}
- // }
-
- //Make sure the feature name is not assigned as the dependent column
- // if( this.getDependentColumn() === ordObj.feature ) {
- // return {success: false, message: "Feature '" + ordObj.feature + "' is currently assigned as the Target Column."};
- // }
- //The remaining items are the unique values
- // if( ordObj.values === undefined || ordObj.values.length === 0) {
- // return {success: false, message: "Feature '" + ordObj.feature + "' - no values specified"}
- // }
- //Make sure the passed list of unique values matches the unique values from data,
- // ignoring order
- // let dataValues = this.getUniqueValuesForFeature(ordObj.feature);
- // if( dataValues.sort().join() !== ordObj.values.sort().join()) {
- // return {success: false, message: "Feature '" + ordObj.feature + "': categories do not match (regardless of order) the unique values in the data: " + dataValues + "."}
- // }
- //Otherwise we're good!
- // return {success: true, message: ""}
- // console.log(string)
- // save experiment.data._id and string to the session stroage
- // localStorage.setItem("data_id", this.experiment.data._id);
- // this.state.selectedFile.name
- // check if selectedFile_name is in the session storage
- // if yes, then update the string
- // if no, then create a new key-value pair
-
- // remove selectedFile_name from session storage
- // localStorage.removeItem("selectedFile_name");
-
- // localStorage.setItem("selectedFile_name", this.state.selectedFile.name);
- localStorage.setItem("class", string);
- console.log("success to store data_id and class in session storage")
- // current data name
- // experiment.data._id
- // localStorage.setItem("class", string);
- return {success: true, message: string}
- }
-
/** Validate the whole text input for specify ordinal features
* Uses the current state var holding the ordinal features user text.
* @returns {object} - {success: [true|false], message: }
@@ -1712,34 +1385,6 @@ handleclassUserTextOnChange(e) {
return {success: success, message: message}
}
- /** Validate the whole text input for specify class
- * Uses the current state var holding the ordinal features user text.
- * @returns {object} - {success: [true|false], message: }
- */
- // ordinalFeaturesUserTextValidate() {
- classUserTextValidate() {
- //Return true if empty
- // if(this.state.ordinalFeaturesUserText === ""){
- if(this.state.classUserText === ""){
- return {success: true, message: ""}
- }
- let success = true;
- let message = "";
- //Check each line individually
- // this.state.ordinalFeaturesUserText.split(/\r?\n/).map((line) => {
- this.state.classUserText.split(/\r?\n/).map((line) => {
- if(line === "")
- return;
- // let result = this.ordinalFeatureUserTextLineValidate(line);
- let result = this.classFeatureUserTextLineValidate(line);
- if(result.success === false){
- success = false;
- message += result.message + "\n";
- }
- })
- return {success: success, message: message}
- }
-
/** Process the current ordinal feature user text state variable to create
* relevant state data variables.
* Overrides any existing values in ordinalFeaturesObject
@@ -1763,36 +1408,6 @@ handleclassUserTextOnChange(e) {
//console.log(this.state.ordinalFeaturesObject);
}
-
-
-
- /** Process the current class user text state variable to create
- * relevant state data variables.
- * Overrides any existing values in ordinalFeaturesObject
- * Operates only on state variables.
- * Does NOT perform any validation on the user text
- * @returns {null}
- */
- classUserTextIngest() {
- // Get the lines before clearing ordinal features to default. Otherwise can
- // end up clearing ordinalFeaturesUserText in some cases.
- let lines = this.state.classUserText.split(/\r?\n/);
- // this.ordinalFeaturesClearToDefault();
- // this.ordinalFeaturesClearToDefault();
- //Process each line individually
- lines.map((line) => {
- if(line != "") {
- // let ordObj = this.ordinalFeaturesUserTextParse(line);
- let ordObj = this.classUserTextParse(line);
- // this.setFeatureType(ordObj.feature, this.featureTypeOrdinal, ordObj.values);
- }
- })
- //console.log("ingest: ordinals: ");
- //console.log(this.state.ordinalFeaturesObject);
- }
-
-
-
/** Helper method to generate a segment with a button that opens
* Sortable List popups for ordering an ordinal feature.
* @param {string} feature the feature to generate a button for.
@@ -2289,65 +1904,6 @@ handleclassUserTextOnChange(e) {
return content;
}
-
-
-
- getUserFeatureClassControls() {
-
- let itemContent=(
-
- {'Numeric / Categorical'}
-
(auto-detect)
-
- )
-
- let content = (
- //---- Ordinal Feature Text Input ----
-
-
-
-
-
-
- }
- trigger={
-
- }
- />
-
-
-
-
-
-
- )
- return content;
- }
-
/** Return the UI for ranking ordinal features via drag-and-drop
* NOTE there was a lot of trouble getting styling of this sortable list to work
* properly in the Semantic UI Modal element, so do it just this simple way as
@@ -2526,59 +2082,6 @@ handleclassUserTextOnChange(e) {
)
}
- getClassUserTextModal() {
- return(
-
-
-
-
-
For each class, enter one comma-separated line with the following format:
- [first category value:first class name],[second catergory value: second category value] ,...
-
For example:
- -1: dead, 1:survive
-
- {/*
To populate this text box with all features and their unique values, close this window and use the button to set all feature types as ordinal.
*/}
-
-
-
-
-
-
-
-
-
- )
- }
-
handleErrorModalClose(){
this.setState({
showErrorModal: false,
@@ -2624,7 +2127,6 @@ handleclassUserTextOnChange(e) {
let errorContent;
let dataPrevTable = this.getDataTablePreview();
let userFeatureTypeControls = this.getUserFeatureTypeControls();
- let userFeatureClassControls = this.getUserFeatureClassControls();
let userDatasetOptions = this.getUserDatasetOptions();
// default to hidden until a file is selected, then display input areas
@@ -2951,13 +2453,6 @@ handleclassUserTextOnChange(e) {
return this.getOrdinalFeaturesUserTextModal();
}
- //Show pseudo-modal window for class specifications.
- if(this.state.classUserTextModalOpen) {
- return this.getClassUserTextModal();
- }
-
-
-
//Show pseudo-modal window for textual input of categorical feature specifications.
if(this.state.catFeaturesUserTextModalOpen) {
return this.getCatFeaturesUserTextModal();
@@ -3406,23 +2901,13 @@ handleclassUserTextOnChange(e) {
{/*dropdowns for selecting dep. feature and prediction type*/}
{userDatasetOptions}
-
{/*buttons for specifying feature types*/}
{userFeatureTypeControls}
- {/*buttons for specifying feature and class*/}
-
- {userFeatureClassControls}
-
{/*upload button*/}
Upload
@@ -3431,10 +2916,7 @@ handleclassUserTextOnChange(e) {
{/* Cancel button */}