fix UPDATE in node and add introduction component

This commit is contained in:
Hubert Sokołowski
2023-04-24 23:36:28 +02:00
parent 5e86ab7e54
commit fb31b90a36
3 changed files with 22 additions and 6 deletions

View File

@@ -48,7 +48,7 @@ function buildDecisionTreeUpdate(
if (isChanged) {
//var maxDif, attribute1, attribute2, match, notMatch, L_weight, predicateName, predicate;
console.log('@ ISCHANGE');
console.log('@ ISCHANGE _ HUBERT');
var expr = oldAlgorithm[0];
bestTests = oldTree.tests;
switch (expr) {
@@ -60,8 +60,8 @@ function buildDecisionTreeUpdate(
match = result.match;
notMatch = result.notMatch;
predicate = result.predicateName;
console.log('@ ISCHANGE - c45');
console.log(result);
console.log('@ ISCHANGE - c45 - HUBERT');
console.log(result, changedAttribute1, changedAttribute2);
break;
case 'TSP':
console.log('t');
@@ -432,7 +432,7 @@ function tspisChange(changedAttribute1, changedAttribute2, trainingSet, category
for (let element of trainingSet) {
const attribute = element[categoryAttr];
if (element[changedAttribute1] < element[changedAttribute2]) {
if (parseFloat(element[changedAttribute1]) < parseFloat(element[changedAttribute2])) {
left++;
leftList.push(element);
classMatrix[0][allClasses.indexOf(attribute)]++;
@@ -486,7 +486,7 @@ function tspwisChange(changedAttribute1, changedAttribute2, weight, trainingSet,
for (let element of trainingSet) {
const attribute = element[categoryAttr];
if (element[changedAttribute1] < weight * element[changedAttribute2]) {
if (parseFloat(element[changedAttribute1]) < weight * parseFloat(element[changedAttribute2])) {
left++;
leftList.push(element);
classMatrix[0][allClasses.indexOf(attribute)]++;

View File

@@ -7,6 +7,7 @@ import { BuilderConfigProvider } from '../contexts/BuilderConfigContext';
import { TestTreeProvider } from '../contexts/TestTreeContext';
import ModelBuilder from './ModelBuilder';
import { Footer } from './Footer';
import { Readme } from './Readme';
function Main() {
const [builder, setBuilder] = useState({});
@@ -56,7 +57,10 @@ function Main() {
<Tree options={builder} headers={headers} />
)
) : (
<div>Deploy your set</div>
<div>
Deploy your set
<Readme />
</div>
)}
</div>

12
src/components/Readme.jsx Normal file
View File

@@ -0,0 +1,12 @@
import { Box } from '@chakra-ui/react';
import React from 'react';
export const Readme = () => (
<Box>
<Box>Readme</Box>
<Box>What is it?</Box>
<Box>Examples of data sets:</Box>
<Box>1</Box>
<Box>2</Box>
</Box>
);