File tree Expand file tree Collapse file tree 10 files changed +323
-283
lines changed Expand file tree Collapse file tree 10 files changed +323
-283
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import ProjectSelector from '../containers/ProjectSelector';
17
17
import ProjectTab from '../containers/ProjectTab' ;
18
18
import DatasetsTab from './DatasetsTab' ;
19
19
import FeaturesTab from '../containers/FeaturesTab' ;
20
- import ModelsTab from './Models ' ;
20
+ import ModelsTab from './ModelsTab ' ;
21
21
import PredictTab from './Predictions' ;
22
22
import colorScheme from './colorscheme' ;
23
23
import Progress from './Progress' ;
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import PropTypes from 'prop-types' ;
3
+
4
+
5
+ const ModelInfo = props => (
6
+ < table className = "table" >
7
+ < thead >
8
+ < tr >
9
+ < th > Model Type</ th >
10
+ < th > Hyperparameters</ th >
11
+ < th > Training Data Score</ th >
12
+ </ tr >
13
+ </ thead >
14
+ < tbody >
15
+ < tr >
16
+ < td >
17
+ { props . model . type }
18
+ </ td >
19
+ < td >
20
+ < table >
21
+ < tbody >
22
+ {
23
+ Object . keys ( props . model . params ) . map ( ( param , idx ) => (
24
+ < tr key = { idx } >
25
+ < td > { param } </ td >
26
+ < td style = { { paddingLeft : "5px" } } > { JSON . stringify ( props . model . params [ param ] ) } </ td >
27
+ </ tr >
28
+ ) )
29
+ }
30
+ </ tbody >
31
+ </ table >
32
+ </ td >
33
+ < td >
34
+ { props . model . train_score }
35
+ </ td >
36
+ </ tr >
37
+ </ tbody >
38
+ </ table >
39
+ ) ;
40
+ ModelInfo . propTypes = {
41
+ model : PropTypes . object . isRequired
42
+ } ;
43
+
44
+ export default ModelInfo ;
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import PropTypes from 'prop-types' ;
3
+
4
+ import { TextInput , CheckBoxInput } from '../Form' ;
5
+
6
+
7
+ const ModelParamsForm = ( props ) => {
8
+ const style = {
9
+ } ;
10
+
11
+ const { model } = { ...props } ;
12
+
13
+ return (
14
+ < div style = { style } >
15
+ < h3 > { model . name } </ h3 >
16
+ { model . params . map ( ( param , idx ) => {
17
+ const pProps = props [ param . name ] ;
18
+ if ( param . type === 'bool' ) {
19
+ return < CheckBoxInput key = { idx } label = { param . name } { ...( pProps ) } /> ;
20
+ } else {
21
+ return < TextInput key = { idx } label = { param . name } { ...( pProps ) } /> ;
22
+ }
23
+ } ) }
24
+ </ div >
25
+ ) ;
26
+ } ;
27
+
28
+ export default ModelParamsForm ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import PropTypes from 'prop-types' ;
3
+
4
+ import Expand from '../Expand' ;
5
+ import ModelsTable from '../../containers/ModelsTable' ;
6
+ import NewModelForm from '../../containers/NewModelForm' ;
7
+
8
+
9
+ const ModelsTab = props => (
10
+ < div >
11
+ < Expand label = "Create New Model" id = "newModelExpander" >
12
+ < NewModelForm selectedProject = { props . selectedProject } />
13
+ </ Expand >
14
+
15
+ < ModelsTable selectedProject = { props . selectedProject } />
16
+ </ div >
17
+ ) ;
18
+ ModelsTab . propTypes = {
19
+ selectedProject : PropTypes . object
20
+ } ;
21
+ ModelsTab . defaultProps = {
22
+ selectedProject : null
23
+ } ;
24
+
25
+ export default ModelsTab ;
You can’t perform that action at this time.
0 commit comments