/** * @typedef {import('@mixly/python-mixpy').PythonMixpySKLearnBlocks} PythonMixpySKLearnBlocks */ import * as Blockly from 'blockly/core'; const SKLEARN_HUE = 80; /** * @override Override {@link PythonMixpySKLearnBlocks.sklearn_LinearRegression} */ //sklearn 初始化线性回归 export const sklearn_LinearRegression = { init: function () { this.appendDummyInput() .appendField('sklearn ' + Blockly.Msg.SKLEARN_LINEARREGRESSION_INIT); this.appendValueInput('model_name') .setCheck(null) .setAlign(Blockly.inputs.Align.RIGHT) .appendField(Blockly.Msg.MODEL_NAME); this.appendValueInput('fit_intercept') .setCheck(null) .setAlign(Blockly.inputs.Align.RIGHT) .appendField(Blockly.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT); this.appendValueInput('n_jobs') .setCheck(null) .setAlign(Blockly.inputs.Align.RIGHT) .appendField(Blockly.Msg.SKLEARN_THREADS); this.setInputsInline(false); this.setPreviousStatement(true, null); this.setNextStatement(true, null); this.setColour(SKLEARN_HUE); this.setTooltip(''); this.setHelpUrl(''); } };