<jupyter_start><jupyter_text>Scan and find Busca en primer lugar las cantidades de variables, para luego encontrar el tipo de estas a partir de la consulta de un modelo victima.  Load best model<jupyter_code>import joblib as jb
import numpy as np
model=jb.load('rfDefense2021.sav')
print(model)
datafake=np.array([[0]])
try:
    model.predict(datafake)
except Exception as ex:
    text = "An exception of type {} occurred. Arguments:\n{}"
    message = text.format(type(ex).__name__, ex.args)
    print (message)<jupyter_output>An exception of type ValueError occurred. Arguments:
('X has 1 features, but DecisionTreeClassifier is expecting 10 features as input.',)<jupyter_text>ahora se testea el tipo de variables<jupyter_code>datafake=np.array([["0","0","1","0","500",0,0,0,0,0]])
datafake.shape
try:
    print(model.predict(datafake))
except Exception as ex:
    text = "An exception of type {} occurred. Arguments:\n{}"
    message = text.format(type(ex).__name__, ex.args)
    print (message)<jupyter_output>['benign']<jupyter_text>El modelo recibe datos numericos solamente aunque estos esten en formato string. reconoce el error de tipo cuando:- al menos una variable es string y contiene letras- todas las variables son string y son númerosno lo reconoce cuando:- hay enteros y string que contienen numeros<jupyter_code>from itertools import product


def bruteForce():   
    nMax=14
    numericValue=0
    categoricalValue='word'
    bruteTest=np.array([])
    valuesPosible=[numericValue,categoricalValue]
    result=''
    
        
    for x in range(nMax):
        
        
        bruteTest=np.append(bruteTest, categoricalValue)
        bruteTestMix=np.copy(bruteTest)
        
        for y in product(valuesPosible, repeat=x):
            
            bruteTestMix=np.asarray(y)
            print(bruteTestMix.shape)
            print(bruteTestMix)
            try:
                
                #print(model.predict(bruteTestMix.reshape(1,-1)))
                result=model.predict(bruteTestMix.reshape(1,-1))
                break
                
            except Exception as ex:
                print ('fault')
        
            
        if result!='':
            return result
       
                    

        
        
print(bruteForce())<jupyter_output>(0,)
[]
fault
(1,)
[0]
fault
(1,)
['word']
fault
(2,)
[0 0]
fault
(2,)
['0' 'word']
fault
(2,)
['word' '0']
fault
(2,)
['word' 'word']
fault
(3,)
[0 0 0]
fault
(3,)
['0' '0' 'word']
fault
(3,)
['0' 'word' '0']
fault
(3,)
['0' 'word' 'word']
fault
(3,)
['word' '0' '0']
fault
(3,)
['word' '0' 'word']
fault
(3,)
['word' 'word' '0']
fault
(3,)
['word' 'word' 'word']
fault
(4,)
[0 0 0 0]
fault
(4,)
['0' '0' '0' 'word']
fault
(4,)
['0' '0' 'word' '0']
fault
(4,)
['0' '0' 'word' 'word']
fault
(4,)
['0' 'word' '0' '0']
fault
(4,)
['0' 'word' '0' 'word']
fault
(4,)
['0' 'word' 'word' '0']
fault
(4,)
['0' 'word' 'word' 'word']
fault
(4,)
['word' '0' '0' '0']
fault
(4,)
['word' '0' '0' 'word']
fault
(4,)
['word' '0' 'word' '0']
fault
(4,)
['word' '0' 'word' 'word']
fault
(4,)
['word' 'word' '0' '0']
fault
(4,)
['word' 'word' '0' 'word']
fault
(4,)
['word' 'word' 'word' '0']
fault
(4,)
['word' 'word' 'word' 'word']
fault
(5,)
[0 0 0 0 0]
fault
(5,)
['0' '0' '0' '0' 'word']
fault
(5,)
['0' '0' '0' [...]
StarcoderdataJupyterStructuredCleanDedup